Skip to content

Commit 0ef0fd3

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM updates from Paolo Bonzini: "ARM: - support for SVE and Pointer Authentication in guests - PMU improvements POWER: - support for direct access to the POWER9 XIVE interrupt controller - memory and performance optimizations x86: - support for accessing memory not backed by struct page - fixes and refactoring Generic: - dirty page tracking improvements" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (155 commits) kvm: fix compilation on aarch64 Revert "KVM: nVMX: Expose RDPMC-exiting only when guest supports PMU" kvm: x86: Fix L1TF mitigation for shadow MMU KVM: nVMX: Disable intercept for FS/GS base MSRs in vmcs02 when possible KVM: PPC: Book3S: Remove useless checks in 'release' method of KVM device KVM: PPC: Book3S HV: XIVE: Fix spelling mistake "acessing" -> "accessing" KVM: PPC: Book3S HV: Make sure to load LPID for radix VCPUs kvm: nVMX: Set nested_run_pending in vmx_set_nested_state after checks complete tests: kvm: Add tests for KVM_SET_NESTED_STATE KVM: nVMX: KVM_SET_NESTED_STATE - Tear down old EVMCS state before setting new state tests: kvm: Add tests for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_CPU_ID tests: kvm: Add tests to .gitignore KVM: Introduce KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 KVM: Fix kvm_clear_dirty_log_protect off-by-(minus-)one KVM: Fix the bitmap range to copy during clear dirty KVM: arm64: Fix ptrauth ID register masking logic KVM: x86: use direct accessors for RIP and RSP KVM: VMX: Use accessors for GPRs outside of dedicated caching logic KVM: x86: Omit caching logic for always-available GPRs kvm, x86: Properly check whether a pfn is an MMIO or not ...
2 parents 4489da7 + c011d23 commit 0ef0fd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5574
-965
lines changed

Documentation/arm64/perf.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
Perf Event Attributes
2+
=====================
3+
4+
Author: Andrew Murray <[email protected]>
5+
Date: 2019-03-06
6+
7+
exclude_user
8+
------------
9+
10+
This attribute excludes userspace.
11+
12+
Userspace always runs at EL0 and thus this attribute will exclude EL0.
13+
14+
15+
exclude_kernel
16+
--------------
17+
18+
This attribute excludes the kernel.
19+
20+
The kernel runs at EL2 with VHE and EL1 without. Guest kernels always run
21+
at EL1.
22+
23+
For the host this attribute will exclude EL1 and additionally EL2 on a VHE
24+
system.
25+
26+
For the guest this attribute will exclude EL1. Please note that EL2 is
27+
never counted within a guest.
28+
29+
30+
exclude_hv
31+
----------
32+
33+
This attribute excludes the hypervisor.
34+
35+
For a VHE host this attribute is ignored as we consider the host kernel to
36+
be the hypervisor.
37+
38+
For a non-VHE host this attribute will exclude EL2 as we consider the
39+
hypervisor to be any code that runs at EL2 which is predominantly used for
40+
guest/host transitions.
41+
42+
For the guest this attribute has no effect. Please note that EL2 is
43+
never counted within a guest.
44+
45+
46+
exclude_host / exclude_guest
47+
----------------------------
48+
49+
These attributes exclude the KVM host and guest, respectively.
50+
51+
The KVM host may run at EL0 (userspace), EL1 (non-VHE kernel) and EL2 (VHE
52+
kernel or non-VHE hypervisor).
53+
54+
The KVM guest may run at EL0 (userspace) and EL1 (kernel).
55+
56+
Due to the overlapping exception levels between host and guests we cannot
57+
exclusively rely on the PMU's hardware exception filtering - therefore we
58+
must enable/disable counting on the entry and exit to the guest. This is
59+
performed differently on VHE and non-VHE systems.
60+
61+
For non-VHE systems we exclude EL2 for exclude_host - upon entering and
62+
exiting the guest we disable/enable the event as appropriate based on the
63+
exclude_host and exclude_guest attributes.
64+
65+
For VHE systems we exclude EL1 for exclude_guest and exclude both EL0,EL2
66+
for exclude_host. Upon entering and exiting the guest we modify the event
67+
to include/exclude EL0 as appropriate based on the exclude_host and
68+
exclude_guest attributes.
69+
70+
The statements above also apply when these attributes are used within a
71+
non-VHE guest however please note that EL2 is never counted within a guest.
72+
73+
74+
Accuracy
75+
--------
76+
77+
On non-VHE hosts we enable/disable counters on the entry/exit of host/guest
78+
transition at EL2 - however there is a period of time between
79+
enabling/disabling the counters and entering/exiting the guest. We are
80+
able to eliminate counters counting host events on the boundaries of guest
81+
entry/exit when counting guest events by filtering out EL2 for
82+
exclude_host. However when using !exclude_hv there is a small blackout
83+
window at the guest entry/exit where host events are not captured.
84+
85+
On VHE systems there are no blackout windows.

Documentation/arm64/pointer-authentication.txt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,21 @@ used to get and set the keys for a thread.
8787
Virtualization
8888
--------------
8989

90-
Pointer authentication is not currently supported in KVM guests. KVM
91-
will mask the feature bits from ID_AA64ISAR1_EL1, and attempted use of
92-
the feature will result in an UNDEFINED exception being injected into
93-
the guest.
90+
Pointer authentication is enabled in KVM guest when each virtual cpu is
91+
initialised by passing flags KVM_ARM_VCPU_PTRAUTH_[ADDRESS/GENERIC] and
92+
requesting these two separate cpu features to be enabled. The current KVM
93+
guest implementation works by enabling both features together, so both
94+
these userspace flags are checked before enabling pointer authentication.
95+
The separate userspace flag will allow to have no userspace ABI changes
96+
if support is added in the future to allow these two features to be
97+
enabled independently of one another.
98+
99+
As Arm Architecture specifies that Pointer Authentication feature is
100+
implemented along with the VHE feature so KVM arm64 ptrauth code relies
101+
on VHE mode to be present.
102+
103+
Additionally, when these vcpu feature flags are not set then KVM will
104+
filter out the Pointer Authentication system key registers from
105+
KVM_GET/SET_REG_* ioctls and mask those features from cpufeature ID
106+
register. Any attempt to use the Pointer Authentication instructions will
107+
result in an UNDEFINED exception being injected into the guest.

0 commit comments

Comments
 (0)