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
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
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
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
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
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
value after.
The flag "initialized" need to be cleared when PT is change
from enabled to disabled. Guest may modify PT MSRs when PT
is disabled and they are only saved in variables.
We need to reload these value to HW manual when PT is enabled.
Signed-off-by: Luwei Kang
---
arch/x86/kvm
Remove the previous pt_ctx structure and use pt_state
to save the PT configuration because they are saved
the same things.
Add *_ctx postfix to different with the upcoming
host and guest fpu pointer for PT state.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx/nested.c | 2 +-
arch/x86/kvm/vmx
saved in xsave area not variables.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx/vmx.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index d323e6b..d3e2569 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -1000,6
This patch change the Intel PT configuration state
to structure pointer so that we only need to allocate
the state buffer when Intel PT working in HOST_GUEST
mode.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx/nested.c | 2 +-
arch/x86/kvm/vmx/vmx.c| 202
Allocate XSAVE area for host and guest Intel PT
configuration when Intel PT working in HOST_GUEST
mode. Intel PT configuration state can be saved
using XSAVES and restored by XRSTORS instruction.
Signed-off-by: Luwei Kang
---
arch/x86/kvm/vmx/vmx.c | 25 -
arch/x86/kvm
e Intel PT configuration state.
Luwei Kang (6):
x86/fpu: Introduce new fpu state for Intel processor trace
KVM: VMX: Reuse the pt_state structure for PT context
KVM: VMX: Dymamic allocate Intel PT configuration state
KVM: VMX: Allocate XSAVE area for Intel PT configuration
KVM: VMX: Intel PT co
Introduce new fpu state structure pt_state to save Intel
processor trace configuration. The upcoming using
XSAVES/XRSTORS to switch the Intel PT configuration
on VM-Entry/Exit will use this structure.
Signed-off-by: Luwei Kang
---
arch/x86/include/asm/fpu/types.h | 13 +
1 file
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
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
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
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) 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) 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
-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
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
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
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
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
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
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
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
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
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
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
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
-off-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 c168e26..cc9e681 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -112,6
New function __pt_cap_get() will be invoked in KVM to check
if a specific capability is availiable 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
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
-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
-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 9a5c26d..a08c61b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
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
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
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 c125fb1..1e800d0 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3952,7 +3952,8 @@ static int
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 | 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
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
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
KVM: x86: Implement Intel Processor Trace context switch
KVM: x86: Implement Intel Processor Trace MSRs read/write
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 P
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
New function __pt_cap_get() will be invoked in KVM to check
if a specific capability is availiable 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
-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
-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 9a5c26d..a08c61b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
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 | 163
arch/x86/kvm/x86.c | 33 +++-
3
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 c125fb1..1e800d0 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3952,7 +3952,8 @@ static int
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 | 20
1 file changed, 20 insertions(+)
diff --git a/arch/x86
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
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: 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 c168e26..cc9e681 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -112,6
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
KVM: x86: Implement Intel Processor Trace context switch
KVM: x86: Implement Intel Processor Trace MSRs read/write
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 P
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
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
-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
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
1 - 100 of 162 matches
Mail list logo