lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  6 Jan 2022 16:55:33 +0800
From:   Like Xu <like.xu.linux@...il.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Sean Christopherson <seanjc@...gle.com>,
        Jim Mattson <jmattson@...gle.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Joerg Roedel <joro@...tes.org>,
        Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] KVM: x86/pt: Do not advertise Intel PT Event Trace capability

From: Like Xu <likexu@...cent.com>

The Inte PT Event Trace capability (Intel SDM Vol3, 32.2.4 Event Tracing)
is a new CPU feature that "exposes details about the asynchronous events,
when they are generated, and when their corresponding software event
handler completes execution".

It is not possible for KVM to emulate all events including interrupts,
VM exits, VM entries, INIT, SIPI events and etc. for guests and to
emulate the simultaneous writing of Control Flow Events and Event Data
packets generated by the KVM to the guest PT buffer.

For KVM, it is best not to advertise the Event Trace feature and just
let it be a system-wide-only tracing capability.

Signed-off-by: Like Xu <likexu@...cent.com>
---
Off topic, other new PT features such as "PSB and PMI Preservation Supported"
and "TNT disable" are under investigation or awaiting host support to move on.

 arch/x86/kvm/cpuid.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 0b920e12bb6d..1028c57377e9 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -901,6 +901,8 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
 			break;
 		}
 
+		/* Not advertise Event Trace capability due to endless emulation */
+		entry->ebx &= ~BIT(7);
 		for (i = 1, max_idx = entry->eax; i <= max_idx; ++i) {
 			if (!do_host_cpuid(array, function, i))
 				goto out;
-- 
2.33.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ