From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796343016; b=CodO1eI4+6iomSm0O5085fLEvNRAaDiDY5eyI/hbiKL1haI1eVtz4hC0aBNfesUyw0rm 9nL6uk7NLarHUlGgbOBLBxKlQ16nFUEaIN2wfvrRUP4Vz5Sin21zElmMLjKmjdPuNGuYy yjl3mTI4mQoSDSzmgagxVzFUU5N/jqR+YovO/71AiKnrPtgA1Mq6uFV5OB+oJafMx50oD oNZ5LHTxHD5GqSO+vmgHZHbGgX6s8Nd3uNANM4zW1dlOU9KEmYOIK+XRv+7P2rthy3j4U y//hFucXyy/L8yvyue9HC37fetLtm8MaKzDa3YAY146GNWTmO4vIlz8DYYTFIIaWxSA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796343016; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=42qPjyL80idvuIvc8d2/RFOLSfgzRS8wuRUJ0PrIaEA=; b=nQayKYNfgb5WGGaonOzmfGeUOfEu/aITMhgb4KEbXKkEhy/lc923jEnbMacIE5mLPbpn fdEHLlJKamLXBIeqowIGvdP4CtK2mU/VwY9mNfPInSrNUU3zPhdWVJ1SoYvQCm/2ossvw QtbA0gVv5xjQCa9eOkFTKYK4Z5vLJVmvtcsrXHuK1NtIb7ZGPxZjqJwi9q5arFggdJinj +RhQyBypJ2DpH3lVwUzupqu4nzfqJVjRfCaDl0jPQj/MbXKgQrETBVFo2aZOVRRG7dmb6 QUE7mb7f5118qIt2AcWWt3IDXngVglN6O66STWo99auPu8izdNhEYELboeMWPccPOKw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="kOlfPUe/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4381D606A32C for ; Fri, 4 Dec 2026 00:10:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kOlfPUe/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6DDD1F000C2; Fri, 4 Dec 2026 00:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796343015; bh=42qPjyL80idvuIvc8d2/RFOLSfgzRS8wuRUJ0PrIaEA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=kOlfPUe/5DiEHKlGNSwWdKMLATqQoGUuNbBjWVT8p1f92X7EojG4p34Z4SaCTAUmA ioutPouMGUtBQXqqiZWao0Ew9hMYRp7suW1EZUgFEON6MuTj/Gtg8LAbH2Os11ItCH mx3y23aHdn+Vc0wgAPPk18VS1pj4shma0S2dFYPTRGKTnwQAqaWnG8UnOlMxhycku2 DPo3oAj3/IYWHX11xyTRb1ELA10B4vYl1AOzYTSM1tlk1pKrE0KMyc6BQSPW1XJimr PiCyLiPJEQgFghOl23MTCWZslpELXEVs9x24Kq3gvkKi4g1/NGJ+Yz50L9/Zb4+nlA WsZfrla8z6yEA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 10/10] KVM: selftests: Check VMX capabilities for CET in L2 with MBEC Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?RGVubmlzIFJldcOfd2ln?= Cc: kvm@vger.kernel.org In-Reply-To: <20261204-nested-sss-v1-10-57de06f58b2b@reusswig.codes> References: <20261204-nested-sss-v1-0-57de06f58b2b@reusswig.codes> <20261204-nested-sss-v1-10-57de06f58b2b@reusswig.codes> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 00:10:15 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] kvm: vmx_nested_cet_caps_test fails when host or L0 lacks EPT SSS bit 23 - [Low] kvm: vmx_nested_cet_caps_test omits kselftest.h TAP reporting in main() - [Low] kvm: standalone vmx_nested_cet_caps_test instead of extending existing test -- commit 103206ea7ff8c4b0693e6b14fe9e0d35ad3cd5d8 Author: Dennis Reu=C3=9Fwig KVM: selftests: Check VMX capabilities for CET in L2 with MBEC This commit adds a new x86 KVM selftest, vmx_nested_cet_caps_test, that checks whether L1 sees the VMX CET load controls and EPT supervisor shadow-stack capability when mode-based execute control (MBEC) is advertised, both with and without the enlightened VMCS. > diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/sel= ftests/kvm/Makefile.kvm > index 2b502c9ec7cb8..9e62ed2bec1a3 100644 > --- a/tools/testing/selftests/kvm/Makefile.kvm > +++ b/tools/testing/selftests/kvm/Makefile.kvm > @@ -148,6 +148,7 @@ TEST_GEN_PROGS_x86 +=3D x86/vmx_invalid_nested_guest_= state > TEST_GEN_PROGS_x86 +=3D x86/vmx_nested_la57_state_test > TEST_GEN_PROGS_x86 +=3D x86/vmx_nested_mbec_test > TEST_GEN_PROGS_x86 +=3D x86/vmx_nested_sss_test > +TEST_GEN_PROGS_x86 +=3D x86/vmx_nested_cet_caps_test > TEST_GEN_PROGS_x86 +=3D x86/apic_bus_clock_test > TEST_GEN_PROGS_x86 +=3D x86/apic_id_routing_test > TEST_GEN_PROGS_x86 +=3D x86/xapic_ipi_test [Severity: Low] Could this check be added to an existing test such as vmx_msrs_test.c or vmx_nested_sss_test.c instead of adding a new standalone binary? It only reads four VMX capability MSRs from a minimal guest with and without eVMCS. > diff --git a/tools/testing/selftests/kvm/x86/vmx_nested_cet_caps_test.c b= /tools/testing/selftests/kvm/x86/vmx_nested_cet_caps_test.c > new file mode 100644 > index 0000000000000..cb9135df5d133 > --- /dev/null > +++ b/tools/testing/selftests/kvm/x86/vmx_nested_cet_caps_test.c [ ... ] > + /* Supervisor shadow-stack control needs advanced VM-exit information. = */ > + if (ept_cap & VMX_EPT_VPID_CAP_ADVANCED_VMEXIT_INFO) > + __GUEST_ASSERT(ept_cap & VMX_EPT_VPID_CAP_SSS, > + "MBEC offered but supervisor shadow-stack control is not, EPT = capabilities 0x%lx", > + ept_cap); [Severity: Medium] Can this assertion fail on hosts or nested L1 environments where hardware or the L0 hypervisor does not expose VMX_EPT_SSS_BIT? In nested_vmx_setup_secondary_ctls(), KVM masks msrs->ept_caps against the underlying MSR_IA32_VMX_EPT_VPID_CAP without clearing X86_FEATURE_SHSTK or SECONDARY_EXEC_MODE_BASED_EPT_EXEC. On an older L0 hypervisor or VMM that exposes SHSTK, MBEC, and advanced VM-exit info without EPT SSS, all TEST_REQUIRE() checks in main() pass and this assertion fails instead of skipping, breaking make run_tests. [ ... ] > + run_test(false); > + > + if (kvm_has_cap(KVM_CAP_HYPERV_ENLIGHTENED_VMCS)) > + run_test(true); > + else > + pr_info("eVMCS not supported, skipping the eVMCS case\n"); > + > + return 0; > +} [Severity: Low] Should main() report results through kselftest.h TAP helpers such as ksft_print_header(), ksft_set_plan(), ksft_test_result_pass(), ksft_test_result_skip(), and ksft_finished() instead of pr_info() and a bare return 0? Without structured TAP output, test runners cannot distinguish the skipped eVMCS subcase from a full pass. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-nested-sss= -v1-0-57de06f58b2b@reusswig.codes?part=3D10