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 ...
Showing the changes to include/linux (2 of 91 files). Show all
Unified · Split
| @@ -227,6 +227,32 @@ enum { · 226 unmodified lines | ||
| 227 | 227 | READING_SHADOW_PAGE_TABLES, |
| 228 | 228 | }; |
| 229 | 229 | |
| 230 | +#define KVM_UNMAPPED_PAGE ((void *) 0x500 + POISON_POINTER_DELTA) | |
| 231 | + | |
| 232 | +struct kvm_host_map { | |
| 233 | + /* | |
| 234 | + * Only valid if the 'pfn' is managed by the host kernel (i.e. There is | |
| 235 | + * a 'struct page' for it. When using mem= kernel parameter some memory | |
| 236 | + * can be used as guest memory but they are not managed by host | |
| 237 | + * kernel). | |
| 238 | + * If 'pfn' is not managed by the host kernel, this field is | |
| 239 | + * initialized to KVM_UNMAPPED_PAGE. | |
| 240 | + */ | |
| 241 | + struct page *page; | |
| 242 | + void *hva; | |
| 243 | + kvm_pfn_t pfn; | |
| 244 | + kvm_pfn_t gfn; | |
| 245 | +}; | |
| 246 | + | |
| 247 | +/* | |
| 248 | + * Used to check if the mapping is valid or not. Never use 'kvm_host_map' | |
| 249 | + * directly to check for that. | |
| 250 | + */ | |
| 251 | +static inline bool kvm_vcpu_mapped(struct kvm_host_map *map) | |
| 252 | +{ | |
| 253 | + return !!map->hva; | |
| 254 | +} | |
| 255 | + | |
| 230 | 256 | /* |
| 231 | 257 | * Sometimes a large or cross-page mmio needs to be broken up into separate |
| 232 | 258 | * exits for userspace servicing. |
| @@ -733,7 +759,9 @@ struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu); · 500 unmodified lines | ||
| 733 | 759 | struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn); |
| 734 | 760 | kvm_pfn_t kvm_vcpu_gfn_to_pfn_atomic(struct kvm_vcpu *vcpu, gfn_t gfn); |
| 735 | 761 | kvm_pfn_t kvm_vcpu_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn); |
| 762 | +int kvm_vcpu_map(struct kvm_vcpu *vcpu, gpa_t gpa, struct kvm_host_map *map); | |
| 736 | 763 | struct page *kvm_vcpu_gfn_to_page(struct kvm_vcpu *vcpu, gfn_t gfn); |
| 764 | +void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map, bool dirty); | |
| 737 | 765 | unsigned long kvm_vcpu_gfn_to_hva(struct kvm_vcpu *vcpu, gfn_t gfn); |
| 738 | 766 | unsigned long kvm_vcpu_gfn_to_hva_prot(struct kvm_vcpu *vcpu, gfn_t gfn, bool *writable); |
| 739 | 767 | int kvm_vcpu_read_guest_page(struct kvm_vcpu *vcpu, gfn_t gfn, void *data, int offset, |
| @@ -1242,11 +1270,21 @@ struct kvm_device_ops { · 502 unmodified lines | ||
| 1242 | 1270 | */ |
| 1243 | 1271 | void (*destroy)(struct kvm_device *dev); |
| 1244 | 1272 | |
| 1273 | + /* | |
| 1274 | + * Release is an alternative method to free the device. It is | |
| 1275 | + * called when the device file descriptor is closed. Once | |
| 1276 | + * release is called, the destroy method will not be called | |
| 1277 | + * anymore as the device is removed from the device list of | |
| 1278 | + * the VM. kvm->lock is held. | |
| 1279 | + */ | |
| 1280 | + void (*release)(struct kvm_device *dev); | |
| 1281 | + | |
| 1245 | 1282 | int (*set_attr)(struct kvm_device *dev, struct kvm_device_attr *attr); |
| 1246 | 1283 | int (*get_attr)(struct kvm_device *dev, struct kvm_device_attr *attr); |
| 1247 | 1284 | int (*has_attr)(struct kvm_device *dev, struct kvm_device_attr *attr); |
| 1248 | 1285 | long (*ioctl)(struct kvm_device *dev, unsigned int ioctl, |
| 1249 | 1286 | unsigned long arg); |
| 1287 | + int (*mmap)(struct kvm_device *dev, struct vm_area_struct *vma); | |
| 1250 | 1288 | }; |
| 1251 | 1289 | |
| 1252 | 1290 | void kvm_device_get(struct kvm_device *dev); |
| @@ -1307,6 +1345,16 @@ static inline bool vcpu_valid_wakeup(struct kvm_vcpu *vcpu) · 54 unmodified lines | ||
| 1307 | 1345 | } |
| 1308 | 1346 | #endif /* CONFIG_HAVE_KVM_INVALID_WAKEUPS */ |
| 1309 | 1347 | |
| 1348 | +#ifdef CONFIG_HAVE_KVM_NO_POLL | |
| 1349 | +/* Callback that tells if we must not poll */ | |
| 1350 | +bool kvm_arch_no_poll(struct kvm_vcpu *vcpu); | |
| 1351 | +#else | |
| 1352 | +static inline bool kvm_arch_no_poll(struct kvm_vcpu *vcpu) | |
| 1353 | +{ | |
| 1354 | + return false; | |
| 1355 | +} | |
| 1356 | +#endif /* CONFIG_HAVE_KVM_NO_POLL */ | |
| 1357 | + | |
| 1310 | 1358 | #ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL |
| 1311 | 1359 | long kvm_arch_vcpu_async_ioctl(struct file *filp, |
| 1312 | 1360 | unsigned int ioctl, unsigned long arg); |
| @@ -30,6 +30,7 @@ struct perf_guest_info_callbacks { · 29 unmodified lines | ||
| 30 | 30 | int (*is_in_guest)(void); |
| 31 | 31 | int (*is_user_mode)(void); |
| 32 | 32 | unsigned long (*get_guest_ip)(void); |
| 33 | + void (*handle_intel_pt_intr)(void); | |
| 33 | 34 | }; |
| 34 | 35 | |
| 35 | 36 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |