From nobody Mon Feb 9 18:44:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356520; cv=none; d=zoho.com; s=zohoarc; b=ccG6rjOHoh+yMIIvgfkq+vOD2nLqA1UgQJjQ4i2DTcj7Fc+qlURqnP1Z4E+ybucVxgu5ToUZQy3tTDJ6GZKcee72LA7YsE2VZqnrB289o/UQgU/XEg+jeqRL/Vc+Rtlu+VUln25MW3XEODg2fYin0MrBq3F2q0Cehj36KsRkKaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356520; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JvV1iVqyAdHF++s4qbNgPhXah3+qiDNHrezSixoPhkU=; b=nGP6eZIaEEL9ZLlHFLCaXkoGmlAr/CGBsahr5o33XQrngjB3wSva5t7NDAImZ6P8aIAT0DsSm9AWrq8GtSYlp7d+t7TnRxwhcdvu91aP8LkH7r5F5xXBwgeCGGdSn+MTpUhuY7XDHF50ctFuAYpFwfaNOz59KglpWpyd8N1fHbI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356520437885.6637983208848; Fri, 5 Jul 2019 12:55:20 -0700 (PDT) Received: from localhost ([::1]:55634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUIh-0002Re-AT for importer@patchew.org; Fri, 05 Jul 2019 15:55:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55674) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEQ-0005ZP-A6 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEP-0004DB-D2 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:54 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEP-0004Cj-6U for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:53 -0400 Received: by mail-wr1-x441.google.com with SMTP id a10so9869667wrp.9 for ; Fri, 05 Jul 2019 12:50:53 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JvV1iVqyAdHF++s4qbNgPhXah3+qiDNHrezSixoPhkU=; b=uJrrVdOk7q43i0HZsmCIPUc/TBYmv9/RHoDKVZZoLoKvFfSlrGtrySIM0vfpPf2C4X IhNU/vw0drcBOHJNn4pINAdwlMa+DlDi7HjXS7kQlI0M9lcWQElLH9TOKi9KGeV4qpfl XOCRjqAYNQQ1DyncI0e9hU7y42G+T3Cs5/9/vBjRUpCM/1ODrQBrrB4jCWxw2RWuFbIv gjrEZdcY6Vxw2eiQWbAa8LjsTVTqg1RQ8OLLb80CT0Jspbwpb4MSuB5og31E21zMZ2Nj vVSpvOeRfcmWYc7g6gIoVyuLE5Jr3bZQcxZUpIYvsEARJ4dpYcIuuVLyQihwXngB7G3B nAoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=JvV1iVqyAdHF++s4qbNgPhXah3+qiDNHrezSixoPhkU=; b=hd6sqJZlC5D/JKiW9CyLbhPmle4fjazEJvt0UbKuq7toY4Mz2ABZLijS9rzF7eHLJx RA1XD48kJFm2rN8iq2GC6aZ5uz/XeKF4SGpVn/O1Ge9sNOf/yMcQVjr/OrZPIrOffVAy xGxnrvqNFlEPo7FFj1/Eh+9J5PQXj5O2A45Wj6yH8/QLlehDBbdX1guppIK834kdxYml DGtv7PtU66ogSzyFfAbO1lpIijbyo0Ta66hkntX8hPuIY0pVA8zwBgI59p/NHuDTY09U 4/9wKKxrhIoDuFjqY0gTosZ3Alm5Hjwvgoo6HhOYVOmrimE82cGByun0YHFQ9fMSI1ss drqA== X-Gm-Message-State: APjAAAVUj85fojgZenjmziDu6/i9xMjEaN3DP4WkUlaXFy9njrTPY6AI Rwedg3kp911Mwr8UU1y7z5Jjg+EeI20= X-Google-Smtp-Source: APXvYqy6aaKv2FTeR8AcrAMfDyJTfOPqmnt9qnEPkjb0hUjRQlgbkyHFVESRpa+i/c9QR6huE+NGrg== X-Received: by 2002:a5d:6949:: with SMTP id r9mr4903101wrw.73.1562356251921; Fri, 05 Jul 2019 12:50:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:36 +0200 Message-Id: <1562356239-19391-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PULL 09/12] target/i386: kvm: Fix when nested state is needed for migration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liran Alon Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Liran Alon When vCPU is in VMX operation and enters SMM mode, it temporarily exits VMX operation but KVM maintained nested-state still stores the VMXON region physical address, i.e. even when the vCPU is in SMM mode then (nested_state->hdr.vmx.vmxon_pa !=3D -1ull). Therefore, there is no need to explicitly check for KVM_STATE_NESTED_SMM_VMXON to determine if it is necessary to save nested-state as part of migration stream. Reviewed-by: Karl Heubaum Signed-off-by: Liran Alon Message-Id: <20190624230514.53326-1-liran.alon@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/machine.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/i386/machine.c b/target/i386/machine.c index 851b249..704ba6d 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -997,9 +997,8 @@ static bool vmx_nested_state_needed(void *opaque) { struct kvm_nested_state *nested_state =3D opaque; =20 - return ((nested_state->format =3D=3D KVM_STATE_NESTED_FORMAT_VMX) && - ((nested_state->hdr.vmx.vmxon_pa !=3D -1ull) || - (nested_state->hdr.vmx.smm.flags & KVM_STATE_NESTED_SMM_VMXON= ))); + return (nested_state->format =3D=3D KVM_STATE_NESTED_FORMAT_VMX && + nested_state->hdr.vmx.vmxon_pa !=3D -1ull); } =20 static const VMStateDescription vmstate_vmx_nested_state =3D { --=20 1.8.3.1