]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
x86/hyper-v: move struct hv_flush_pcpu{,ex} definitions to common header
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 16 May 2018 15:21:24 +0000 (17:21 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Sat, 26 May 2018 12:14:33 +0000 (14:14 +0200)
Hyper-V TLB flush hypercalls definitions will be required for KVM so move
them hyperv-tlfs.h. Structures also need to be renamed as '_pcpu' suffix is
irrelevant for a general-purpose definition.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/hyperv/mmu.c
arch/x86/include/asm/hyperv-tlfs.h
arch/x86/include/asm/mshyperv.h

index 5f053d7d1bd972425a2af829a82345c295ad6533..de27615c51ea3fe951c2d2065734b5a79693c00a 100644 (file)
 #define CREATE_TRACE_POINTS
 #include <asm/trace/hyperv.h>
 
-/* HvFlushVirtualAddressSpace, HvFlushVirtualAddressList hypercalls */
-struct hv_flush_pcpu {
-       u64 address_space;
-       u64 flags;
-       u64 processor_mask;
-       u64 gva_list[];
-};
-
-/* HvFlushVirtualAddressSpaceEx, HvFlushVirtualAddressListEx hypercalls */
-struct hv_flush_pcpu_ex {
-       u64 address_space;
-       u64 flags;
-       struct hv_vpset hv_vp_set;
-       u64 gva_list[];
-};
-
 /* Each gva in gva_list encodes up to 4096 pages to flush */
 #define HV_TLB_FLUSH_UNIT (4096 * PAGE_SIZE)
 
@@ -67,8 +51,8 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus,
                                    const struct flush_tlb_info *info)
 {
        int cpu, vcpu, gva_n, max_gvas;
-       struct hv_flush_pcpu **flush_pcpu;
-       struct hv_flush_pcpu *flush;
+       struct hv_tlb_flush **flush_pcpu;
+       struct hv_tlb_flush *flush;
        u64 status = U64_MAX;
        unsigned long flags;
 
@@ -82,7 +66,7 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus,
 
        local_irq_save(flags);
 
-       flush_pcpu = (struct hv_flush_pcpu **)
+       flush_pcpu = (struct hv_tlb_flush **)
                     this_cpu_ptr(hyperv_pcpu_input_arg);
 
        flush = *flush_pcpu;
@@ -152,8 +136,8 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
                                       const struct flush_tlb_info *info)
 {
        int nr_bank = 0, max_gvas, gva_n;
-       struct hv_flush_pcpu_ex **flush_pcpu;
-       struct hv_flush_pcpu_ex *flush;
+       struct hv_tlb_flush_ex **flush_pcpu;
+       struct hv_tlb_flush_ex *flush;
        u64 status = U64_MAX;
        unsigned long flags;
 
@@ -167,7 +151,7 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
 
        local_irq_save(flags);
 
-       flush_pcpu = (struct hv_flush_pcpu_ex **)
+       flush_pcpu = (struct hv_tlb_flush_ex **)
                     this_cpu_ptr(hyperv_pcpu_input_arg);
 
        flush = *flush_pcpu;
index ff3f56bdd5d767c7844995879af7ae2b9de278bc..b8c89265baf0dbc253d1c5ed2c217f53326cb64e 100644 (file)
@@ -741,4 +741,20 @@ struct ipi_arg_ex {
        struct hv_vpset vp_set;
 };
 
+/* HvFlushVirtualAddressSpace, HvFlushVirtualAddressList hypercalls */
+struct hv_tlb_flush {
+       u64 address_space;
+       u64 flags;
+       u64 processor_mask;
+       u64 gva_list[];
+};
+
+/* HvFlushVirtualAddressSpaceEx, HvFlushVirtualAddressListEx hypercalls */
+struct hv_tlb_flush_ex {
+       u64 address_space;
+       u64 flags;
+       struct hv_vpset hv_vp_set;
+       u64 gva_list[];
+};
+
 #endif
index 997192131b7b864ab73e0e6656c8eaaa6c620a56..3cd14311edfad6d04c5ea382b2b6845f66a9d6f8 100644 (file)
@@ -269,7 +269,7 @@ static inline int cpumask_to_vpset(struct hv_vpset *vpset,
                return 0;
 
        /*
-        * Clear all banks up to the maximum possible bank as hv_flush_pcpu_ex
+        * Clear all banks up to the maximum possible bank as hv_tlb_flush_ex
         * structs are not cleared between calls, we risk flushing unneeded
         * vCPUs otherwise.
         */