Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1547054rdb; Thu, 7 Dec 2023 02:10:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkGyZumc1Z9fqWcK5Q+JLUEWF47yVUTa+RKZpyoVPkBl09dPeEFhr78yQuhXU0R/8W3gUC X-Received: by 2002:a05:6a00:1803:b0:6cb:6a27:ab57 with SMTP id y3-20020a056a00180300b006cb6a27ab57mr1734356pfa.14.1701943813812; Thu, 07 Dec 2023 02:10:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701943813; cv=pass; d=google.com; s=arc-20160816; b=vTepc0Rqixvz+9pVU8RtCSj/v/ucMrRmvRQuGHB0FLxjMF7TlcOn62gfTCpz0SCL8C 3cs1+apebn3+S1aNE88IkhIloTSjub3mt51BFMqMPs6hLOiuKL4Kk/7dIOvsDAh1rSWi 6K4rF4hUjaUBut7G2xkKKOcbnB4n9mEHqtib9U4KnMXcu6l3W35MqZrs9fHqmGIGFW+Q d4WaRr3121abpcPaUxcWtqoMlREKot4fNtNpSXqEM43dzXa/gto7PDbLsVBSiX8HQCzk 8gbBDuWgneSwoqrfiRPyITQ+4VJjrn96cC3E0iaGk45u5BclIKWu7t3aeQaxTmA2MaJ+ Xzdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=4fpV/mWabOiJge2xbzHNB89KDwH5FdZ1lNELh+fD0v0=; fh=lddwmII+vu4v4VbPO2j7LGpT3ATR+z3bQgg2zvRRsAg=; b=VFQ9aNtMMgJF32Vp4cK2J9rUh5f0nQ4zjh/DiB8P+PkRJHfufbgsETX7Yh298zuRbM FqF+RgOh2mQmFNJ9ob7nn2YbKaz8SY3NvlVmk3w58tjykJWAqrY5bSOMm51SQeg43Rhj ODFGdm9mrq8632QUPVDd1zOVuuiNS5mGP9LddRvDWhVFauOhzvXH4lvj5/W/LSI2U44H GUykipm6tI1gfzZ21Ds5lYdP+EhZsQ/RUSjkpvU29muWZ+jSolFDUAbkfhpi18CCC4aV fMNiPVrgh/oTDcFKYM+eDAUh0rGcNE9fnipzszbSyBcrqR6s6hghCWBN+11UWcdG/7/9 0dpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iFca53Vz; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id w3-20020a654103000000b005b96c2ab110si933029pgp.131.2023.12.07.02.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:10:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iFca53Vz; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0FAF48280831; Thu, 7 Dec 2023 02:10:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379077AbjLGKJx (ORCPT + 99 others); Thu, 7 Dec 2023 05:09:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235229AbjLGKJv (ORCPT ); Thu, 7 Dec 2023 05:09:51 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BF11B9; Thu, 7 Dec 2023 02:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701943797; x=1733479797; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=DRHCv5WAhRB3KOrQWsR/0xE5OXpRqjn+7xrlZgK+TTU=; b=iFca53VzxvNO4XIegi7UprjjJRSnNsYJZXKDK4QK8/YWcdvMPRKbbR35 yDAJCfieoyN5cMd+VH6xK141jR+T/VhoN1tjdxA5ASyT4l78VUMCoxBVG iwsxcj7iZzgP2wXGaRkVJOgtlYW2IfLk+zPEcLW0cYKfPfN43pUaTpoEu aQMUImYtObV7SjT2ylDlOmMaTLloMzPMnZM7zEx8BzRENbnf3T9lPXR8B g/YYR+uqMHij5FQN38kXqZP6w2IMNz7GRLO4m3GbYK7PJzBuonh37CHVq j7mdKSzagIUcaJp1mm3+JJVxuwZOU6LamiQbuz0ei48tE6tgaksJDcGAT w==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="374374065" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="374374065" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 02:09:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="1103151809" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="1103151809" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Dec 2023 02:09:55 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 7 Dec 2023 02:09:54 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 7 Dec 2023 02:09:54 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 7 Dec 2023 02:09:54 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 7 Dec 2023 02:09:54 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L0tJ0WhSNyXkp4KlsVQY95YR3q3mB5ffuhO9ieuEMSDgkrvQgJVeKU+M3CzW5KPybNft9hUykeEp82oe1XYHUQm56PeXsY24TPu4A7OkIU0A1k4Vz60PmSKHlAiOPKJhmwmgfgJT9zwvaWxqK02GvlTCXu2UqosBbBbBx57aG8boyCA0U/1C+CVietIzbYnK052k/NHuAmPSw85MZNgonVQlDxNXEA0ekl9CHc1jgy0QexNvbGk/COvECTT8x85mnZX3E1kqBJwpKKf3ET0zxwc6giie0U5YK30gc1vY1Dr00J9tSyxj5ndKYIWcF1/cZtfLEYJ5ekIuhw2I74Dexw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4fpV/mWabOiJge2xbzHNB89KDwH5FdZ1lNELh+fD0v0=; b=AEU4pnlxZ7mCGTm1F4fpEBWbo0qn0IwNQg9yxB3uH5XU/xADArEgYO4Sp3Rz1bqcbFRJxmmMLe3vr2DptepnQwSu3RFQaLdyPo674dCBbXCndoA+lKaazS0P/Et5ma4Ee/eZ7DZpayaORcoZh/T/av3FYQezujdwIGrRET03lNpvyTMGO9CdkGB3uN0JLeTOBhzyRo2uEDOhqyGWxz0ugDF1vBVrvZ/FagRGAgNysrqzutA1R90TTPm+iCSSiPB+Lj52gxRwaoRIbbWsaxO/sCz+QaSaK6mRifDh0aPEuKhZ09q8A2/CvQgub8iYnoiRvnGA0huRc/HXYoF0XhML7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SA1PR11MB6734.namprd11.prod.outlook.com (2603:10b6:806:25d::22) by DM4PR11MB7351.namprd11.prod.outlook.com (2603:10b6:8:104::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Thu, 7 Dec 2023 10:09:46 +0000 Received: from SA1PR11MB6734.namprd11.prod.outlook.com ([fe80::3d98:6afd:a4b2:49e3]) by SA1PR11MB6734.namprd11.prod.outlook.com ([fe80::3d98:6afd:a4b2:49e3%7]) with mapi id 15.20.7046.034; Thu, 7 Dec 2023 10:09:46 +0000 From: "Li, Xin3" To: "Gao, Chao" CC: "kvm@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "seanjc@google.com" , "pbonzini@redhat.com" , "corbet@lwn.net" , "kys@microsoft.com" , "haiyangz@microsoft.com" , "wei.liu@kernel.org" , "Cui, Dexuan" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "vkuznets@redhat.com" , "peterz@infradead.org" , "Shankar, Ravi V" Subject: RE: [PATCH v1 13/23] KVM: VMX: Handle VMX nested exception for FRED Thread-Topic: [PATCH v1 13/23] KVM: VMX: Handle VMX nested exception for FRED Thread-Index: AQHaEnYXOQlvFLhpWkG4lt/jksLCm7B5dqYAgAFC3tCAIVOmcIABoIUAgAAStHA= Date: Thu, 7 Dec 2023 10:09:46 +0000 Message-ID: References: <20231108183003.5981-1-xin3.li@intel.com> <20231108183003.5981-14-xin3.li@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR11MB6734:EE_|DM4PR11MB7351:EE_ x-ms-office365-filtering-correlation-id: 3f8bb752-20fd-46bd-c8a9-08dbf70ca3df x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZifDK4y3eASt6wGYDUdtDebqItqKPVFYgJGtZAg67MSIx+YQwXLJNmsV6O5bnYuzJut+4kRHmajQbBEchuJubPMohfIbxM6rOWv7ccBGvvn4DzQpn+ycetEp2goMPrzBLkzSmQFphKWUZSD1RM82/Qas0T6hW08e85Uqlt+koAGaSAMV2NktDEC735WK2/y427E7ThwiAK0zsBPsAN28+nICROVojKoVU+wpby+mHKvbhCh/g1X6ScpTrcUMn4QfoVDwGQgpF291SBN9qOTHR1TaIPEyXxfsWp+DKj5zKT2e4Yac6FNu7rNeIxOhCgunyX2Ck3/Je9zwjr3SPVa4/aSDXDUcKT65Gv7QcTpEmJ/PUFdLvr/Ki8JIPcQJcd2DUcfd4CKAM4AlzLYBxCu40kpBLBvWS23NTA1nKvSurEyxzPjJxYCv/R44VPCcTYEC8Zr0jMpIRx/87oZuSZ/XoK56CHGnLMKC/Ss4X3S9RTDRCfQ4Dzduo8p72mmqcPWWPg9YzLtyYiCn5aECifFiNsn1aEqXB+tfBtSmi5EM/tAXKvRnrREanlQdAsbxhX/NlnIqsV7y21f+XUvF4feK3Zgby0+gfooLI9nsafis3IxQLjM+7BhuVzfj8tZmdGqpA9RN2Ahx1JRgh3DOWgw1q7nXtFk1sjgrmasprlpd5TE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB6734.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(346002)(39860400002)(376002)(136003)(230922051799003)(230273577357003)(230173577357003)(64100799003)(1800799012)(186009)(451199024)(122000001)(38070700009)(2906002)(38100700002)(26005)(83380400001)(55016003)(86362001)(82960400001)(33656002)(7416002)(7696005)(5660300002)(6506007)(71200400001)(8676002)(52536014)(6862004)(8936002)(4326008)(9686003)(66446008)(41300700001)(54906003)(316002)(76116006)(6636002)(66476007)(66946007)(478600001)(64756008)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?d86xj6oXZKLCWQJ1rY4Ef4QFVMTleOLYe8sQEf9JiXIAO4/phBket9yjqNYO?= =?us-ascii?Q?oIyB2s1eIWYtOU4w1iVJWmR0AtDsSXfiNJZQL9a5MhOhHvPN0ZiuosoasF8t?= =?us-ascii?Q?ub0mYiO/NCKTUKgOlh8X0tiTg5UYb/EB/czMJkJwtaMV/+xK86wl6hbgBJnB?= =?us-ascii?Q?snAt6DrSg0XNwFUYDABdQ92bOdlyjTgvCGOo/MtdLf7hPz9+37LvZ8phD5gI?= =?us-ascii?Q?l2SzUtO78x33WLs43+NSvKCNT7PAnRJIU+ejSvZsbJpuUjsydU4gv27DWnIP?= =?us-ascii?Q?J4vztjH7zsNaqnl/foXyQb5gzPrxo263YMfZ/45WkPGNJ09bEIgAG/bkVNcn?= =?us-ascii?Q?VCRmG1kUnlVyaEslbHsaDluDnFDMBIce1gr6CUub3o+SpeDbAuu0HCAbYATP?= =?us-ascii?Q?Zb28dWRsTeq/XmRCCVQiMjkNroo4RAqYJGHrZ0BdM5UCZfJVF4ocH5Z/2McA?= =?us-ascii?Q?U69iH/oFbQnh5KqUroW/3wISbRIR56zY5rnQBSRn2kZuF5h/IEhluErQ1Rgf?= =?us-ascii?Q?mzdqOVQH2Npz3yhwq1o2y5YYIK34QuLvsqpcmiU+uIAxv77ZoWfGyM1ZezLn?= =?us-ascii?Q?8EIMmHI4Ppo1XYx4TL0SNyryLUdFkOA2VS8g/ycfGlwEPx+FLd/zYnbDCvtq?= =?us-ascii?Q?QT3lH6BpOixdXyGeRkbHP2EG5fdvAcW1aQAFZj/j9p3nTCxHZb+TgwAwqBL0?= =?us-ascii?Q?HEI54XivpJ2wYROgbAUMJVzRQsWarhNkuR84vG8wk2ET8mzKzVh7OYv4uJ3K?= =?us-ascii?Q?6UnwOPzSvz1wxkkJ38u8UU1PziWyGhX9CHw2Mtg7ens38NnPZUn1b5BEDHfE?= =?us-ascii?Q?E3IsaqIXD7dC4F3Hg1SUsCXkmrBPk7eyBxNQLr77+s2+8pOBfX4IoUmLO4s3?= =?us-ascii?Q?F7rpI2zwwNz3Vuom6Crl4+4MOnpXVuKz1gi+mNJdPthJ9GPFjDTL50k458yZ?= =?us-ascii?Q?eHPXXezLBO1Wtzhq7rFP5RQzn+o+YSJUKlNBseOKRxNZWOqHeqz2CPUIehWF?= =?us-ascii?Q?vDKDqpJuzEigxrzVir/NaXnXfkvN5bt1M7x8iQgAp7dYBO1lCnws7qeKfQ9w?= =?us-ascii?Q?OaMx0xoiQNxcSSNr28qL/VZI3mHd104IhsPCUjR1RkSb9HZ1/taaEXcKZjSK?= =?us-ascii?Q?GyKKZg2tyZIuyKb/TngxpgVGJ3KiP9LawBFz1y1WTQJQgFKF9td15zpZK+8X?= =?us-ascii?Q?5tTw7Z4q6RAE3fC2meFZiN13yl7NX8BHiGR0YYgqWfiWPEcnFDqMiDwMwz1p?= =?us-ascii?Q?alQqLzhVy7AkJGCWvVvORTxaCVgxeqInIfmMt8lwysyImhpoOlX4IVu1S8WV?= =?us-ascii?Q?65mj1llQEPfJYxbVwDyyKQxq2lHAheIU3NGj8ixyflK212wjHA6OU0gDeD+b?= =?us-ascii?Q?otNImXSv+i/ZkAQeXIb1CkUaZJnPz8N+VJA3p/E9IKkBZhLerqumIy7zU6py?= =?us-ascii?Q?JCSEs8PSgyUxm8K3igzDbpCiOdgTzn8w7wAF8tohEeJYZtc4siKXd5ytamhK?= =?us-ascii?Q?WDDjKaSxOtTmJ6UU+/9J+wFxtoeoSzWfciXyJiL3cpHVSGne+OrioNNE9PQK?= =?us-ascii?Q?uBC0SW5un0lr4edNZwg=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6734.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f8bb752-20fd-46bd-c8a9-08dbf70ca3df X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2023 10:09:46.3842 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: blCkVG2ftWahGx/O41NyKoDFJfGO4SyyA8Bh3PgdFFy+IyE9tXsxkP3tPahye1GqIo24tXBHR2sSTVBJiGaB6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB7351 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 02:10:08 -0800 (PST) > >> > Exiting-event identification can also have bit 13 set, indicating a > >> > nested exception encountered and caused VM-exit. when reinjecting th= e > >> > exception to guests, kvm needs to set the "nested" bit, right? I > >> > suspect some changes to e.g., handle_exception_nmi() are needed. > >> > >> The current patch relies on kvm_multiple_exception() to do that. But = TBH, I'm > >> not sure it can recognize all nested cases. I probably should revisit= it. > > > >So the conclusion is that kvm_multiple_exception() is smart enough, and > >a VMM doesn't have to check bit 13 of the Exiting-event identification. > > > >In FRED spec 5.0, section 9.2 - New VMX Feature: VMX Nested-Exception > >Support, there is a statement at the end of Exiting-event identification= : > > > >(The value of this bit is always identical to that of the valid bit of > >the original-event identification field.) > > > >It means that even w/o VMX Nested-Exception support, a VMM already knows > >if an exception is a nested exception encountered during delivery of > >another event in an exception caused VM exit (exit reason 0). This is > >done in KVM through reading IDT_VECTORING_INFO_FIELD and calling > >vmx_complete_interrupts() immediately after VM exits. > > > >vmx_complete_interrupts() simply queues the original exception if there = is > >one, and later the nested exception causing the VM exit could be cancell= ed > >if it is a shadow page fault. However if the shadow page fault is cause= d > >by a guest page fault, KVM injects it as a nested exception to have gues= t > >fix its page table. > > > >I will add comments about this background in the next iteration. >=20 > is it possible that the CPU encounters an exception and causes VM-exit du= ring > injecting an __interrupt__? in this case, no __exception__ will be (re-)q= ueued > by vmx_complete_interrupts(). I guess the following case is what you're suggesting: KVM injects an external interrupt after shadow page tables are nuked. vmx_complete_interrupts() are called after each VM exit to clear both interrupt and exception queues, which means it always pushes the deepest event if there is an original event. In the above case, the original event is the external interrupt KVM just tried to inject.