From: Chao Peng
Hi All,
Here is a patch-series which adding Processor Trace enabling in KVM guest. You
can get It's software developer manuals from:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf
In Chapter 5 INTEL
simultaneous and output to their
respective buffer.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h | 7
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/vmx.h | 6 +++
arch/x86/kvm/vmx.c | 88
From: Chao Peng
Implement Intel processor trace virtualization callbacks to
suppress host event in guest only mode.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 21 +
1 file changed, 21 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch
From: Chao Peng
Add Intel processor trace virtualization call backs to
suppress host event in guest only mode.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 21 +
arch/x86/include/asm/intel_pt.h | 9 +
2 files changed
From: Chao Peng
Expose Intel processor trace cpuid to guest.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c| 23 +--
arch/x86/kvm/svm.c | 6 ++
arch/x86/kvm/vmx.c
From: Chao Peng
Intel processor trace virtualization enabling in guest need
to use these MSR bits, so move then to public header msr-index.h.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.h | 37 -
arch/x86/include
From: Chao Peng
Load/Store Intel processor trace register in context switch.
MSR IA32_RTIT_CTL is loaded/stored automatically from VMCS,
other MSRs are loaded/stored manaully.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 100
From: Chao Peng
Add a date structure to save Intel processor trace context.
It mainly include all the MSR of Intel processor trace.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/vmx.h | 2 ++
arch/x86/kvm/vmx.c
From: Chao Peng
Trap for Intel processor trace is none sense. Pass through to
guest directly.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 3c9ce3e
From: Chao Peng
Change pt_cap_get() to a public function so that KVM
can access it.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 3 ++-
arch/x86/events/intel/pt.h | 18 --
arch/x86/include/asm/intel_pt.h | 20
From: Chao Peng
Pass through Intel processor trace to guest directly.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 8f61a8d..01447e2 100644
--- a/arch
out write this msr in L1 VMX
operation.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 091120e..8f61a8d 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/
From: Chao Peng
Load/Store Intel processor trace register in context switch.
MSR IA32_RTIT_CTL is loaded/stored automatically from VMCS,
other MSRs are loaded/stored manaully.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 75
From: Chao Peng
Add a date structure to save Intel processor trace context.
It mainly include all the MSR of Intel processor trace.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/vmx.h | 2 ++
arch/x86/kvm/vmx.c
From: Chao Peng
Expose Intel processor trace cpuid to guest.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c| 23 +--
arch/x86/kvm/svm.c | 6 ++
arch/x86/kvm/vmx.c
From: Chao Peng
Change pt_cap_get() to a public function so that KVM
can access it.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 3 ++-
arch/x86/events/intel/pt.h | 18 --
arch/x86/include/asm/intel_pt.h | 20
From: Chao Peng
Hi All,
Here is a patch-series which adding Processor Trace enabling in KVM guest. You
can get It's software developer manuals from:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf
In Chapter 5 INTEL
From: Chao Peng
Intel processor trace virtualization enabling in guest need
to use these MSR bits, so move then to public header msr-index.h.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.h | 37 -
arch/x86/include
-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h | 6
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/vmx.h | 6
arch/x86/kvm/vmx.c | 73 +---
4 files changed, 82 insertions(+), 4
n
KVM: x86: Add Intel Processor Trace virtualization mode
KVM: x86: Add Intel Processor Trace cpuid emulation
KVM: x86: Add Intel processor trace context for each vcpu
KVM: x86: Implement Intel Processor Trace context switch
KVM: x86: Implement Intel Processor Trace MSRs read/write
KVM:
exception (#GP).
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 27185da..77a28f3 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3763,7 +3763,8 @@ static int
From: Chao Peng
Change pt_cap_get() to a public function so that KVM can access it.
Introduce new capablility PT_CAP_output_subsys to support
of output to Trace Transport subsystem.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 4 +++-
arch/x86
From: Chao Peng
Disable interrcept Intel PT MSRs only when Intel PT is
enabled in guest. But MSR_IA32_RTIT_CTL will alway be
intercept.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 20
1 file changed, 20 insertions(+)
diff --git a/arch/x86
From: Chao Peng
Implement Intel Processor Trace MSRs read/write.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h | 8 ++
arch/x86/kvm/vmx.c | 163
arch/x86/kvm/x86.c | 33 +++-
3
From: Chao Peng
Expose Intel Processor Trace to guest only when PT work in
HOST_GUEST mode.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c| 22 --
arch/x86/kvm/svm.c | 6
From: Chao Peng
Add a data structure to save Intel Processor Trace context.
It mainly include the value of Intel PT host/guest MSRs
and guest CPUID information.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 19 +++
1 file changed, 19 insertions
Because of the guest CPUID information may different with
host(some bits may mask off in guest) so introduce a new
function to get the capability of Intel PT.
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 10 --
arch/x86/include/asm/intel_pt.h | 2 ++
2 files changed
-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h | 6
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/vmx.h | 8 +
arch/x86/kvm/vmx.c | 68 +---
4 files changed, 79 insertions(+), 4
Initialize the Intel PT configuration when cpuid update.
Include cpuid inforamtion, rtit_ctl bit mask and the number of
address ranges.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 69 ++
1 file changed, 69 insertions(+)
diff --git a
-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 60 ++
1 file changed, 60 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 940df0e..34bcb30 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
From: Chao Peng
Intel Processor Trace virtualization enabling in guest need
to use these MSR bits, so move them to public header msr-index.h.
Introduce RTIT_CTL_FABRIC_EN and sync the definitions to
latest spec.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel
r Trace virtualization mode
KVM: x86: Add Intel Processor Trace cpuid emulation
KVM: x86: Add Intel Processor Trace context switch for each vcpu
KVM: x86: Implement Intel Processor Trace MSRs read/write emulation
KVM: x86: Set intercept for Intel PT MSRs read/write
Luwei Kang (5):
perf/x
From: Chao Peng
Change pt_cap_get() to a public function that KVM
can access this function to check if specific
feature is supported on hardware.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 3 ++-
arch/x86/events/intel/pt.h | 21
-by: Luwei Kang
---
arch/x86/include/asm/msr-index.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 5e8d156..f163f04 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -112,6 +112,7
From: Chao Peng
Intel PT virtualization can be work in one of 2 possible modes:
a. system-wide: trace both host and guest and output to host buffer;
b. host-guest: trace host/guest simultaneous and output to their
respective buffer.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
From: Chao Peng
Intel Processor Trace virtualization enabling in KVM guest
need to access these MSRs bit definitions, so move them to
public header file msr-index.h.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.h | 37
New function pt_cap_decode() will be invoked in KVM to check
if a specific capability is available in KVM guest.
Another function pt_cap_get() can only check the hardware
capabilities but this may different with KVM guest because
some features may not be exposed to guest.
Signed-off-by: Luwei
From: Chao Peng
Expose Intel Processor Trace to guest only when PT work in
HOST_GUEST mode.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c| 22 --
arch/x86/kvm/svm.c | 6
From: Chao Peng
Load/Store Intel processor trace register in context switch.
MSR IA32_RTIT_CTL is loaded/stored automatically from VMCS.
In HOST_GUEST mode, we need load/resore PT MSRs only when PT
is enabled in guest.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c
Initialize the Intel PT configuration when cpuid update.
Include cpuid inforamtion, rtit_ctl bit mask and the number of
address ranges.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 69 ++
1 file changed, 69 insertions(+)
diff --git a
From: Chao Peng
Disable intercept Intel PT MSRs only when Intel PT is
enabled in guest. But MSR_IA32_RTIT_CTL will alway be
intercept.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/arch
From: Chao Peng
This patch implement Intel Processor Trace MSRs read/write
emulation.
Intel PT MSRs read/write need to be emulated when Intel PT
MSRs is intercepted in guest and during live migration.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h
exception (#GP).
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 170cd48..7ace11a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3996,7 +3996,8 @@ static int
and a #GP would be injected to guest if set
IA32_RTIT_CTL.FabricEn with
CPUID.(EAX=14H, ECX=0):ECX[bit 3] = 0.
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 1 +
arch/x86/include/asm/intel_pt.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/x86/events/intel/pt.c b/arch
Add Intel PT virtualization work mode
KVM: x86: Add Intel Processor Trace cpuid emulation
KVM: x86: Add Intel PT context switch for each vcpu
KVM: x86: Implement Intel PT MSRs read/write emulation
KVM: x86: Set intercept for Intel PT MSRs read/write
Luwei Kang (5):
perf/x86/intel/pt: Introd
Acked-by: Song Liu
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 49 ++---
arch/x86/events/intel/pt.h | 21 --
arch/x86/include/asm/intel_pt.h | 23 +++
3 files changed, 49 inserti
This adds support for "output to Trace Transport subsystem"
capability of Intel PT. It means that PT can output its
trace to an MMIO address range rather than system memory buffer.
Acked-by: Song Liu
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 1 +
arch/x86/i
Add bit definitions for Intel PT MSRs to support trace output
directed to the memeory subsystem and holds a count if packet
bytes that have been sent out.
These are required by the upcoming PT support in KVM guests
for MSRs read/write emulation.
Signed-off-by: Luwei Kang
---
arch/x86/include
guest can be different from the host array.
Provide a new function to check against a given capability array.
Acked-by: Song Liu
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 12 +---
arch/x86/include/asm/intel_pt.h | 2 ++
2 files changed, 11 insertions(+), 3 deletions
-by: Luwei Kang
---
arch/x86/events/intel/pt.h | 37 -
arch/x86/include/asm/msr-index.h | 33 +
2 files changed, 33 insertions(+), 37 deletions(-)
diff --git a/arch/x86/events/intel/pt.h b/arch/x86/events/intel/pt.h
index
exception (#GP).
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ed247dd..5001049 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4556,7 +4556,8 @@ static int
From: Chao Peng
Load/Store Intel Processor Trace register in context switch.
MSR IA32_RTIT_CTL is loaded/stored automatically from VMCS.
In Host-Guest mode, we need load/resore PT MSRs only when PT
is enabled in guest.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include
: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h | 3 ++
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/vmx.h | 8 +
arch/x86/kvm/vmx.c | 68 +---
4 files changed, 76 insertions(+), 4 deletions
Initialize the Intel PT configuration when cpuid update.
Include cpuid inforamtion, rtit_ctl bit mask and the number of
address ranges.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 73 ++
1 file changed, 73 insertions(+)
diff --git a
From: Chao Peng
To save performance overhead, disable intercept Intel PT MSRs
read/write when Intel PT is enabled in guest.
MSR_IA32_RTIT_CTL is an exception that will always be intercepted.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 23
From: Chao Peng
This patch implement Intel Processor Trace MSRs read/write
emulation.
Intel PT MSRs read/write need to be emulated when Intel PT
MSRs is intercepted in guest and during live migration.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h
From: Chao Peng
Expose Intel Processor Trace to guest only when
the PT works in Host-Guest mode.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c| 22 --
arch/x86/kvm/svm.c | 6
output to Intel PT. The native driver as [1] (still under review).
[1] https://www.spinics.net/lists/kernel/msg3215354.html
Luwei Kang (9):
KVM: x86: Add base address parameter for get_fixed_pmc function
KVM: x86: PEBS via Intel PT HW feature detection
KVM: x86: Implement
MSR_RELOAD_FIXED_CTRx registers.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/pmu.h | 5 ++---
arch/x86/kvm/vmx/pmu_intel.c | 14 +-
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kvm/pmu.h b/arch/x86/kvm/pmu.h
index 58265f7..c62a1ff 100644
--- a/arch/x86/kvm/pmu.h
PDCM (Perfmon and Debug Capability) indicates the processor
supports the performance and debug feature indication
MSR IA32_PERF_CAPABILITIES.
PEBS enabling in KVM guest depend on PEBS via PT, and
PEBS via PT is detected by IA32_PERF_CAPABILITIES[Bit16].
Signed-off-by: Luwei Kang
---
arch/x86
real hardware. Update the shadow value of PEBS before
VM-entry when PT is enabled in guest.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/pmu.c | 34 ++
arch/x86/kvm/pmu.h | 1 +
arch/x86/kvm/vmx/vmx.c
:
1. PEBS feature is supported by HW (IA32_MISC_ENABLE[Bit12]=0);
2. Intel PT must be working in HOST_GUEST mode.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/include/asm/msr-index.h | 3 +++
arch/x86/kvm/vmx/capabilities.h | 11 +++
arch/x86/kvm/vmx
destroyed.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 2 ++
arch/x86/include/asm/msr-index.h | 3 +++
arch/x86/kvm/vmx/pmu_intel.c | 42 +---
3 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b
changed.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/include/asm/msr-index.h | 3 +++
arch/x86/kvm/vmx/pmu_intel.c | 22 +-
3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include
Expose PEBS feature to guest by IA32_MISC_ENABLE[bit12].
IA32_MISC_ENABLE[bit12] is Processor Event Based Sampling (PEBS)
Unavailable (RO) flag:
1 = PEBS is not supported; 0 = PEBS is supported.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/svm.c
This patch add a new parameter "pebs" that to make the host
PMU framework allocate performance counter for guest PEBS event.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/pmu.c | 23 +++
arch/x86/kvm/pmu.h | 5 +++--
arch/x86/kvm/pmu_amd.c
Expose some bits of definition which relate with enable
PEBS to KVM guest especially PEBS via PT feature.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/include/asm/msr-index.h | 3 +++
arch/x86/kvm/vmx/vmx.c | 14 ++
3 files changed, 18
posted interrupt coming at this
time, the irq remmaping facility will set the bit of PIR (Posted
Interrupt Requests) without ON (Outstanding Notification).
So this interrupt can't be sync to APIC virtualization register and
will not be handled by Guest because ON is zero.
Signed-off-by: Luwei
buffer is filled.
Luwei Kang (3):
perf/x86/intel/pt: Move pt structure to global header
perf/x86/intel/pt: Inject PMI for KVM guest
KVM: x86: Add support of clear Trace_ToPA_PMI status
arch/x86/events/intel/pt.c | 12 +++-
arch/x86/events/intel/pt.h | 38
Intel PT structure (struct pt) is in a private header.
Move it (and sub structure) to a global header so that
it can be accessible from KVM code.
The definition of perf_output_handle structure included
in "linux/perf_event.h".
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.h
Add support of clear Intel PT ToPA PMI status for
KVM guest.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/include/asm/msr-index.h | 4
arch/x86/kvm/vmx/pmu_intel.c | 8 +++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86
Inject a PMI for KVM guest when Intel PT working
in Host-Guest mode and Guest ToPA entry memory buffer
was completely filled.
The definition of ‘kvm_make_request’ and ‘KVM_REQ_PMI’
depend on "linux/kvm_host.h" header.
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c
posted interrupt coming at this
time, the irq remmaping facility will set the bit of PIR (Posted
Interrupt Requests) without ON (Outstanding Notification).
So this interrupt can't be sync to APIC virtualization register and
will not be handled by Guest because ON is zero.
Signed-off-by: Luwei
posted interrupt coming at this
time, the irq remmaping facility will set the bit of PIR (Posted
Interrupt Requests) but ON (Outstanding Notification).
So this interrupt can't be sync to APIC virtualization register and
will not be handled by Guest because ON is zero.
Signed-off-by: Luwei
d when LAPIC is "software disabled"
and this local interrupt still disabled after LAPIC "software
enabled".
This patch will not mask the local interrupts when LAPIC
is "software disabled" and add LAPIC "software enabled" checking
before deliver local interrupt
Inject a PMI for KVM guest when Intel PT working
in Host-Guest mode and Guest ToPA entry memory buffer
was completely filled.
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/core.c | 6 +-
arch/x86/include/asm/msr-index.h | 4
arch/x86/kvm/x86.c | 10
buffer is filled.
>From v1:
- Exported a global function pointers may not a good chioce.
Add a new member in kvm_guest_cbs to send Intel PT PMI for KVM guest.
Luwei Kang (2):
KVM: x86: Inject PMI for KVM guest
KVM: x86: Add support of clear Trace_ToPA_PMI status
arch/x86/events/intel/cor
Add support of clear Intel PT ToPA PMI status for
KVM guest.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/include/asm/msr-index.h | 4
arch/x86/kvm/vmx/pmu_intel.c | 8 +++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86
x86: Implement Intel Processor Trace MSRs read/write emulation
KVM: x86: Set intercept for Intel PT MSRs read/write
Luwei Kang (5):
perf/x86/intel/pt: Add new bit definitions for Intel PT MSRs
perf/x86/intel/pt: add new capability for Intel PT
perf/x86/intel/pt: Introduce a new func
From: Chao Peng
Intel Processor Trace virtualization enabling in KVM guest
need to access these MSRs bit definitions, so move them to
public header file msr-index.h.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.h | 37
-by: Luwei Kang
---
arch/x86/include/asm/msr-index.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index afe4e13..6ae2462 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -112,6 +112,7
New function pt_cap_decode() will be invoked in KVM to check
if a specific capability is available in KVM guest.
Another function pt_cap_get() can only check the hardware
capabilities but this may different with KVM guest because
some features may not be exposed to guest.
Signed-off-by: Luwei
From: Chao Peng
Expose Intel Processor Trace to guest only when PT work in
HOST_GUEST mode.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c| 22 --
arch/x86/kvm/svm.c | 6
From: Chao Peng
Load/Store Intel processor trace register in context switch.
MSR IA32_RTIT_CTL is loaded/stored automatically from VMCS.
In HOST_GUEST mode, we need load/resore PT MSRs only when PT
is enabled in guest.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include
Initialize the Intel PT configuration when cpuid update.
Include cpuid inforamtion, rtit_ctl bit mask and the number of
address ranges.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 70 ++
1 file changed, 70 insertions(+)
diff --git a
exception (#GP).
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a09157c..093c1f7 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3997,7 +3997,8 @@ static int
From: Chao Peng
Intel PT virtualization can be work in one of 2 possible modes:
a. system-wide: trace both host and guest and output to host buffer;
b. host-guest: trace host/guest simultaneous and output to their
respective buffer.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
From: Chao Peng
Disable intercept Intel PT MSRs only when Intel PT is
enabled in guest. But MSR_IA32_RTIT_CTL will alway be
intercept.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/arch
From: Chao Peng
This patch implement Intel Processor Trace MSRs read/write
emulation.
Intel PT MSRs read/write need to be emulated when Intel PT
MSRs is intercepted in guest and during live migration.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h
and a #GP would be injected to guest if set
IA32_RTIT_CTL.FabricEn with
CPUID.(EAX=14H, ECX=0):ECX[bit 3] = 0.
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 1 +
arch/x86/include/asm/intel_pt.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/x86/events/intel/pt.c b/arch
From: Chao Peng
Change pt_cap_get() to a public function that KVM
can access this function to check if specific
feature is supported on hardware.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 3 ++-
arch/x86/events/intel/pt.h | 21
From: Chao Peng
Intel Processor Trace virtualization enabling in guest need
to use these MSR bits, so move them to public header msr-index.h.
Introduce RTIT_CTL_FABRIC_EN and sync the definitions to
latest spec.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/events/intel
Implement Intel Processor Trace context switch
KVM: x86: Implement Intel Processor Trace MSRs read/write
KVM: x86: Set intercept for Intel PT MSRs
Luwei Kang (3):
perf/x86/intel/pt: Introduce a new function to get the capability of
Intel PT
KVM: x86: Introduce a function to initi
Because of the guest CPUID information may diffrent with
with host(some bits may mask off in guest) so introduce a
new function pt_cap_get_ex() to get the capability of Intel PT.
Signed-off-by: Luwei Kang
---
arch/x86/events/intel/pt.c | 10 ++
arch/x86/include/asm/intel_pt.h | 2
From: Chao Peng
Add a data structure to save Intel Processor Trace context.
It mainly include the value of Intel PT host/guest MSRs
and guest CPUID information.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 19 +++
1 file changed, 19 insertions
exception (#GP).
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 0a55772..a1ec71d 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3710,7 +3710,8 @@ static int
From: Chao Peng
Expose Intel Processor Trace to guest only when PT work in
HOST_GUEST mode.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c| 22 --
arch/x86/kvm/svm.c | 6
From: Chao Peng
Implement Intel Processor Trace MSRs read/write.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h | 8 ++
arch/x86/kvm/vmx.c | 167
arch/x86/kvm/x86.c | 33 +++-
3
From: Chao Peng
Disable interrcept Intel PT MSRs only when Intel PT is
enabled in guest. But MSR_IA32_RTIT_CTL will alway be
intercept.
Signed-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx.c | 20
1 file changed, 20 insertions(+)
diff --git a/arch/x86
-off-by: Chao Peng
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/intel_pt.h | 6
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/vmx.h | 8 +
arch/x86/kvm/vmx.c | 68 +---
4 files changed, 79 insertions(+), 4
1 - 100 of 162 matches
Mail list logo