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 12430804 for ; Fri, 11 Oct 2024 11:43:31 +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=1728647012; cv=none; b=lG3zQkazoWo6100nz3yRe/qspX9681QfN/3ywbe02QSTVzcnZzg4BmkEtv+j8pEtPhjsc+4CkWeZ2ZthSD1B6/gXQu/SWd2cLSCCscwTJYAZN8+0eQ/6c7hs67ApPrwaF2KwuMl6n0cbe/UWeWUNv8gZvUSDYz/zDaidlGG0jqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728647012; c=relaxed/simple; bh=aOJkW+dHlxUSlmHuYMYa34HgI24jqHxp9uitRfYoy+Y=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=hcqiFFO2wJY6KRCtEanARnpaGKlRECH1uxhOORZQ2yJIvOXzY9Vu92fTF1aCdDdoIDDh8lilZxWu8IrxMmmMCeFBeLRh8vMiHIoB/7PEkFAKZm1IUfCwk8MtNtwjXGxFFCfyAB6aiMWJw1jZ4GQSfDgkKBi0PdBm/ub8KzZP4gM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cRSDoiJN; 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="cRSDoiJN" 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) 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=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 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.