Skip to contentSkip to conversation

Remove unnecessary asm/hvm/support.h includes

PATCH In review Xenia Ragiadakou 2 participants 8 messages Feb 6, 2023

lore
Share & tools
lore
#0 lore raw

cover Remove unnecessary asm/hvm/support.h includes

While working on the separation between AMD and Intel code, I noticed that the header asm/hvm/support.h is included in many files even if none of its declarations and macro definitions is referred in those files.

This patch series aims to remove any redundant includes of asm/hvm/support.h. The changes are sent as 2 patches to aid review (especially the change in asm/spec_ctrl.h).

Xenia Ragiadakou (2):
x86: do not include asm/hvm/support.h when not used x86/hygon: do not include asm/hvm/support.h when not used

 xen/arch/x86/cpu/amd.c                  | 2 +-
 xen/arch/x86/cpu/hygon.c                | 1 -
 xen/arch/x86/cpu/intel.c                | 2 +-
 xen/arch/x86/cpu/vpmu.c                 | 1 -
 xen/arch/x86/cpu/vpmu_intel.c           | 1 -
 xen/arch/x86/crash.c                    | 1 -
 xen/arch/x86/domain.c                   | 1 -
 xen/arch/x86/domctl.c                   | 1 -
 xen/arch/x86/emul-i8254.c               | 2 +-
 xen/arch/x86/hvm/hpet.c                 | 2 +-
 xen/arch/x86/hvm/io.c                   | 1 -
 xen/arch/x86/hvm/irq.c                  | 2 +-
 xen/arch/x86/hvm/pmtimer.c              | 3 ++-
 xen/arch/x86/hvm/rtc.c                  | 3 ++-
 xen/arch/x86/hvm/save.c                 | 2 --
 xen/arch/x86/hvm/stdvga.c               | 1 -
 xen/arch/x86/hvm/svm/emulate.c          | 1 -
 xen/arch/x86/hvm/svm/intr.c             | 1 -
 xen/arch/x86/hvm/svm/vmcb.c             | 1 -
 xen/arch/x86/hvm/viridian/synic.c       | 1 -
 xen/arch/x86/hvm/viridian/time.c        | 1 -
 xen/arch/x86/hvm/viridian/viridian.c    | 1 -
 xen/arch/x86/hvm/vmx/intr.c             | 1 -
 xen/arch/x86/hvm/vmx/vmcs.c             | 1 -
 xen/arch/x86/hvm/vmx/vvmx.c             | 1 +
 xen/arch/x86/hvm/vpic.c                 | 2 +-
 xen/arch/x86/hvm/vpt.c                  | 2 +-
 xen/arch/x86/i387.c                     | 1 -
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  | 2 +-
 xen/arch/x86/include/asm/spec_ctrl.h    | 2 +-
 xen/arch/x86/mm/altp2m.c                | 1 -
 xen/arch/x86/mm/hap/nested_ept.c        | 1 -
 xen/arch/x86/mm/hap/nested_hap.c        | 1 -
 xen/arch/x86/oprofile/op_model_athlon.c | 2 +-
 xen/arch/x86/oprofile/xenoprof.c        | 1 -
 xen/arch/x86/smp.c                      | 1 -
 xen/arch/x86/sysctl.c                   | 1 -
 xen/arch/x86/x86_64/traps.c             | 1 -
 xen/arch/x86/xstate.c                   | 1 -
 xen/drivers/passthrough/x86/hvm.c       | 1 -
 40 files changed, 15 insertions(+), 40 deletions(-)
Signature · 1 line
2.37.2
#1 lore raw

PATCH 1/2 x86: do not include asm/hvm/support.h when not used

When none of the declarations and macro definitions in asm/hvm/support.h is referred in the file, do not include the header.

To fix subsequent build errors, which were not triggered before due to the indirect inclusion of the missing headers by asm/hvm/support.h, include any missing headers.

No functional change intended.

---
 xen/arch/x86/cpu/amd.c                  | 2 +-
 xen/arch/x86/cpu/intel.c                | 2 +-
 xen/arch/x86/cpu/vpmu.c                 | 1 -
 xen/arch/x86/cpu/vpmu_intel.c           | 1 -
 xen/arch/x86/crash.c                    | 1 -
 xen/arch/x86/domain.c                   | 1 -
 xen/arch/x86/domctl.c                   | 1 -
 xen/arch/x86/emul-i8254.c               | 2 +-
 xen/arch/x86/hvm/hpet.c                 | 2 +-
 xen/arch/x86/hvm/io.c                   | 1 -
 xen/arch/x86/hvm/irq.c                  | 2 +-
 xen/arch/x86/hvm/pmtimer.c              | 3 ++-
 xen/arch/x86/hvm/rtc.c                  | 3 ++-
 xen/arch/x86/hvm/save.c                 | 2 --
 xen/arch/x86/hvm/stdvga.c               | 1 -
 xen/arch/x86/hvm/svm/emulate.c          | 1 -
 xen/arch/x86/hvm/svm/intr.c             | 1 -
 xen/arch/x86/hvm/svm/vmcb.c             | 1 -
 xen/arch/x86/hvm/viridian/synic.c       | 1 -
 xen/arch/x86/hvm/viridian/time.c        | 1 -
 xen/arch/x86/hvm/viridian/viridian.c    | 1 -
 xen/arch/x86/hvm/vmx/intr.c             | 1 -
 xen/arch/x86/hvm/vmx/vmcs.c             | 1 -
 xen/arch/x86/hvm/vmx/vvmx.c             | 1 +
 xen/arch/x86/hvm/vpic.c                 | 2 +-
 xen/arch/x86/hvm/vpt.c                  | 2 +-
 xen/arch/x86/i387.c                     | 1 -
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  | 2 +-
 xen/arch/x86/mm/altp2m.c                | 1 -
 xen/arch/x86/mm/hap/nested_ept.c        | 1 -
 xen/arch/x86/mm/hap/nested_hap.c        | 1 -
 xen/arch/x86/oprofile/op_model_athlon.c | 2 +-
 xen/arch/x86/oprofile/xenoprof.c        | 1 -
 xen/arch/x86/smp.c                      | 1 -
 xen/arch/x86/sysctl.c                   | 1 -
 xen/arch/x86/x86_64/traps.c             | 1 -
 xen/arch/x86/xstate.c                   | 1 -
 xen/drivers/passthrough/x86/hvm.c       | 1 -
 38 files changed, 14 insertions(+), 38 deletions(-)
xen/arch/x86/cpu/amd.c +1 -1
index 1ddb55cbe5..caafe44740 100644
@@ -4,12 +4,12 @@
 #include <xen/param.h>
 #include <xen/smp.h>
 #include <xen/pci.h>
+#include <xen/sched.h>
 #include <xen/warning.h>
 #include <asm/io.h>
 #include <asm/msr.h>
 #include <asm/processor.h>
 #include <asm/amd.h>
-#include <asm/hvm/support.h>
 #include <asm/spec_ctrl.h>
 #include <asm/acpi.h>
 #include <asm/apic.h>
xen/arch/x86/cpu/intel.c +1 -1
index dc6a0c7807..71fc1a1e18 100644
@@ -1,5 +1,6 @@
 #include <xen/init.h>
 #include <xen/kernel.h>
+#include <xen/sched.h>
 #include <xen/string.h>
 #include <xen/bitops.h>
 #include <xen/smp.h>
@@ -10,7 +11,6 @@
 #include <asm/apic.h>
 #include <asm/i387.h>
 #include <mach_apic.h>
-#include <asm/hvm/support.h>
 
 #include "cpu.h"
 
xen/arch/x86/cpu/vpmu.c +0 -1
index 33e2fca8cd..b6b7342fb4 100644
@@ -30,7 +30,6 @@
 #include <asm/nmi.h>
 #include <asm/p2m.h>
 #include <asm/vpmu.h>
-#include <asm/hvm/support.h>
 #include <asm/apic.h>
 #include <irq_vectors.h>
 #include <public/pmu.h>
xen/arch/x86/cpu/vpmu_intel.c +0 -1
index b91d818be0..a8df52579d 100644
@@ -29,7 +29,6 @@
 #include <asm/msr.h>
 #include <asm/msr-index.h>
 #include <asm/vpmu.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/vlapic.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
xen/arch/x86/crash.c +0 -1
index 99089f77a7..7850f0af24 100644
@@ -24,7 +24,6 @@
 #include <xen/keyhandler.h>
 #include <public/xen.h>
 #include <asm/shared.h>
-#include <asm/hvm/support.h>
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #include <xen/iommu.h>
xen/arch/x86/domain.c +0 -1
index d7a8237f01..abd2b4ad68 100644
@@ -51,7 +51,6 @@
 #include <asm/ldt.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/nestedhvm.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/viridian.h>
 #include <asm/debugreg.h>
xen/arch/x86/domctl.c +0 -1
index e9bfbc57a7..2118fcad5d 100644
@@ -25,7 +25,6 @@
 #include <asm/irq.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/hvm.h>
-#include <asm/hvm/support.h>
 #include <asm/processor.h>
 #include <asm/acpi.h> /* for hvm_acpi_power_button */
 #include <xen/hypercall.h> /* for arch_do_domctl */
xen/arch/x86/emul-i8254.c +1 -1
index 18894b6348..1688b7e458 100644
@@ -34,7 +34,7 @@
 #include <asm/time.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
 #include <asm/hvm/vpt.h>
 #include <asm/current.h>
 
xen/arch/x86/hvm/hpet.c +1 -1
index 45c7b9b406..c65e1b27d0 100644
@@ -18,7 +18,7 @@
 
 #include <asm/hvm/vpt.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
 #include <asm/hvm/trace.h>
 #include <asm/current.h>
 #include <asm/hpet.h>
xen/arch/x86/hvm/io.c +0 -1
index 0309d05cfd..5ae209d3b6 100644
@@ -36,7 +36,6 @@
 #include <asm/shadow.h>
 #include <asm/p2m.h>
 #include <asm/hvm/hvm.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/vpt.h>
 #include <asm/hvm/vpic.h>
 #include <asm/hvm/vlapic.h>
xen/arch/x86/hvm/irq.c +1 -1
index d93ffe4546..4fe87a71c1 100644
@@ -24,7 +24,7 @@
 #include <xen/irq.h>
 #include <xen/keyhandler.h>
 #include <asm/hvm/domain.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
 #include <asm/msi.h>
 #include <public/hvm/params.h>
 
xen/arch/x86/hvm/pmtimer.c +2 -1
index 2a89bbdfa5..b89d0fd53b 100644
@@ -17,9 +17,10 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/sched.h>
 #include <asm/hvm/vpt.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
 #include <asm/acpi.h> /* for hvm_acpi_power_button prototype */
 #include <public/hvm/params.h>
 
xen/arch/x86/hvm/rtc.c +2 -1
index d21925db08..44f2fb668d 100644
@@ -22,10 +22,11 @@
  * IN THE SOFTWARE.
  */
 
+#include <xen/sched.h>
 #include <asm/mc146818rtc.h>
 #include <asm/hvm/vpt.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
 #include <asm/current.h>
 #include <xen/trace.h>
 #include <public/hvm/params.h>
xen/arch/x86/hvm/save.c +0 -2
index 86c82cbd74..c1675e3d9f 100644
@@ -24,8 +24,6 @@
 #include <xen/softirq.h>
 #include <xen/version.h>
 
-#include <asm/hvm/support.h>
-
 #include <public/hvm/save.h>
 
 void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr)
xen/arch/x86/hvm/stdvga.c +0 -1
index be8200c8d0..798a9a0549 100644
@@ -31,7 +31,6 @@
 #include <xen/types.h>
 #include <xen/sched.h>
 #include <xen/domain_page.h>
-#include <asm/hvm/support.h>
 #include <xen/numa.h>
 #include <xen/paging.h>
 
xen/arch/x86/hvm/svm/emulate.c +0 -1
index 635b3705f7..16fc134883 100644
@@ -22,7 +22,6 @@
 #include <asm/msr.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/hvm.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/vmcb.h>
 #include <asm/hvm/svm/emulate.h>
xen/arch/x86/hvm/svm/intr.c +0 -1
index 7f815d2307..9525f35593 100644
@@ -27,7 +27,6 @@
 #include <asm/paging.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/vlapic.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/intr.h>
xen/arch/x86/hvm/svm/vmcb.c +0 -1
index 0fc57dfd71..305d4767e3 100644
@@ -26,7 +26,6 @@
 #include <asm/hvm/svm/vmcb.h>
 #include <asm/msr-index.h>
 #include <asm/p2m.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/svmdebug.h>
 #include <asm/spec_ctrl.h>
xen/arch/x86/hvm/viridian/synic.c +0 -1
index 856bb898b8..83d7addfc3 100644
@@ -13,7 +13,6 @@
 
 #include <asm/apic.h>
 #include <asm/guest/hyperv-tlfs.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/vlapic.h>
 
 #include "private.h"
xen/arch/x86/hvm/viridian/time.c +0 -1
index b56fd67662..a3ea3fa067 100644
@@ -15,7 +15,6 @@
 #include <asm/event.h>
 #include <asm/guest/hyperv.h>
 #include <asm/guest/hyperv-tlfs.h>
-#include <asm/hvm/support.h>
 
 #include "private.h"
 
xen/arch/x86/hvm/viridian/viridian.c +0 -1
index 2937ddd3a8..7405c117bc 100644
@@ -16,7 +16,6 @@
 #include <asm/paging.h>
 #include <asm/p2m.h>
 #include <asm/apic.h>
-#include <asm/hvm/support.h>
 #include <public/sched.h>
 #include <public/hvm/hvm_op.h>
 
xen/arch/x86/hvm/vmx/intr.c +0 -1
index 13bbe8430d..6a8316de0e 100644
@@ -29,7 +29,6 @@
 #include <asm/msr.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
 #include <asm/hvm/vpic.h>
xen/arch/x86/hvm/vmx/vmcs.c +0 -1
index 7d8bfeb539..09edbd23b3 100644
@@ -33,7 +33,6 @@
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/nestedhvm.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vvmx.h>
 #include <asm/hvm/vmx/vmcs.h>
xen/arch/x86/hvm/vmx/vvmx.c +1 -0
index f8fe8d0c14..674cdabb07 100644
@@ -24,6 +24,7 @@
 #include <asm/types.h>
 #include <asm/mtrr.h>
 #include <asm/p2m.h>
+#include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vvmx.h>
 #include <asm/hvm/nestedhvm.h>
xen/arch/x86/hvm/vpic.c +1 -1
index b3cafaab8f..17e15720f0 100644
@@ -32,7 +32,7 @@
 #include <xen/trace.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
 
 #define vpic_domain(v) (container_of((v), struct domain, \
                         arch.hvm.vpic[!vpic->is_master]))
xen/arch/x86/hvm/vpt.c +1 -1
index cb1d81bf9e..621f5bb88b 100644
@@ -16,8 +16,8 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/sched.h>
 #include <xen/time.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/vpt.h>
 #include <asm/event.h>
 #include <asm/apic.h>
xen/arch/x86/i387.c +0 -1
index 677f571792..d824f2bb52 100644
@@ -11,7 +11,6 @@
 #include <xen/sched.h>
 #include <asm/current.h>
 #include <asm/processor.h>
-#include <asm/hvm/support.h>
 #include <asm/i387.h>
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
xen/arch/x86/include/asm/hvm/vmx/vmx.h +1 -1
index 96a9f07ca5..234da4a7f4 100644
@@ -23,8 +23,8 @@
 #include <asm/regs.h>
 #include <asm/asm_defns.h>
 #include <asm/processor.h>
+#include <asm/p2m.h>
 #include <asm/i387.h>
-#include <asm/hvm/support.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/vmx/vmcs.h>
 
xen/arch/x86/mm/altp2m.c +0 -1
index 8be6eaf242..07393befee 100644
@@ -15,7 +15,6 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <asm/hvm/support.h>
 #include <asm/hvm/hvm.h>
 #include <asm/p2m.h>
 #include <asm/altp2m.h>
xen/arch/x86/mm/hap/nested_ept.c +0 -1
index 23fb3889b7..605e47c16c 100644
@@ -25,7 +25,6 @@
 #include <asm/p2m.h>
 #include <asm/mem_sharing.h>
 #include <asm/hap.h>
-#include <asm/hvm/support.h>
 
 #include <asm/hvm/nestedhvm.h>
 
xen/arch/x86/mm/hap/nested_hap.c +0 -1
index b19f657c27..098e8e5d4c 100644
@@ -27,7 +27,6 @@
 #include <asm/p2m.h>
 #include <asm/mem_sharing.h>
 #include <asm/hap.h>
-#include <asm/hvm/support.h>
 
 #include <asm/hvm/nestedhvm.h>
 
xen/arch/x86/oprofile/op_model_athlon.c +1 -1
index 7bc5853a6c..69fd3fcc86 100644
@@ -10,6 +10,7 @@
  * @author Graydon Hoare
  */
 
+#include <xen/sched.h>
 #include <xen/types.h>
 #include <asm/msr.h>
 #include <asm/io.h>
@@ -18,7 +19,6 @@
 #include <xen/xenoprof.h>
 #include <asm/regs.h>
 #include <asm/current.h>
-#include <asm/hvm/support.h>
 #include <xen/pci_regs.h>
 #include <xen/pci_ids.h>
 
xen/arch/x86/oprofile/xenoprof.c +0 -1
index b20f26bbe5..247a0deca8 100644
@@ -12,7 +12,6 @@
 #include <xen/sched.h>
 #include <xen/xenoprof.h>
 #include <public/xenoprof.h>
-#include <asm/hvm/support.h>
 
 #include "op_counter.h"
 
xen/arch/x86/smp.c +0 -1
index b42603c351..3a331cbdbc 100644
@@ -21,7 +21,6 @@
 #include <asm/flushtlb.h>
 #include <asm/hardirq.h>
 #include <asm/hpet.h>
-#include <asm/hvm/support.h>
 #include <asm/setup.h>
 #include <irq_vectors.h>
 #include <mach_apic.h>
xen/arch/x86/sysctl.c +0 -1
index f82abc2488..f42a3b843b 100644
@@ -22,7 +22,6 @@
 #include <xen/iocap.h>
 #include <asm/irq.h>
 #include <asm/hvm/hvm.h>
-#include <asm/hvm/support.h>
 #include <asm/processor.h>
 #include <asm/setup.h>
 #include <asm/smp.h>
xen/arch/x86/x86_64/traps.c +0 -1
index f8cb8d9a94..f4d17b4830 100644
@@ -23,7 +23,6 @@
 #include <asm/page.h>
 #include <asm/shared.h>
 #include <asm/hvm/hvm.h>
-#include <asm/hvm/support.h>
 
 
 static void print_xen_info(void)
xen/arch/x86/xstate.c +0 -1
index 3b32bdc51c..d481e1db3e 100644
@@ -10,7 +10,6 @@
 #include <xen/sched.h>
 #include <asm/current.h>
 #include <asm/processor.h>
-#include <asm/hvm/support.h>
 #include <asm/i387.h>
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
xen/drivers/passthrough/x86/hvm.c +0 -1
index 6bbd04bf3d..8175ba629a 100644
@@ -23,7 +23,6 @@
 #include <xen/cpu.h>
 #include <xen/irq.h>
 #include <asm/hvm/irq.h>
-#include <asm/hvm/support.h>
 #include <asm/io_apic.h>
 
 /*
Signature · 1 line
2.37.2
#2 lore raw

Re: [PATCH 1/2] x86: do not include asm/hvm/support.h when not used

xen/arch/x86/emul-i8254.c line 39

Quoted 10 lines · Xenia Ragiadakou
xen/arch/x86/emul-i8254.c +1 -1
@@ -34,7 +34,7 @@
 #include <asm/time.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
 #include <asm/hvm/vpt.h>
 #include <asm/current.h>

To be honest I'd prefer if only the HVM-specific part of this file had this new #include (and ideally the other hvm/ ones would move there as well, but I can see this being beyond the scope of what you're wanting to do).

Jan

#3 lore raw

Re: [PATCH 1/2] x86: do not include asm/hvm/support.h when not used

Quoted 16 lines · Jan Beulich

xen/arch/x86/emul-i8254.c line 39

Quoted 10 lines · Xenia Ragiadakou
xen/arch/x86/emul-i8254.c +1 -1
@@ -34,7 +34,7 @@
  #include <asm/time.h>
  #include <asm/hvm/hvm.h>
  #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
  #include <asm/hvm/vpt.h>
  #include <asm/current.h>

To be honest I'd prefer if only the HVM-specific part of this file had this new #include (and ideally the other hvm/ ones would move there as well, but I can see this being beyond the scope of what you're wanting to do).

Ah I see. That's ok. I ll move it in v2.

Quoted 2 lines

Jan

Signature · 1 line
Xenia
#4 lore raw

Re: [PATCH 1/2] x86: do not include asm/hvm/support.h when not used

Quoted 19 lines · Xenia Ragiadakou
Quoted 16 lines · Jan Beulich

xen/arch/x86/emul-i8254.c line 39

Quoted 10 lines · Xenia Ragiadakou
xen/arch/x86/emul-i8254.c +1 -1
@@ -34,7 +34,7 @@
   #include <asm/time.h>
   #include <asm/hvm/hvm.h>
   #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
   #include <asm/hvm/vpt.h>
   #include <asm/current.h>

To be honest I'd prefer if only the HVM-specific part of this file had this new #include (and ideally the other hvm/ ones would move there as well, but I can see this being beyond the scope of what you're wanting to do).

Quoted 1 line

Ah I see. That's ok. I ll move it in v2.

After having a closer look at the code, I think it would be better to leave it as is in this patch because the struct hvm_hw_pit_channel (declared in puplic/hvm/save.h) and the function hvm_get_guest_time() (declared in asm/hvm/hvm.h) are used by the common part of this file. And I can send another patch to cleanup the headers in this file. Unless you insist.

Quoted 4 lines
Quoted 3 lines

Jan

Signature · 1 line
Xenia
Acked-by
#5 lore raw

Re: [PATCH 1/2] x86: do not include asm/hvm/support.h when not used

Quoted 19 lines · Xenia Ragiadakou
Quoted 18 lines · Xenia Ragiadakou
Quoted 16 lines · Jan Beulich

xen/arch/x86/emul-i8254.c line 39

Quoted 10 lines · Xenia Ragiadakou
xen/arch/x86/emul-i8254.c +1 -1
@@ -34,7 +34,7 @@
   #include <asm/time.h>
   #include <asm/hvm/hvm.h>
   #include <asm/hvm/io.h>
-#include <asm/hvm/support.h>
+#include <asm/hvm/save.h>
   #include <asm/hvm/vpt.h>
   #include <asm/current.h>

To be honest I'd prefer if only the HVM-specific part of this file had this new #include (and ideally the other hvm/ ones would move there as well, but I can see this being beyond the scope of what you're wanting to do).

Quoted 8 lines
Quoted 1 line

Ah I see. That's ok. I ll move it in v2.

After having a closer look at the code, I think it would be better to leave it as is in this patch because the struct hvm_hw_pit_channel (declared in puplic/hvm/save.h) and the function hvm_get_guest_time() (declared in asm/hvm/hvm.h) are used by the common part of this file. And I can send another patch to cleanup the headers in this file. Unless you insist.

Oh, I didn't recall it's this ugly. We're indeed using a HVM-only struct for PV here as well. Your change is okay then as is:

Jan

#6 lore raw

PATCH 2/2 x86/hygon: do not include asm/hvm/support.h when not used

In reply to Xenia Ragiadakou

Since none of the declarations and macro definitions in asm/hvm/support.h is referred in x86/cpu/hygon.c, remove the unnecessary include.

To resolve the subsequent build error for implicit declaration of wrmsrl() and rdmsrl() triggered in asm/spec_ctrl.h, replace asm/msr-index.h with asm/msr.h in asm/spec_ctrl.h's included headers.

No functional change intended.

---
 xen/arch/x86/cpu/hygon.c             | 1 -
 xen/arch/x86/include/asm/spec_ctrl.h | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
xen/arch/x86/cpu/hygon.c +0 -1
index 361eb6fd41..42029f2145 100644
@@ -1,6 +1,5 @@
 #include <xen/init.h>
 #include <asm/processor.h>
-#include <asm/hvm/support.h>
 #include <asm/spec_ctrl.h>
 
 #include "cpu.h"
xen/arch/x86/include/asm/spec_ctrl.h +1 -1
index 6a77c39378..e928596450 100644
@@ -60,7 +60,7 @@
 
 #include <asm/alternative.h>
 #include <asm/current.h>
-#include <asm/msr-index.h>
+#include <asm/msr.h>
 
 void init_speculation_mitigations(void);
 void spec_ctrl_init_domain(struct domain *d);
Signature · 1 line
2.37.2
Acked-by on v1 2/2
#7 lore raw

Re: [PATCH 2/2] x86/hygon: do not include asm/hvm/support.h when not used

Quoted 10 lines · Xenia Ragiadakou

Since none of the declarations and macro definitions in asm/hvm/support.h is referred in x86/cpu/hygon.c, remove the unnecessary include.

To resolve the subsequent build error for implicit declaration of wrmsrl() and rdmsrl() triggered in asm/spec_ctrl.h, replace asm/msr-index.h with asm/msr.h in asm/spec_ctrl.h's included headers.

No functional change intended.