Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1000002rwi; Thu, 13 Oct 2022 07:54:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73l1bEEKUk6Si5mIsJY4QNYOZVeANWflgT0GexCz6kYy+2OkRkK3b4YJpGQMbH03cI3iQa X-Received: by 2002:a17:90a:8044:b0:20a:6412:3b8c with SMTP id e4-20020a17090a804400b0020a64123b8cmr168260pjw.139.1665672864739; Thu, 13 Oct 2022 07:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665672864; cv=none; d=google.com; s=arc-20160816; b=cHTvqbRligjoB00kGsQi9J03yZGA8oyo8GWt+o4WczAwdf+wJFaQ/MCCk8FeWaUuya TxEWIZDGC2y8yRthu0/30qTLzeV79MM89XKXSGlZbZ/XDbI49o2+4ZaMD2WoIDTTtiCv KaBMoowsLq6++9ySViS/mquONytNMqFlyMgj7ZDqh6THEiEQaV0VZ6rUe84rB4zK4cfS Bu4J1qZKvqBOWNq5c57EoIrxZNS9dmLIhGt4fpN3M3dYxUm/p0utfYcVHmut3xvv8zXT kypEsTPovewLOjb2f5e6dFteM8Koxm9eaulJj6S4zDrOZtyDILCl0TdlUfkA4LC5U/Rm BDaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Zo7cqW7+DM4OioqHj3YyJvPuZN2SSa4T16IEOtvcxOU=; b=gO7Tsi/atsS3zPzgkBIO2qc+4j12npRv8EMes745sed4hvYtaUQgwoVXYY5C3oAHN0 96LVvVpm82rcawzJHOMZ8PitXOBGdawqP6bhsB4qrUfv7xACl3ZfGd2lzXjPl2t7b9su xJq3cogTW6NBIdHoK9rCji2Rp0Yl8MiWLu0mcG0tj49vr0pWshZE9jb7xfCT0CYZ7zAH 5WGVPDAzMXhjM3nngMgHWHY9vps09wvVoHqVbJ8E/UTBf2W8NncM0rLqsV7vv5+RMFFY /riEkyBy+1Ulkfm1nTDCUNLcVbRQcdYGLOkW1Zx7l1UQQkbnlvyJmAS3j7yegNS/isPy 1PrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a170902db0300b00176c9015627si928034plx.94.2022.10.13.07.54.07; Thu, 13 Oct 2022 07:54:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbiJMNy4 (ORCPT + 99 others); Thu, 13 Oct 2022 09:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230165AbiJMNxn (ORCPT ); Thu, 13 Oct 2022 09:53:43 -0400 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8234::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 743CCE09CB; Thu, 13 Oct 2022 06:51:30 -0700 (PDT) Received: from [2a02:8108:963f:de38:eca4:7d19:f9a2:22c5]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1oiyaB-00075D-RC; Thu, 13 Oct 2022 15:49:07 +0200 Message-ID: Date: Thu, 13 Oct 2022 15:49:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] x86/perf: Fixed kernel panic during boot on Nano processor. Content-Language: en-US, de-DE To: Codyyao-oc , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, x86@kernel.org Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, shyaololo@163.com, 8vvbbqzo567a@nospam.xutrox.com, "regressions@lists.linux.dev" References: <20210607013109.7870-1-CodyYao-oc@zhaoxin.com> <174219f5-c8ab-0ee4-8055-5cfa60c6a0fc@zhaoxin.com> From: Thorsten Leemhuis In-Reply-To: <174219f5-c8ab-0ee4-8055-5cfa60c6a0fc@zhaoxin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1665669090;75f23c8f; X-HE-SMSGID: 1oiyaB-00075D-RC X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi perf maintainers and Codyyao-oc! What happened to below patch, which was posted many moons ago? It wasn't merged afaics. Did it fall through the cracks or is there something wrong with it? I'm asking because a user who reported this regression asked what's up: https://bugzilla.kernel.org/show_bug.cgi?id=212389 On 30.06.21 06:38, Codyyao-oc wrote: > > 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.")" Just BTW: You want to add that tag to your patch description. > 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. And this... >> [https://bugzilla.kernel.org/show_bug.cgi?id=212389] ...should look like this: Link: https://bugzilla.kernel.org/show_bug.cgi?id=212389 Ohh, and you might want to add this to ensure backporting: Cc: # 5.10.x Guess adding those and submitting it again might be wise and help to finally get this regression resolved. Ciao, Thorsten >> 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; >>