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 0D2D3E7717D for ; Mon, 9 Dec 2024 15:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yymF14IHFbx6Jsz6O4G0JFLMmWt/rUozbAAoy+ol+eM=; b=BJHurR+4GyG0qE3/Yt5TeuMrj4 ri38uOnJbmZb31TvRjrc0UMGr2wnkne1oA8EWJnfeP4Z8TqNpM8gI63Dkj7/XoGPLIjuktOs4G/D9 MBCqP28Fv+U80btEsn6jOlXOqdGe4FV+0qu0she/y+gENOptE6ecWSNts2EYcZumNJ40L4gzAcOsq Fq9nY6tgTahIeXEHvHmYendQFTZv4lfEVBAJ7CPxZOq2p3ECCkqLuwU0+385mtD7Ktcfhz2Yx68G6 u2qA5NocBcWy787wH1MFJUwRHdFRFGBgnXmHbDMNfU8UNeDb8Zpxx+5POJLkAzvem+hk2nT7L4ugp EcdHau9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tKfyH-00000008Qw2-0EzJ; Mon, 09 Dec 2024 15:46:53 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tKfxD-00000008Qc8-06Rl for linux-arm-kernel@lists.infradead.org; Mon, 09 Dec 2024 15:45:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E3CE25C5421; Mon, 9 Dec 2024 15:45:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A145C4CED1; Mon, 9 Dec 2024 15:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733759146; bh=waieXy8ZvxsddVWFcwGo31hwJetNKj8FiS3REo21d6Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Wy0dW8FJU/b3g+a3NoTzQQy5QfvRYg83SpSl2IkfWHKLsdU8GVlIQnSR98bc2Rz7p ZP0gDvMgrr8mRLd+fVqjO8omGS+87srdoEpk/GuBB1p22RyGBuAidKfrG7lptTWcTE L58g0xMfRP6ffdsizOq9rwtQ6Sl6GfrlFf/J/PbOTtLr2Cl04VXwiEOY7jE80GWTCC S9T04DA4w3qtEUgD4P6gdfn4kyHs+C9WWD8hOYie61trS35EK8QEnNiWOFAE1OdqgU a69Af1QJyAOAmgNFH6Q+PtE6nsdP3g9OdztWQRw5Ze58rD8/DSdbCUaLZL9m29CuTv ojk4tyWsRzD3Q== 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 1tKfxA-001vzD-4z; Mon, 09 Dec 2024 15:45:44 +0000 Date: Mon, 09 Dec 2024 15:45:43 +0000 Message-ID: <861pyguafs.wl-maz@kernel.org> From: Marc Zyngier To: Shameerali Kolothum Thodi Cc: Cornelia Huck , "kvmarm@lists.linux.dev" , "oliver.upton@linux.dev" , "catalin.marinas@arm.com" , "will@kernel.org" , "mark.rutland@arm.com" , "eric.auger@redhat.com" , yuzenghui , "Wangzhou (B)" , jiangkunkun , Jonathan Cameron , Anthony Jebson , "linux-arm-kernel@lists.infradead.org" , Linuxarm Subject: Re: [PATCH v3 3/3] arm64: paravirt: Enable errata based on implementation CPUs In-Reply-To: References: <20241209115311.40496-1-shameerali.kolothum.thodi@huawei.com> <20241209115311.40496-4-shameerali.kolothum.thodi@huawei.com> <875xnt10oj.fsf@redhat.com> 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.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: shameerali.kolothum.thodi@huawei.com, cohuck@redhat.com, kvmarm@lists.linux.dev, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, eric.auger@redhat.com, yuzenghui@huawei.com, wangzhou1@hisilicon.com, jiangkunkun@huawei.com, jonathan.cameron@huawei.com, anthony.jebson@huawei.com, linux-arm-kernel@lists.infradead.org, linuxarm@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-20241209_074547_147424_3F537AFA X-CRM114-Status: GOOD ( 29.20 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 09 Dec 2024 13:49:07 +0000, Shameerali Kolothum Thodi wrote: > > > > > -----Original Message----- > > From: Cornelia Huck > > Sent: Monday, December 9, 2024 12:49 PM > > To: Shameerali Kolothum Thodi > > ; kvmarm@lists.linux.dev; > > maz@kernel.org; oliver.upton@linux.dev > > Cc: catalin.marinas@arm.com; will@kernel.org; mark.rutland@arm.com; > > eric.auger@redhat.com; yuzenghui ; Wangzhou > > (B) ; jiangkunkun ; > > Jonathan Cameron ; Anthony Jebson > > ; linux-arm-kernel@lists.infradead.org; > > Linuxarm > > Subject: Re: [PATCH v3 3/3] arm64: paravirt: Enable errata based on > > implementation CPUs > > > > On Mon, Dec 09 2024, Shameer Kolothum > > wrote: > > > > > Retrieve any migration target implementation CPUs using the hypercall > > > and enable associated errata. > > > > > > Signed-off-by: Shameer Kolothum > > > > > --- > > > Note: > > > > > > One thing I am not sure here is how to handle the hypercall error. > > > Do we need to fail the Guest boot or just carry on without any > > > target implementation CPU support? At the moment it just carries on. > > > > > > Thanks, > > > Shameer > > > --- > > > arch/arm64/include/asm/cputype.h | 25 +++++++++++++++++++++++-- > > > arch/arm64/include/asm/paravirt.h | 3 +++ > > > arch/arm64/kernel/cpu_errata.c | 20 +++++++++++++++++--- > > > arch/arm64/kernel/cpufeature.c | 2 ++ > > > arch/arm64/kernel/image-vars.h | 2 ++ > > > arch/arm64/kernel/paravirt.c | 31 > > +++++++++++++++++++++++++++++++ > > > 6 files changed, 78 insertions(+), 5 deletions(-) > > > > > > diff --git a/arch/arm64/include/asm/cputype.h > > b/arch/arm64/include/asm/cputype.h > > > index dcf0e1ce892d..9e466f3ae9c6 100644 > > > --- a/arch/arm64/include/asm/cputype.h > > > +++ b/arch/arm64/include/asm/cputype.h > > > @@ -265,6 +265,16 @@ struct midr_range { > > > #define MIDR_REV(m, v, r) MIDR_RANGE(m, v, r, v, r) > > > #define MIDR_ALL_VERSIONS(m) MIDR_RANGE(m, 0, 0, 0xf, 0xf) > > > > > > +#define MAX_TARGET_IMPL_CPUS 64 > > > + > > > +struct target_impl_cpu { > > > + u32 midr; > > > + u32 revidr; > > > +}; > > > > Doesn't this need to be u64 for both (even if the upper bits for > > MIDR_EL1 are reserved?) > > Yes, both are u64 as per specification with upper bits reserved. And the > external hypercall interface has uint64. > > But in kernel, AFAICS, at present all the _midr_range_() functions expect u32. > So not sure we gain much now by changing to u64. For MIDR_EL1, I don't think that's a problem as long as we make sure this is a kernel-private representation, and that it doesn't leak to userspace or the PV interface. For REVIDR_EL1, it *is* a problem, as the whole register is IMPDEF, and an implementation could legitimately use the top bits. So at this stage, it probably makes sense to keep both as 64bit values. Thanks, M. -- Without deviation from the norm, progress is not possible.