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 F1CF5C02194 for ; Fri, 7 Feb 2025 14:33:25 +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-Transfer-Encoding: Content-Type: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=W73qVF7DCwC4Wdj/W/u8O4tg4x2Tvjlge1ifYM/nOjY=; b=XDKSj95wpWxfyttDvzRW62e4UY EvRCL/AqsVO81dJJwKxIRwugmAW6gHjOzvVAKpb1GPPfptxkgwLtXs0/HoJ5i4YwzDrosCKi3Mm2L EurZqZ1yglNKqN132T9b5lrAPM9j0gYDsokPvSzOFsiTDn9dEzi3Nk8C0O7pSFaAPivpzMICYGInP xOoTYAAUbETOkl9C0TXya3vFg/QvoowMJaaZXXBBenQDunU069FdAPrAu9BDvr4SKFDl40oT8znCP OihiblXB7SU1sVBKoDbtGWwI+IYs0UVj5w/e6sHeoZh/R+mvb8r047fzE7HCBOtucOLXAmRfj/tJQ 7I9oJnBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgPPw-00000009sFx-077g; Fri, 07 Feb 2025 14:33:16 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgPO1-00000009rZg-2Qvq for linux-arm-kernel@lists.infradead.org; Fri, 07 Feb 2025 14:31:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id E4932A418C1; Fri, 7 Feb 2025 14:29:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 744D8C4CED1; Fri, 7 Feb 2025 14:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738938676; bh=/bdZkHErgILPEkVIX2FXQXXH8tSX/nUwUyOjCUkNomY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cd9KgyooPdgHUX3sz3/Fj4LEiL6q/tkZTrlTbJvxQ1PxpqJrYHEZPcp8Z+/sFQMNw phT7PJvRvCZcKMy+CIkOQKEdl7H5oFZNTQyYosAN99+G+CaWvDgTe84ld3boNdsZku wnhFjKotpTAVqY+MlikcP1U7GqyY1BsSCZv2agg4zewlCI42nzmqCGc2aLChEEMc7l b/xxM/1MylpCJ3BLMPhhnQWkfntoWzl4wBnFKukutK+FRbn4+nKo289Qk6fWi3B/L1 Xx1i5jEAHt4EEz78b/xYJLF8NwG4gMBFvT1CKAUeRhB5cQ8BYBE+sr+SxCmPqSuqVK MbBbmHknrW3Xg== 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 1tgPNx-001efz-RS; Fri, 07 Feb 2025 14:31:13 +0000 Date: Fri, 07 Feb 2025 14:31:12 +0000 Message-ID: <86h655u8r3.wl-maz@kernel.org> From: Marc Zyngier To: Catalin Marinas Cc: Shameer Kolothum , kvmarm@lists.linux.dev, oliver.upton@linux.dev, will@kernel.org, mark.rutland@arm.com, cohuck@redhat.com, eric.auger@redhat.com, sebott@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 Subject: Re: [PATCH v6 4/4] arm64: paravirt: Enable errata based on implementation CPUs In-Reply-To: References: <20250205132222.55816-1-shameerali.kolothum.thodi@huawei.com> <20250205132222.55816-5-shameerali.kolothum.thodi@huawei.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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: catalin.marinas@arm.com, shameerali.kolothum.thodi@huawei.com, kvmarm@lists.linux.dev, oliver.upton@linux.dev, will@kernel.org, mark.rutland@arm.com, cohuck@redhat.com, eric.auger@redhat.com, sebott@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-20250207_063117_755057_2D281A79 X-CRM114-Status: GOOD ( 20.93 ) 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 Fri, 07 Feb 2025 14:08:44 +0000, Catalin Marinas wrote: >=20 > On Wed, Feb 05, 2025 at 01:22:22PM +0000, Shameer Kolothum wrote: > > static inline bool is_midr_in_range(struct midr_range const *range) > > { > > - return midr_is_cpu_model_range(read_cpuid_id(), range->model, > > - range->rv_min, range->rv_max); > > + int i; > > + > > + if (!target_impl_cpu_num) > > + return midr_is_cpu_model_range(read_cpuid_id(), range->model, > > + range->rv_min, range->rv_max); > > + > > + for (i =3D 0; i < target_impl_cpu_num; i++) { > > + if (midr_is_cpu_model_range(target_impl_cpus[i].midr, > > + range->model, > > + range->rv_min, range->rv_max)) > > + return true; > > + } > > + return false; > > } >=20 > It's a interesting approach but how does this work in practice if an > erratum requires a firmware counterpart? Do we expect firmwares on all > machines involved to have workarounds for the other machines? Or is KVM > going to intercept those SMCs and pretend the EL3 counterpart is there? KVM already traps SMCs, and could do something on behalf of the guest (such as pretending that the mitigation has happened if not on the correct host) *IF* the mitigation is architected (=C3=A0 la WA{1,2,3}). If it is implementation specific, then we can immediately stop pretending that a guest running on those systems can be migrated. The only thing it helps a bit is big-little. Overall, this isn't meant to be foolproof at all. It is only giving people enough ammunition to make it plain that the cross-platform story is a bit of a sad joke right now. Thanks, M. --=20 Without deviation from the norm, progress is not possible.