From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14CD023ED6A for ; Fri, 7 Feb 2025 14:31:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738938677; cv=none; b=bJJ54J4UuOsy63lRVg6pmkMhQF+b3ukd8v5RAOpV0kmslHR/KVGBInFKXDXdwcnc0xyinNWZ+HPfOOhkYW5tE5LmygZIHljynWhLLnH7Fw+i9m/ROQYiTx5g/McXIBz2tkdN6OIufNKqmGZkZPiNmIww/yCnQ6mQCgJ9o1yXKAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738938677; c=relaxed/simple; bh=/bdZkHErgILPEkVIX2FXQXXH8tSX/nUwUyOjCUkNomY=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=qJbGamARTcaXqXcn1DzMCX0xOZ1E5o+4sD+CQZ25sBqFMFN9VeGNfVyPdF1x4juH2iv5URBAQYE7St0AJHBl1cLWKyS1LmpXwevhQnN8hTXa1lHxOdMRflxR6bSZW+Slv7ECQKv221ysfJTRleST/GfEVfkLOlqyr4yDT+Io3Qc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cd9Kgyoo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cd9Kgyoo" 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) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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.