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 C3DAACFD358 for ; Fri, 11 Oct 2024 11:45:07 +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=3LUjog70sMn8r1WiJ+Nfv69LRiWp7VgdkI7i2pBBkf8=; b=NumaJt5ccdNwDC4+n+7CmshfAY OpnH/Cm0d/nTdloXnvxc1odV3vpYPey9s6SUvabOp+TLX/VnEaUkNHDbuCuQ5LOrTvc/w97Gx/0A2 J/qGIWwIlv+ZQ8s1ACG+UayV5AnKtGTawH9zMctBunLp5WNYjvjPFzAnRpZb1QdXril2BIDoJG2zn UZ7ZL4s5VyngSQujQH8VgcxamJTuRoOqcIcFORcN76Rg1YIKwEUN4iLxQ4QG2rXRmBXmerKDob22w 4TVaw0ZQFJ7F+g1TW11ufIn7CL2NWXBGz2qNarCWOmAiN9j5/UFTCCeVvqXO+R4Pg40xX+vNxqhjA GKuvafPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szE4n-0000000GB9k-2Rzr; Fri, 11 Oct 2024 11:44:57 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szE3Q-0000000GAYC-23SP for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2024 11:43:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 88BCE5C5E46; Fri, 11 Oct 2024 11:43:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89366C4CEC3; Fri, 11 Oct 2024 11:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728647011; bh=aOJkW+dHlxUSlmHuYMYa34HgI24jqHxp9uitRfYoy+Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cRSDoiJNK5GLKlH/oUCSO4K7o8zCjoC452T9Kb04Jxv8lPWGjpUMk1oIDVCfL2GCn o73Om8rry/v+dUmipO9tlymTyPxIrJhIfgGuZQt6736qOX5ljsDzLSRAVcAV8acP9b vodp2KZ1n31rORCwYh+q/c/OdL9HWvxgDfPmhkOIejZv3Y3pMAjz1fp66EVjYOP882 Fe+BZCaUhNco5VEXakgU4NUGS6nA2lnTvh/ufzz1c+/U3rT3kOC+yRcRZXrT/fQ5In IZb6FYjt+jzAx2A/cej6/mKjNCpUyFp3VIXPrhnA6tV48roLWBVcv5OQAGgJFCiA4o 8Ys1tFmdREt2Q== 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 1szE3M-002X1m-W9; Fri, 11 Oct 2024 12:43:29 +0100 Date: Fri, 11 Oct 2024 12:43:28 +0100 Message-ID: <86ikty6f1b.wl-maz@kernel.org> From: Marc Zyngier To: Shameerali Kolothum Thodi Cc: "kvmarm@lists.linux.dev" , "oliver.upton@linux.dev" , "catalin.marinas@arm.com" , "will@kernel.org" , "mark.rutland@arm.com" , "cohuck@redhat.com" , "eric.auger@redhat.com" , yuzenghui , "Wangzhou (B)" , jiangkunkun , Jonathan Cameron , Anthony Jebson , "linux-arm-kernel@lists.infradead.org" , Linuxarm Subject: Re: [RFC PATCH 0/6] KVM: arm64: Errata management for VM Live migration In-Reply-To: <3f4469c49625413f9ab2c224d0d3fbea@huawei.com> References: <20241011075053.80540-1-shameerali.kolothum.thodi@huawei.com> <86jzef53iz.wl-maz@kernel.org> <3f4469c49625413f9ab2c224d0d3fbea@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=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: shameerali.kolothum.thodi@huawei.com, kvmarm@lists.linux.dev, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, cohuck@redhat.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-20241011_044332_640795_D6416073 X-CRM114-Status: GOOD ( 33.52 ) 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, 11 Oct 2024 11:57:10 +0100, Shameerali Kolothum Thodi wrote: > > > > > > Please take a look and let me know your thoughts. > > > > Having eyeballed this very superficially, I think we can do something > > simpler, and maybe more future-proof: > > Thanks Marc for taking a look and the quick feedback. No worries, that's the least I could do given that you put the effort implementing my silly ideas! ;-) > > - I don't think KVM should be concerned about the description of the > > target CPUs. The hypercall you defined is the right thing to do, > > but the VMM should completely handle it. That's an implementation > > detail, but it would make things much simpler. > > Ok. So does that mean the hypercall will use some sort of shared memory > to retrieve the list of target CPUs from VMM? Two possibilities: - either shared memory, in which case the hypercall would require the guest to give an IPA and size for the VMM to write its stuff into the guest memory, - or more simply return the data as an MIDR/REVIDR pair in registers, the guest requesting an index, and getting an error when out of range, leaving it with the freedom to organise the storage. The second option is a bit slower, but way simpler, and it only happens once per guest boot, so it would probably be my preferred option unless this is proved to be impractical. > > > - I don't think the "errata bitmap" works. That's a construct that is > > specific to Linux, and that cannot be supported for other OSs. It > > also limits the described issues to those the host knows, instead of > > the guest. The host doesn't have a clue what the guest really wants. > > Really, the guest should have enough information to decide what to > > do based on its own view of the ID registers and the list of CPUs it > > runs on. > > Yes. "errata bitmap" is specific to Linux. So if we go with the above > hypercall-->VMM path and get the target CPU list, Guest can directly > use that. Indeed, and this is something that is much easier to standardise upon, as I really want this to be a universal mechanism. > > - To answer your question about CTR_EL0: KVM should (and does) > > sanitise that register by trapping it. This should be the default > > behaviour for things that need to be mitigated outside of > > MIDR/REVIDR. > > Ok. Make sense and simplifies things. > > Please let me know whether my understanding on hypercall<->VMM is > correct or not. I can take a look at that route. Yes, I think we are aligned on it. Thanks again, M. -- Without deviation from the norm, progress is not possible.