History

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 ...

Linus Torvalds committed 7 years ago

Commit 0ef0fd32 parents 4489da7 c011d2391 files · +5574 −965Browse files

Showing the changes to include/linux (2 of 91 files). Show all

Unified · Split

2 files
  1. include/linux/kvm_host.h +48 −0
  2. include/linux/perf_event.h +1 −0
include/linux/kvm_host.h+48−0
@@ -227,6 +227,32 @@ enum { · 226 unmodified lines
227 READING_SHADOW_PAGE_TABLES,227 READING_SHADOW_PAGE_TABLES,
228};228};
229 229
230#define KVM_UNMAPPED_PAGE ((void *) 0x500 + POISON_POINTER_DELTA)
231
232struct 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 */
251static inline bool kvm_vcpu_mapped(struct kvm_host_map *map)
252{
253 return !!map->hva;
254}
255
230/*256/*
231 * Sometimes a large or cross-page mmio needs to be broken up into separate257 * Sometimes a large or cross-page mmio needs to be broken up into separate
232 * exits for userspace servicing.258 * exits for userspace servicing.
@@ -733,7 +759,9 @@ struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu); · 500 unmodified lines
733struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn);759struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn);
734kvm_pfn_t kvm_vcpu_gfn_to_pfn_atomic(struct kvm_vcpu *vcpu, gfn_t gfn);760kvm_pfn_t kvm_vcpu_gfn_to_pfn_atomic(struct kvm_vcpu *vcpu, gfn_t gfn);
735kvm_pfn_t kvm_vcpu_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn);761kvm_pfn_t kvm_vcpu_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn);
762int kvm_vcpu_map(struct kvm_vcpu *vcpu, gpa_t gpa, struct kvm_host_map *map);
736struct page *kvm_vcpu_gfn_to_page(struct kvm_vcpu *vcpu, gfn_t gfn);763struct page *kvm_vcpu_gfn_to_page(struct kvm_vcpu *vcpu, gfn_t gfn);
764void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map, bool dirty);
737unsigned long kvm_vcpu_gfn_to_hva(struct kvm_vcpu *vcpu, gfn_t gfn);765unsigned long kvm_vcpu_gfn_to_hva(struct kvm_vcpu *vcpu, gfn_t gfn);
738unsigned long kvm_vcpu_gfn_to_hva_prot(struct kvm_vcpu *vcpu, gfn_t gfn, bool *writable);766unsigned long kvm_vcpu_gfn_to_hva_prot(struct kvm_vcpu *vcpu, gfn_t gfn, bool *writable);
739int kvm_vcpu_read_guest_page(struct kvm_vcpu *vcpu, gfn_t gfn, void *data, int offset,767int 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 void (*destroy)(struct kvm_device *dev);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 int (*set_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);1282 int (*set_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
1246 int (*get_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);1283 int (*get_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
1247 int (*has_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);1284 int (*has_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
1248 long (*ioctl)(struct kvm_device *dev, unsigned int ioctl,1285 long (*ioctl)(struct kvm_device *dev, unsigned int ioctl,
1249 unsigned long arg);1286 unsigned long arg);
1287 int (*mmap)(struct kvm_device *dev, struct vm_area_struct *vma);
1250};1288};
1251 1289
1252void kvm_device_get(struct kvm_device *dev);1290void 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#endif /* CONFIG_HAVE_KVM_INVALID_WAKEUPS */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 */
1350bool kvm_arch_no_poll(struct kvm_vcpu *vcpu);
1351#else
1352static inline bool kvm_arch_no_poll(struct kvm_vcpu *vcpu)
1353{
1354 return false;
1355}
1356#endif /* CONFIG_HAVE_KVM_NO_POLL */
1357
1310#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL1358#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL
1311long kvm_arch_vcpu_async_ioctl(struct file *filp,1359long kvm_arch_vcpu_async_ioctl(struct file *filp,
1312 unsigned int ioctl, unsigned long arg);1360 unsigned int ioctl, unsigned long arg);
include/linux/perf_event.h+1−0
@@ -30,6 +30,7 @@ struct perf_guest_info_callbacks { · 29 unmodified lines
30 int (*is_in_guest)(void);30 int (*is_in_guest)(void);
31 int (*is_user_mode)(void);31 int (*is_user_mode)(void);
32 unsigned long (*get_guest_ip)(void);32 unsigned long (*get_guest_ip)(void);
33 void (*handle_intel_pt_intr)(void);
33};34};
34 35
35#ifdef CONFIG_HAVE_HW_BREAKPOINT36#ifdef CONFIG_HAVE_HW_BREAKPOINT

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t