Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145145pxv; Fri, 9 Jul 2021 19:26:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzExmUbx/67HFEyZGfFVTWpTbVnp6XaoHpaprt59fH52Bq1Vk2vjPZ9cH+qX6yM+tPjauX/ X-Received: by 2002:a17:907:9495:: with SMTP id dm21mr40141674ejc.526.1625884011511; Fri, 09 Jul 2021 19:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884011; cv=none; d=google.com; s=arc-20160816; b=bUcNl4Gt6h2pB36R83PWRkbjPWEwfNpHc7YtkWsmTvffpkiQljBr0tbmTh77DMi45f 0gLsiqtBSWXusEPWtHFGi0XdifgT4mN7xfqBxtqvMad5Zi3z74vDa7w/OzzzjKdVQU9m 65A11ev1TGTeKoHkYdHlu1YmdxM2x4wSG5sbPuXEjRpagVC616PLianC1I6tbNqyDjoK voBRW05B6yrmsSzA6TILax8ltnDjpFT+P8y2JUOekGOMqOcQU5Hc+ofUMPrg/ecVzl7s rBQfaRa2+RY+sn+NoA/2+tleejl5F2UG0wNx27C5Si27n3Rl0zzPlXpvX+WcKKkZ08+6 y/kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pcjtd11lwWL3vYu1Ske8Fgv5+egr5UhhPV/80TtajPY=; b=0qLZAt1Ddfnkp9HLMszabB6LhyVulyoKKejNnEEZvAhCgeirbSkK00qS+MOh7nHo3o EgPPyCQqe7FlMepltqdrQ479l+ODcm6qYPggrb2h59nWkbqECe6avY3H4Tvye3fnWTqT RO8mwWo2/lhSRrh8KCH1lL18Mz+uuttNYAbeFjmZDafESGOu2ITPLUbs6MCzTHmWnGdH w6oJvHczcdCIgDo8anUfn7GGoBjoe21a26ploa96slPDzLwZSMyLB8bwH5KI0AM6q8+j /bHEx3vL8dkQd18d+60uoW+2ITFTiBkwkpIURpe7cgw0aWz/i5lxJeoGalb67oNVXP7R TSew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aa8Q4MQm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si9089324edr.527.2021.07.09.19.26.28; Fri, 09 Jul 2021 19:26:51 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aa8Q4MQm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232536AbhGJC1m (ORCPT + 99 others); Fri, 9 Jul 2021 22:27:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:43180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231990AbhGJC02 (ORCPT ); Fri, 9 Jul 2021 22:26:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 033E5613E4; Sat, 10 Jul 2021 02:23:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883821; bh=0lu2ozF2u5FD94Y0WiATsNzTVs1Ed26bgS2aoatc3D4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aa8Q4MQm3McAAK3D8CTPqoExM9b9ZeW/ZbMteIRmffkHqhke+0thkfcNv7HsguzPf fUKlNMqqeDT7yyFCMVRQ3e9/laoNdqShrnn4qqXTu660LQaQPMhDJsKjgy5Ln7F0DI Jl2utkD9+Q37RV9OrW/O6Y6TsfGxFwHd/nsiLgox62Ob0+4Un8oCspCXSyGswQ2qFM Vi5wIa02nGvbqRJs5EgMIvoC1zgF0fl6xwgnfErsmZ2bqgJdPTjkxZrjt17Ah2eNcK cLNIDbrtvbaZCP19OIDPnYl9ZD82diFRRkCNmJFXjF1yxvGVO6IT3QNmtpT7dYOxoM LSP8smpmBHeIw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Aneesh Kumar K.V" , Christophe Leroy , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.12 070/104] powerpc/mm/book3s64: Fix possible build error Date: Fri, 9 Jul 2021 22:21:22 -0400 Message-Id: <20210710022156.3168825-70-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Aneesh Kumar K.V" [ Upstream commit 07d8ad6fd8a3d47f50595ca4826f41dbf4f3a0c6 ] Update _tlbiel_pid() such that we can avoid build errors like below when using this function in other places. arch/powerpc/mm/book3s64/radix_tlb.c: In function ‘__radix__flush_tlb_range_psize’: arch/powerpc/mm/book3s64/radix_tlb.c:114:2: warning: ‘asm’ operand 3 probably does not match constraints 114 | asm volatile(PPC_TLBIEL(%0, %4, %3, %2, %1) | ^~~ arch/powerpc/mm/book3s64/radix_tlb.c:114:2: error: impossible constraint in ‘asm’ make[4]: *** [scripts/Makefile.build:271: arch/powerpc/mm/book3s64/radix_tlb.o] Error 1 m With this fix, we can also drop the __always_inline in __radix_flush_tlb_range_psize which was added by commit e12d6d7d46a6 ("powerpc/mm/radix: mark __radix__flush_tlb_range_psize() as __always_inline") Signed-off-by: Aneesh Kumar K.V Reviewed-by: Christophe Leroy Acked-by: Michael Ellerman Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210610083639.387365-1-aneesh.kumar@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/mm/book3s64/radix_tlb.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/mm/book3s64/radix_tlb.c b/arch/powerpc/mm/book3s64/radix_tlb.c index 409e61210789..817a02ef6032 100644 --- a/arch/powerpc/mm/book3s64/radix_tlb.c +++ b/arch/powerpc/mm/book3s64/radix_tlb.c @@ -291,22 +291,30 @@ static inline void fixup_tlbie_lpid(unsigned long lpid) /* * We use 128 set in radix mode and 256 set in hpt mode. */ -static __always_inline void _tlbiel_pid(unsigned long pid, unsigned long ric) +static inline void _tlbiel_pid(unsigned long pid, unsigned long ric) { int set; asm volatile("ptesync": : :"memory"); - /* - * Flush the first set of the TLB, and if we're doing a RIC_FLUSH_ALL, - * also flush the entire Page Walk Cache. - */ - __tlbiel_pid(pid, 0, ric); + switch (ric) { + case RIC_FLUSH_PWC: - /* For PWC, only one flush is needed */ - if (ric == RIC_FLUSH_PWC) { + /* For PWC, only one flush is needed */ + __tlbiel_pid(pid, 0, RIC_FLUSH_PWC); ppc_after_tlbiel_barrier(); return; + case RIC_FLUSH_TLB: + __tlbiel_pid(pid, 0, RIC_FLUSH_TLB); + break; + case RIC_FLUSH_ALL: + default: + /* + * Flush the first set of the TLB, and if + * we're doing a RIC_FLUSH_ALL, also flush + * the entire Page Walk Cache. + */ + __tlbiel_pid(pid, 0, RIC_FLUSH_ALL); } if (!cpu_has_feature(CPU_FTR_ARCH_31)) { @@ -1176,7 +1184,7 @@ void radix__tlb_flush(struct mmu_gather *tlb) } } -static __always_inline void __radix__flush_tlb_range_psize(struct mm_struct *mm, +static void __radix__flush_tlb_range_psize(struct mm_struct *mm, unsigned long start, unsigned long end, int psize, bool also_pwc) { -- 2.30.2