From patchwork Wed Sep 20 18:17:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13393165 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 6B706C04FD1 for ; Wed, 20 Sep 2023 18:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7V+NZ7B+ZgzvYu22c70N/Y2ly4qYgk3BvaXal2zFCwY=; b=jKn3rjd/Gg+srJ TsmDC9T1bl9MfEXgOJY1p/W8T7Z/FCiuwlaX4ku6DblVtRgt2qvsQsbgAga7H9/vPW7+MUXGTKnik A52RBnjSRHIord3Y3HljskcCGfMr+JP7+uEqjEAfDj8NXhfJNPxLpL3Z9OECbO4VaEEkJ5NESaqcE Su2g3KsuR/RM7g1ZPvw0twLsOyZEOl5DhqMjkezgQvML+k8bmWlZK/KLMLHevb0I6toD6eQ9IC5hB PW/fXxD6CKTjaQ1kTuXlG32jShvhpCcTsEVcOaV8AAPcnZKZqYUTF+m5kcfNEO/+UrWs0d47hCbJa R7mzUh4dgSXOJqn3RDEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qj1m4-003pzW-19; Wed, 20 Sep 2023 18:18:08 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qj1le-003pmw-2s for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2023 18:17:47 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 752F661DC7; Wed, 20 Sep 2023 18:17:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 483EEC433C8; Wed, 20 Sep 2023 18:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695233861; bh=BhrGPjTzb1HfZms6GPV9c/Mt5fFofX2+GjOb7zqmwKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qV24xbPWZxDb4nvt2qzscOXLlLVm7+emVDxxk/BJExwCk4tbk5Fqum8vcQ03IgD2o rBBxHFqnpLvTHBf6qC+Q0CLpG4aTbaVgl+6ylqE/YeoqbdnwdJFaqByhFuCw/04k9D YiQ8FOzsdLsVvHqDgaPp7fUVfC5cam+3bTVDnJX5tNStu167diiAawsTMKK7wlYpA0 cEEAFUYyaiSnwbuDDG8eWeUpT3prpB/qca6wWwH8c6e/YdxGVi4V3AqE7JhEXATsx0 BqNc0YAxB0f2stRy7PxXQEVA1AT6a++RUJvPQ5rkWqiuuqM8sd5BuLNmx72+BJrVaj ob7i0uHTDp9Vg== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qj1lb-00Ejx0-EI; Wed, 20 Sep 2023 19:17:39 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Joey Gouly , Shameerali Kolothum Thodi , Xu Zhao , Eric Auger Subject: [PATCH v2 11/11] KVM: arm64: Clarify the ordering requirements for vcpu/RD creation Date: Wed, 20 Sep 2023 19:17:31 +0100 Message-Id: <20230920181731.2232453-12-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230920181731.2232453-1-maz@kernel.org> References: <20230920181731.2232453-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, joey.gouly@arm.com, shameerali.kolothum.thodi@huawei.com, zhaoxu.35@bytedance.com, eric.auger@redhat.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-20230920_111743_050520_164C5AC3 X-CRM114-Status: GOOD ( 14.43 ) 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 It goes without saying, but it is probably better to spell it out: If userspace tries to restore and VM, but creates vcpus and/or RDs in a different order, the vcpu/RD mapping will be different. Yes, our API is an ugly piece of crap and I can't believe that we missed this. If we want to relax the above, we'll need to define a new userspace API that allows the mapping to be specified, rather than relying on the kernel to perform the mapping on its own. Signed-off-by: Marc Zyngier --- Documentation/virt/kvm/devices/arm-vgic-v3.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/virt/kvm/devices/arm-vgic-v3.rst b/Documentation/virt/kvm/devices/arm-vgic-v3.rst index 51e5e5762571..5817edb4e046 100644 --- a/Documentation/virt/kvm/devices/arm-vgic-v3.rst +++ b/Documentation/virt/kvm/devices/arm-vgic-v3.rst @@ -59,6 +59,13 @@ Groups: It is invalid to mix calls with KVM_VGIC_V3_ADDR_TYPE_REDIST and KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attributes. + Note that to obtain reproducible results (the same VCPU being associated + with the same redistributor across a save/restore operation), VCPU creation + order, redistributor region creation order as well as the respective + interleaves of VCPU and region creation MUST be preserved. Any change in + either ordering may result in a different vcpu_id/redistributor association, + resulting in a VM that will fail to run at restore time. + Errors: ======= =============================================================