Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp11446pxv; Tue, 29 Jun 2021 21:57:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb7GLOD5EkJd4eVsTJzTGOjsbgQGDF60U9WIOfAkgMyp/Kk7ziB8J43ruLZuEZPLGGWAtw X-Received: by 2002:a17:907:1c1c:: with SMTP id nc28mr33908275ejc.367.1625029025653; Tue, 29 Jun 2021 21:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625029025; cv=none; d=google.com; s=arc-20160816; b=jP9ALdncgYfNUiuQyfm5rD/OCw3M57zYowl2jVKoe80f5rkrH8B4atKrpJl4BSlKN7 OPQ2maC+69l/q+wCSeXo5TAx2Z5ZfTwh0iKcc1FLxf6xNvSID/G/gTk6qFUkm36MgLm2 QUiw7VucTNuG/bb6XZ06WYCpGmznrdCEzvBCeXEZMOpDlOTR2+NsC8PUlNsKpR/y9e/z 2WC8Hv2fYQaZOnYRPfAyhP4M0pRU74t8PQGvCEC7PmuCKvEKHzDF6vstjL/si/VKQw8t j5e2Tw5JkGu87jiGpsaoRp3FkIt9pKN0k+5qIOML12htftDjiEhumrczh9Le2wk9bUHJ MWBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=sdF6b+WFtLkJpYoIGXvAnRjvv/khw8h4SLgfGztBzAc=; b=Yu8BRnfXOOZP/cxOwzo9Qamomc6KShZBo1IZcbFfkXUj7zWqpNH/i6ZCLryjS7Od9I XlTbM8lKB+Bu3b0VfGQvIGhrR6MOjPhARso/81EDhYfOe6KV1hmZniCHMgnym9H0Y8K8 TvrTQvxxaQ3eOIvpbFHHYO40BvHtKHMfI0mZEHPI8tQDu6Epp434MpJedRFcLVSAsAwE AZ32QUlbesjEAfIPDSVkIar0mN3X0MwARFAImRfxHy0Weg20A9GxBddvmsaD8PJx4QkP 16Pd7AXAuI2dVulmwqmauKEtqwIAGV56rS0Yh+SCYl61J0YqtKXBHHkTWvXmwcUbKQlw JPQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kb6si9166100ejb.648.2021.06.29.21.56.43; Tue, 29 Jun 2021 21:57:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbhF3ElA (ORCPT + 99 others); Wed, 30 Jun 2021 00:41:00 -0400 Received: from ZXSHCAS1.zhaoxin.com ([203.148.12.81]:42154 "EHLO ZXSHCAS1.zhaoxin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbhF3ElA (ORCPT ); Wed, 30 Jun 2021 00:41:00 -0400 Received: from zxbjmbx2.zhaoxin.com (10.29.252.164) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 30 Jun 2021 12:38:29 +0800 Received: from [10.28.64.110] (10.28.64.110) by zxbjmbx2.zhaoxin.com (10.29.252.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 30 Jun 2021 12:38:28 +0800 Subject: Re: [PATCH] x86/perf: Fixed kernel panic during boot on Nano processor. To: , , , , , , , , , , CC: , , , <8vvbbqzo567a@nospam.xutrox.com> References: <20210607013109.7870-1-CodyYao-oc@zhaoxin.com> From: Codyyao-oc Message-ID: <174219f5-c8ab-0ee4-8055-5cfa60c6a0fc@zhaoxin.com> Date: Wed, 30 Jun 2021 12:38:27 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210607013109.7870-1-CodyYao-oc@zhaoxin.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.28.64.110] X-ClientProxiedBy: ZXSHCAS2.zhaoxin.com (10.28.252.162) To zxbjmbx2.zhaoxin.com (10.29.252.164) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Mingo and Peter, Thank you for taking your precious time to read this letter, I am very graterful. Last month, I fixed the bug that boot failed on Nano processor which introduced by "Fixes: 3a4ac121c2ca ("x86/perf: Add hardware performance events support for Zhaoxin CPU.")" with Arjan's help and submitted this patch.  But I haven't got back. Greatly appreciate if you could kindly check it and reply at your convenience. Many Thanks! Cody On 2021/6/7 上午9:31, Cody Yao-oc wrote: > From: CodyYao-oc > > 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 > --- > 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; >