lkml.org 
[lkml]   [2021]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] x86/perf: Fixed kernel panic during boot on Nano processor.
    Date
    From: CodyYao-oc <CodyYao-oc@zhaoxin.com>

    Nano processor may not fully support rdpmc instruction, it works well
    for reading general pmc counter, but will lead to GP(general protection)
    when accessing fixed pmc counter. Futhermore, family/model information
    is same between Nano processor and ZX-C processor, it leads to zhaoxin
    pmu driver is wrongly loaded for Nano processor, which resulting boot
    kernal fail.

    To solve this problem, stepping information will be checked to distinguish
    between Nano processor and ZX-C processor.

    [https://bugzilla.kernel.org/show_bug.cgi?id=212389]

    Reported-by: Arjan <8vvbbqzo567a@nospam.xutrox.com>
    Signed-off-by: CodyYao-oc <CodyYao-oc@zhaoxin.com>
    ---
    arch/x86/events/zhaoxin/core.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/arch/x86/events/zhaoxin/core.c b/arch/x86/events/zhaoxin/core.c
    index 949d845c922b..cef1de251613 100644
    --- a/arch/x86/events/zhaoxin/core.c
    +++ b/arch/x86/events/zhaoxin/core.c
    @@ -541,7 +541,8 @@ __init int zhaoxin_pmu_init(void)

    switch (boot_cpu_data.x86) {
    case 0x06:
    - if (boot_cpu_data.x86_model == 0x0f || boot_cpu_data.x86_model == 0x19) {
    + if ((boot_cpu_data.x86_model == 0x0f && boot_cpu_data.x86_stepping >= 0x0e) ||
    + boot_cpu_data.x86_model == 0x19) {

    x86_pmu.max_period = x86_pmu.cntval_mask >> 1;

    --
    2.17.1
    \
     
     \ /
      Last update: 2021-06-07 03:33    [W:3.225 / U:0.476 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site