diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-09-29 13:25:13 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-09-30 07:09:48 -0400 |
commit | c99ad25b0d2bdb703a23217cfb0cf4bab364e9c7 (patch) | |
tree | 689021e8b0b99c46f195ad78bdeec72d67b5ff26 /include/linux/kvm_host.h | |
parent | KVM: selftests: Fix nx_huge_pages_test on TDP-disabled hosts (diff) | |
parent | KVM: x86/svm/pmu: Rewrite get_gp_pmc_amd() for more counters scalability (diff) | |
download | linux-dev-c99ad25b0d2bdb703a23217cfb0cf4bab364e9c7.tar.xz linux-dev-c99ad25b0d2bdb703a23217cfb0cf4bab364e9c7.zip |
Merge tag 'kvm-x86-6.1-2' of https://github.com/sean-jc/linux into HEAD
KVM x86 updates for 6.1, batch #2:
- Misc PMU fixes and cleanups.
- Fixes for Hyper-V hypercall selftest
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index f4519d3689e1..32f259fa5801 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -151,12 +151,11 @@ static inline bool is_error_page(struct page *page) #define KVM_REQUEST_NO_ACTION BIT(10) /* * Architecture-independent vcpu->requests bit members - * Bits 4-7 are reserved for more arch-independent bits. + * Bits 3-7 are reserved for more arch-independent bits. */ #define KVM_REQ_TLB_FLUSH (0 | KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP) #define KVM_REQ_VM_DEAD (1 | KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP) #define KVM_REQ_UNBLOCK 2 -#define KVM_REQ_UNHALT 3 #define KVM_REQUEST_ARCH_BASE 8 /* @@ -2248,6 +2247,19 @@ static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu) #endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */ /* + * If more than one page is being (un)accounted, @virt must be the address of + * the first page of a block of pages what were allocated together (i.e + * accounted together). + * + * kvm_account_pgtable_pages() is thread-safe because mod_lruvec_page_state() + * is thread-safe. + */ +static inline void kvm_account_pgtable_pages(void *virt, int nr) +{ + mod_lruvec_page_state(virt_to_page(virt), NR_SECONDARY_PAGETABLE, nr); +} + +/* * This defines how many reserved entries we want to keep before we * kick the vcpu to the userspace to avoid dirty ring full. This * value can be tuned to higher if e.g. PML is enabled on the host. |