Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1836375rwd; Fri, 9 Jun 2023 02:59:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56En6VM+iQTYSfFmNh4RleteF1zfvkcbrEiUSbYzKLiup4nmAi4XKHaTF1KZtops2NxC33 X-Received: by 2002:aca:1c03:0:b0:39c:4553:964b with SMTP id c3-20020aca1c03000000b0039c4553964bmr965656oic.50.1686304750726; Fri, 09 Jun 2023 02:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686304750; cv=none; d=google.com; s=arc-20160816; b=y/6F7XAPjaZyk4+vM5AWVqfY0AQ/Gwmn0cGs6F0ovYb3FLBosfXNDiB0TgsJodHyoJ HwJU30/zBRVXHA31eIrFIb0IOgXhGvQ2pXrQTVdtrdIuEiibMVgMiCtuOkCn9vD3/E+M Mytwi5QuZC4qibaIo9mCTey2uCxYF33bWT3E9VHWUo6lPgo2zvJTvHisCLf+8fLggyPl Bz9p40pTzoKetc6mqZblnINrcY3O0YsV0z9I/+U2inUTVyfAk9UHiOmKJeN2JGwwgvAb vs8y8Kleb36dHwDfM0mK6+wDaOKwiYXmBR+62ckGI5XqQs2m4WT3Lv0RzBhMW72k0o96 XvuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YcCQPG8y3dSLgQLIlvWLx+3NJC59daSU+Tl50CwnUlM=; b=lbJzJaNJl1Ro+ldk7i/LUPlBnz04/ngvkry6KfHMLKDq4/3jUW/IP1W107C/QlD+S9 l4c8LADtVBvYKwezMP+RC+rpNfmftR9Mhvs2zjHNV+wDDJ0Y+JUeuvz3JmXgErnU0LBm dI5QeENfVVd4ZxZiLeCwWtmQ57v+lPCqfuslgfcO5MQQcUBtX95wiXPHWlm2WkovaW4y 0dG9Dgxuxt0UBFKasYvLlJ/FZ9wZ6YwBuTYydw+MR2dazuUstVb92bftARed9LWkqSnk boEgjSyOE6MploK6xiHww816fA9ZJXbiBD8gEs2x6+iMAssGfKgexLHziwEWcy7JKsVo Kkgg== 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 y184-20020a6264c1000000b0064f33d8954csi2220819pfb.203.2023.06.09.02.58.58; Fri, 09 Jun 2023 02:59:10 -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 S240669AbjFIJZo (ORCPT + 99 others); Fri, 9 Jun 2023 05:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241632AbjFIJY7 (ORCPT ); Fri, 9 Jun 2023 05:24:59 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9AC6D4C3D; Fri, 9 Jun 2023 02:19:04 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1q7XQE-0004Jv-0C; Fri, 09 Jun 2023 10:24:38 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 73C6EC02EE; Fri, 9 Jun 2023 10:24:23 +0200 (CEST) Date: Fri, 9 Jun 2023 10:24:23 +0200 From: Thomas Bogendoerfer To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] MIPS: cpu-features: Use boot_cpu_type for CPU type based features Message-ID: <20230609082423.GM8160@alpha.franken.de> References: <20230607055122.26175-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230607055122.26175-1-jiaxun.yang@flygoat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, Jun 07, 2023 at 01:51:22PM +0800, Jiaxun Yang wrote: > Some CPU feature macros were using current_cpu_type to mark feature > availability. > > However current_cpu_type will use smp_processor_id, which is prohibited > under preemptable context. > > Since those features are all uniform on all CPUs in a SMP system, use > boot_cpu_type instead of current_cpu_type to fix preemptable kernel. > > Cc: stable@vger.kernel.org > Signed-off-by: Jiaxun Yang > --- > arch/mips/include/asm/cpu-features.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h > index 2a0b90077b50..8c6d4a87db37 100644 > --- a/arch/mips/include/asm/cpu-features.h > +++ b/arch/mips/include/asm/cpu-features.h > @@ -125,7 +125,7 @@ > ({ \ > int __res; \ > \ > - switch (current_cpu_type()) { \ > + switch (boot_cpu_type()) { \ > case CPU_CAVIUM_OCTEON: \ > case CPU_CAVIUM_OCTEON_PLUS: \ > case CPU_CAVIUM_OCTEON2: \ > @@ -373,7 +373,7 @@ > ({ \ > int __res; \ > \ > - switch (current_cpu_type()) { \ > + switch (boot_cpu_type()) { \ > case CPU_M14KC: \ > case CPU_74K: \ > case CPU_1074K: \ > -- > 2.39.2 (Apple Git-143) applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]