From nobody Tue Feb 10 01:36:00 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1562361739; cv=none; d=zoho.com; s=zohoarc; b=hONyzPP0mqxeMxcOaXcAt//85ug99/FS1enU1QldS6EBO4z8jRUazQwHUJ+iZlbnMIadUwX6mkGE0WmgLyolbP1PBOr546j4H4GqpfIROXtB+g/1FGidrUIePMITzSdtnHVROuSGhxe03Dp2iWC2Inc4V9mNBb3HM/JuwoabbpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562361739; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=mRUp3UE+E2D0bvC2nURNQ62ackyCJAb7LpNyWjews3I=; b=UZh+zQO+zHJCgu/7nywc84NuFDmO4MKdHkUz9+jtGe8ymMXSwdXCnAWya1Aj9VIqFGgCmML0qutm3RnbAM1HmDlQTxImxIyYBFUxa3ykANX7RITgbxHO3g5HfPBKOSNRz6bSAA94AzxSsv8oCa756CKFFkniigCb4HoS7775HjA= 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 156236173959846.668908195645145; Fri, 5 Jul 2019 14:22:19 -0700 (PDT) Received: from localhost ([::1]:56292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjVeq-00061D-Hb for importer@patchew.org; Fri, 05 Jul 2019 17:22:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43157) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjVQM-0001Pk-8D for qemu-devel@nongnu.org; Fri, 05 Jul 2019 17:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjVQL-000086-8g for qemu-devel@nongnu.org; Fri, 05 Jul 2019 17:07:18 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:44712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hjVQJ-0008NL-Fa for qemu-devel@nongnu.org; Fri, 05 Jul 2019 17:07:16 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65L3rJF119866; Fri, 5 Jul 2019 21:07:04 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2te61emgg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 Jul 2019 21:07:04 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65L2Tb0107276; Fri, 5 Jul 2019 21:07:04 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 2thxrvm495-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 Jul 2019 21:07:03 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x65L72ls025541; Fri, 5 Jul 2019 21:07:02 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 05 Jul 2019 14:07:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2018-07-02; bh=mRUp3UE+E2D0bvC2nURNQ62ackyCJAb7LpNyWjews3I=; b=RFj8+UhJbo1BBp1h12iKJIXOQNTeexWnR0f+i5LWCPlInVaiVNGfRoXDTRIUlpOQ2tuJ TbdlKAqdFum1h1SubbkStuyQtA+eKI+YrBeCVANNy86MX2V8oztylKlPbD+idZr/9+9X ZXmXrT5fp9C4iZ2IO+4mDMziFcKQdSUo9ynAIgPGp/nTIx/vrNgkiX55OTP9/vBnVxYE 0GQalW4pnYN4URSz35AZ/NeoKRh3zZzRfTQNX2FUdbqlYL0/98us078Evzq9if31yHIf 8HXIsJ8s9vjo6FleER/dVTRCfHpF9SLzIwGGwYz0TDwrFVZB300XIfQbZexIEqYuFwbB 0w== From: Liran Alon To: qemu-devel@nongnu.org Date: Sat, 6 Jul 2019 00:06:35 +0300 Message-Id: <20190705210636.3095-4-liran.alon@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705210636.3095-1-liran.alon@oracle.com> References: <20190705210636.3095-1-liran.alon@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=661 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907050266 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=705 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907050266 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 Subject: [Qemu-devel] [PATCH 3/4] target/i386: kvm: Save nested-state only in case vCPU have set VMXON region 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: pbonzini@redhat.com, Joao Martins , Liran Alon , ehabkost@redhat.com, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Having (nested_state->hdr.vmx.vmxon_pa !=3D -1ull) signals that vCPU have s= et at some point in time a VMXON region. Note that even though when vCPU enters SMM mode it temporarily exit VMX operation, KVM still reports (vmxon_pa != =3D -1ull). Therefore, this field can be used as a reliable indicator on when we requir= e to send VMX nested-state as part of migration stream. Reviewed-by: Joao Martins Signed-off-by: Liran Alon Reviewed-by: Maran Wilson --- 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 851b249d1a39..20bda9f80154 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 2.20.1