Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.135 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796276094; b=VwDjwesXa8CT+yXf8Uswf+8C8rXlM1L/wnIO5C8e5bqVNqg7aRmPGXP1to50u5VDC8wn f721N31snn+8tAMiH2SIuQlLjkZN0D0jDvFhI3CaL8JVh5tKp1CscvqOjBGxKwmoN9GbK /+DrqACqd6FqVVHN+vpbXN5cA6x4IBn+xEtlAdrRw3EnVaH0PSK6tDA0AntB2aV4MRiwc QrxwrAsMiccO6CyyFEKmiUlWDbo9o3+VnLYhZosPpfTSLdW1KYuz97/9dEr04BrR2u/WF gZqyl5OuEyutZk14lOb4ZS37Ru52qFcs+BcbYfBClf2F3YqtpOQEUnfarl+s0953IBg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796276094; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=pFfhPWLi6Aehxhlri8PBMmzJKihXVh/AL9eTMLH9NHU=; b=ixPWKpwp13XIUfg84vQKXA0fAHw7HdJ7pUK9iKKDsBKJSqyvIFa72cAhj2cM/F3xMuQr Wg+q+nXx1N06Jx3ZqdB8y7Iahww6QXFGTu8xRI7Dvv1xoh3E0ey9beLu7g5/+AXqonbyU Yu5aF818leCc5v6euNWvN5/CWGexQnArwRcs0wcjsOLlV06uKzSWCjD8ZGvdJKfy/FLP5 xcb9JqkA2pCawYKSlvueJjBl14uFpJ7bJMG2nuMd4RQ1iRzCim282Zu7r4s8Q/rcnzxkl rm9fZ3YS2uCoY6FB6jOfad+cGGw3TgSXfkkkyI0zaiWCGxTFN7ggFPA9nJiiuOgpESA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=AsqFZLAZ; arc=none smtp.remote-ip=74.125.229.135 Received: from mail-dl2-f7.google.com (mail-dl2-f7.google.com [74.125.229.135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57A11606A32C for ; Thu, 3 Dec 2026 05:34:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 57A11606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=AsqFZLAZ Received: by mail-dl2-f7.google.com with SMTP id a92af1059eb24-13985f8229aso11226766c88.1 for ; Wed, 02 Dec 2026 21:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796276093; x=1796880893; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=pFfhPWLi6Aehxhlri8PBMmzJKihXVh/AL9eTMLH9NHU=; b=AsqFZLAZqpsJGn1LKyGeNCIco1Mwn/j0Oa5xi7CWv7alTu0QDMSgE+eZ7bUYBqLllF 3v0KOyTzeZLpLVO0tvXHfpUJ65/MDG1Dv8GWRxLkV99blIWmiu9UOXuWOLW72usEXuN/ 71tzF3aGzNYSFTqqPtDHKDpRy/Cl8G66/vcbyoUgYgqOxwpptGJJz0wVMxqMrim1pIhJ GHbDirPw6LNhJT4/huJAdc9XxxBucKM+XjZEFcTe/PaEWVPx/FpD6G0C12SAeNR8qPBo qFjVdYPLSuGpfYgrirJuIXEEXzYZEwPivCG514ETUW/Uj2obV+XNN+8wIQxRstUaKihl TUsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796276093; x=1796880893; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pFfhPWLi6Aehxhlri8PBMmzJKihXVh/AL9eTMLH9NHU=; b=B+whOcsb2XVOo1pM10fNlX7aiSdVEa5tBlz5ap5qZIpeGDZuieSW6ZyCV4UM4kUHBs /wpFzY1IMzggMeTVzaZT5YQ7GkPOfFFvWdvtIMOIIs19qU8YC1mavjSFxRUTcoQ19IXH FPQA9ptuj12mZQX7XKLJJ+SKx4FlJ9k0bBYM+ZbSysEudTOAM4B6tIl3KvJlqhtNuAcL tbyxL1J0Wqsv5QgknxiKSlqs/E9V0LwaO99h0szb/dUPR2QoVno7CinzxWYWRv6rPoe0 v7rCCrnNV84pwIyeS+GGK/XP4Hqq7eLu/qY9hM+1j8UD+EF4aLz5AfeLuBehk0lLTy/h KSgw== X-Forwarded-Encrypted: i=1; AL+hErEZLpHtHhJBqLT98JDxtPc6HHYzpB/Pk+o34jvSWjHq35BvfPlqOlsLhjtzkx4C4tOareA=@vger.kernel.org X-Gm-Message-State: APuU4Z8Xj2AQpQNsDwZmgzC3RaDKB+Mu1Sos94nIrw8QlxmPhrVSITNe Xf9yAlbE0VIZAWQlz46jfVw01qze4D2g8KWRJQcmscjae8OiEPgZ50iY X-Gm-Gg: AZFdTZdkZanc81kBnxWh4s6aslAbT080HjWJFriQjBtCSVR5YvIUKQU/AhPU42oxQgL ICgphcztDCAkx9k1RYrvRyIS+dbl6KZGQ55Qwt7tzQ0sz5lYkaDAPX8wKN0isNnF+AflRtxZ5Jg tBjAp3emwKJIMWqbTapmesNx242C28uEL8ChgguTU8HH8bHtfKVKtt7ZMn1BnNecSK8bZc7RCTC TORNVpTYAUPfD1IgNrlz4CPkAwRBx1hGcY2OYopktX/hK9pvDpr+puMlLc1yEasfgXiydGP0CXR dfb79rZMPeWJ1RrjbkehnCgVYExS2nzy+Nrh1Ypo0bG0iOUo14wlWLxLpv9LmKTbs5hWw+o6/T5 wYVpCZdAIDPqd15eJIio20wuuax+A0mXB3BZb97Pag78L7um7lrlip/kSt7iQpEjhNwjxj9Elu4 Ec+jDPNjaINXYcVSyLUhDUkbiM0mPIvfkHBUtPc7NkCG4NAODRmCDsfJkvhdKLnwhmT2tdT4RdG fQkMyBkusTmI0WoRycUDeqbvTLz8PBCYTiqNlWJHxwahSkLJDmhZfCPNCAifqZIr8SPSzEQkRsz uvmIBA+LOtiQbWdN/dWSBDiSRG1EyoafKrNuv6Pf58THI8+Q7OlUN6X1tnLfxQNiXaIC1J34yh/ 0cdfnjus= X-Received: by 2002:a05:7022:ea45:b0:1b5:31db:cc3e with SMTP id a92af1059eb24-1b5568b2b4bmr37076883c88.11.1796276093336; Wed, 02 Dec 2026 21:34:53 -0800 (PST) Received: from zihui.lxd ([137.132.218.135]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b562a82b3fsm122877169c88.5.2026.12.02.21.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 21:34:52 -0800 (PST) From: Zihui Guo To: Sean Christopherson , Paolo Bonzini Cc: Chao Gao , Binbin Wu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] KVM: nVMX: Add missing guest-state checks on nested VM-Enter Date: Thu, 3 Dec 2026 05:34:45 +0000 Message-ID: <20261203053449.25917-1-youzih27@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Three guest-state checks from SDM Vol. 3C (rev. 093) 29.3.1 are missing from nested_vmx_check_guest_state(). Patch 1 adds the canonical check of the guest's IA32_S_CET. The CET consistency checks were meant to cover it but treat S_CET like SSP. The hardware still checks the value on VM-Enter of vmcs02, since KVM loads it unchanged, so this only moves the failure to the consistency checks. Patches 2 and 3 add the HLT checks: SS.DPL must be 0, and only some events may be injected. Here the hardware cannot help, because KVM emulates the HLT state of L2 and never loads vmcs12's activity state into vmcs02, so L1 currently gets a successful VM-Enter where the architecture requires a VM-Entry failure. The injected-event check is the TODO suggested in [1]. The v3 series [2] adds other activity-state checks to the same function, so these patches may need a trivial rebase on top of it. A 2019 patch [3] had similar HLT checks and was not merged. All three are compile-tested only (x86_64 defconfig with KVM_INTEL, W=1, no warnings). No machine with VMX was available, so none of them was run, and there are no kvm-unit-tests for these cases yet. Assisted-by: Claude:claude-opus-5-5 [1] https://lore.kernel.org/all/atqDVkHjdJ2iF9Uv@google.com/ [2] https://lore.kernel.org/all/20261022215146.233479-1-amirmohammad.eftekhar@cispa.de/ [3] https://lore.kernel.org/all/20190819214650.41991-3-nikita.leshchenko@oracle.com/ Zihui Guo (3): KVM: nVMX: Check that the guest's IA32_S_CET is canonical on VM-Enter KVM: nVMX: Reject nested VM-Enter to HLT with a non-zero SS.DPL KVM: nVMX: Check the event injected into the HLT state on nested VM-Enter arch/x86/kvm/vmx/nested.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) base-commit: cbe54fc3462b3949ab27b9ae81fb9ddb509040c7 -- 2.43.0