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
227227 READING_SHADOW_PAGE_TABLES,
228228 };
229229
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+
230256 /*
231257 * Sometimes a large or cross-page mmio needs to be broken up into separate
232258 * exits for userspace servicing.
@@ -733,7 +759,9 @@ struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu); · 500 unmodified lines
733759 struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn);
734760 kvm_pfn_t kvm_vcpu_gfn_to_pfn_atomic(struct kvm_vcpu *vcpu, gfn_t gfn);
735761 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);
736763 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);
737765 unsigned long kvm_vcpu_gfn_to_hva(struct kvm_vcpu *vcpu, gfn_t gfn);
738766 unsigned long kvm_vcpu_gfn_to_hva_prot(struct kvm_vcpu *vcpu, gfn_t gfn, bool *writable);
739767 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
12421270 */
12431271 void (*destroy)(struct kvm_device *dev);
12441272
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+
12451282 int (*set_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12461283 int (*get_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12471284 int (*has_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12481285 long (*ioctl)(struct kvm_device *dev, unsigned int ioctl,
12491286 unsigned long arg);
1287+ int (*mmap)(struct kvm_device *dev, struct vm_area_struct *vma);
12501288 };
12511289
12521290 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
13071345 }
13081346 #endif /* CONFIG_HAVE_KVM_INVALID_WAKEUPS */
13091347
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+
13101358 #ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL
13111359 long kvm_arch_vcpu_async_ioctl(struct file *filp,
13121360 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
3030 int (*is_in_guest)(void);
3131 int (*is_user_mode)(void);
3232 unsigned long (*get_guest_ip)(void);
33+ void (*handle_intel_pt_intr)(void);
3334 };
3435
3536 #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