From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45248C4167B for ; Tue, 5 Dec 2023 11:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qhel9Jhcldz0GxiiDRp6Cv+OCq2W/dAe1gvvi2xQB6Y=; b=wO0x6TFEW/wm1c /Nak4rNKLf8lteksJB/r5uM2Ytm9+NdGwHKzTu32wv1CMLd7bJh6aal4ZO7Y56EdPD1wwS3JIMU9L PI/sOBedZU9jkNrLkNAx/9QyPCDeauETsSqcc2UIg7YgHozQ97gMSJPDYFcxL7kx/aZszZIuX+fwX ZhzOD6LZ2uPdBW9fCWF9fQLiCyMODyhWIZtFT8iUQE32IMzZfqNF2u0yoiaTzWLJo+KuPuxUjtEWZ lNwnTPU7GuNVPSXLv3iWHMmMT3dza9J1M1KyS1avVeOTUHMp/Fq7K55VZK/A+T+arlrmlp0oHIQap eo4WbfSO674iym+JtkGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rATzV-007IjT-15; Tue, 05 Dec 2023 11:53:29 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rATzR-007IgC-2c for linux-arm-kernel@lists.infradead.org; Tue, 05 Dec 2023 11:53:27 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 6B9CBB81964; Tue, 5 Dec 2023 11:53:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB7FDC433C7; Tue, 5 Dec 2023 11:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701777203; bh=3FNV8+wfCMDASEiBW/vL/W4Y2i6lE5IM3WZTeM1IX38=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=O4bP9iWrlyozBbKrXNsNhog3Mm9QqGvL9vfSwTty8f+HK+IC5/3D8E2aM/Tdp4kzy NWeGxw+QSlYt1fzPR33wtusXp9oTbILbXMoezjPO2xQCVnGHsdaQ03ZdAngDIEWXce WLr2K0335Z6bTbKyNwwWUnJ1K/yf2fEb2zC3tb1Wjo8b18Xqm40JYKZAdyOedeagM9 iWkgFDHgjzu+yV9WQQ/DFDlozYMo120D+b3gWvcPARB4SnGzeHR7caxwO7U6RJ9i1x ZhPMgMT/eFYurr3UXi3UueT15KP/69phPAoU0VZlDZd+bs3xj7Zv5AOTkcvBMe2UYQ kCKB0j2tBKCNw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rATzN-001XhJ-EX; Tue, 05 Dec 2023 11:53:21 +0000 Date: Tue, 05 Dec 2023 11:53:20 +0000 Message-ID: <86cyvkc1cf.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Will Deacon , Catalin Marinas , Ard Biesheuvel , Anshuman Khandual , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: Re: [PATCH v3 0/3] arm64: Drop support for VPIPT i-cache policy In-Reply-To: References: <20231204143606.1806432-1-maz@kernel.org> <86h6kxbz8u.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, ardb@kernel.org, anshuman.khandual@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231205_035326_145165_4B48BA5A X-CRM114-Status: GOOD ( 26.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 05 Dec 2023 11:03:16 +0000, Mark Rutland wrote: > > On Mon, Dec 04, 2023 at 06:26:25PM +0000, Marc Zyngier wrote: > > How about the patch below (tested in a guest with a bunch of hacks to > > expose different L1Ip values)? > > That's roughly what I was thinking; the diff looks good, minor comments below. > > [...] > > > /* > > * Whilst the D-side always behaves as PIPT on AArch64, aliasing is > > * permitted in the I-cache. > > */ > > static inline int icache_is_aliasing(void) > > { > > - return test_bit(ICACHEF_ALIASING, &__icache_flags); > > + return !cpus_have_cap(ARM64_ICACHE_PIPT); > > } > > It might be nicer to use alternative_has_cap_{likely,unlikely}(...) for > consistency with other cap checks, though that won't matter for hyp code and I > don't think the likely/unlikely part particularly matters either. Right, this should be marginally better. I was initially worried of the cap not being configured yet, but since we start by assuming VIPT and only flip to PIPT once we have seen all CPUs, this stays correct by construction. > [...] > > > diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg > > index c5af75b23187..db8c96841138 100644 > > --- a/arch/arm64/tools/sysreg > > +++ b/arch/arm64/tools/sysreg > > @@ -2003,7 +2003,7 @@ Field 28 IDC > > Field 27:24 CWG > > Field 23:20 ERG > > Field 19:16 DminLine > > -Enum 15:14 L1Ip > > +UnsignedEnum 15:14 L1Ip > > # This was named as VPIPT in the ARM but now documented as reserved > > 0b00 RESERVED_VPIPT > > # This is named as AIVIVT in the ARM but documented as reserved > > I was initially surprised by the use of UnsignedEnum, but given PIPT is 0b11, I > can see that works. Otherwise, we can keep this as an enum and use a helper > that checks for an exact match. Yeah, I hesitated either way, but maybe the helper approach is cleaner. I'll give it a go and repost this patch. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel