diff mbox series

[v2,7/9] x86/vmx: remove unused included headers from vmx.c

Message ID 20230222120023.3004624-8-burzalodowa@gmail.com (mailing list archive)
State New, archived
Headers show
Series x86/hvm: {svm,vmx}.{c,h} cleanup | expand

Commit Message

Xenia Ragiadakou Feb. 22, 2023, noon UTC
Do not include the headers:
  asm/hvm/vpic.h
  asm/hvm/vpt.h
  asm/io.h
  asm/mce.h
  asm/mem_sharing.h
  asm/regs.h
  public/arch-x86/cpuid.h
  public/hvm/save.h
because none of the declarations and macro definitions in them is used.
Sort the rest of the headers alphabetically.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
---

Changes in v2:
  -add a blank line between different types of hesders

 xen/arch/x86/hvm/vmx/vmx.c | 56 +++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 31 deletions(-)

Comments

Jan Beulich Feb. 23, 2023, 11:16 a.m. UTC | #1
On 22.02.2023 13:00, Xenia Ragiadakou wrote:
> Do not include the headers:
>   asm/hvm/vpic.h
>   asm/hvm/vpt.h
>   asm/io.h
>   asm/mce.h
>   asm/mem_sharing.h

This one puzzled me, so I've looked up its origin. It's entirely unclear
to me why 29317cfbf36d ("HAP fault handling for shared pages") added it
both here and in svm.c

>   asm/regs.h
>   public/arch-x86/cpuid.h
>   public/hvm/save.h
> because none of the declarations and macro definitions in them is used.
> Sort the rest of the headers alphabetically.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
> ---
> 
> Changes in v2:
>   -add a blank line between different types of hesders
> 
>  xen/arch/x86/hvm/vmx/vmx.c | 56 +++++++++++++++++---------------------
>  1 file changed, 25 insertions(+), 31 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> index a19ece90fc..a6ec0a11fb 100644
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -15,52 +15,46 @@
>   * this program; If not, see <http://www.gnu.org/licenses/>.
>   */
>  
> +#include <xen/domain_page.h>
>  #include <xen/guest_access.h>
> +#include <xen/hypercall.h>
>  #include <xen/init.h>
> +#include <xen/irq.h>
>  #include <xen/lib.h>
>  #include <xen/param.h>
> -#include <xen/trace.h>
> +#include <xen/perfc.h>
>  #include <xen/sched.h>
> -#include <xen/irq.h>
>  #include <xen/softirq.h>
> -#include <xen/domain_page.h>
> -#include <xen/hypercall.h>
> -#include <xen/perfc.h>
> -#include <asm/current.h>
> -#include <asm/io.h>
> -#include <asm/iocap.h>
> -#include <asm/regs.h>
> +#include <xen/trace.h>
> +
> +#include <asm/altp2m.h>
> +#include <asm/apic.h>
>  #include <asm/cpufeature.h>
> -#include <asm/processor.h>
> +#include <asm/current.h>
> +#include <asm/gdbsx.h>
>  #include <asm/debugreg.h>
> -#include <asm/msr.h>
> -#include <asm/p2m.h>
> -#include <asm/mem_sharing.h>
> +#include <asm/event.h>
>  #include <asm/hvm/emulate.h>
>  #include <asm/hvm/hvm.h>
> +#include <asm/hvm/monitor.h>
> +#include <asm/hvm/nestedhvm.h>
>  #include <asm/hvm/support.h>
> -#include <asm/hvm/vmx/vmx.h>
> +#include <asm/hvm/trace.h>
> +#include <asm/hvm/vlapic.h>
>  #include <asm/hvm/vmx/vmcs.h>
> -#include <public/sched.h>
> -#include <public/hvm/ioreq.h>
> +#include <asm/hvm/vmx/vmx.h>
> +#include <asm/iocap.h>
>  #include <asm/i387.h>
> -#include <asm/hvm/vpic.h>
> -#include <asm/hvm/vlapic.h>
> -#include <asm/x86_emulate.h>
> -#include <asm/hvm/vpt.h>
> -#include <public/hvm/save.h>
> -#include <asm/hvm/trace.h>
> -#include <asm/hvm/monitor.h>
> -#include <asm/xenoprof.h>
> -#include <asm/gdbsx.h>
> -#include <asm/apic.h>
> -#include <asm/hvm/nestedhvm.h>
> -#include <asm/altp2m.h>
> -#include <asm/event.h>
> -#include <asm/mce.h>
>  #include <asm/monitor.h>
> +#include <asm/msr.h>
> +#include <asm/processor.h>
>  #include <asm/prot-key.h>
> -#include <public/arch-x86/cpuid.h>
> +#include <asm/p2m.h>
> +#include <asm/xenoprof.h>
> +#include <asm/x86_emulate.h>
> +
> +#include <public/sched.h>
> +#include <public/hvm/ioreq.h>

It's a shame this one's needed - handle_pio() really should have a "bool"
last parameter.

Anyway, patch looks okay to me, but will need a maintainer ack.

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a19ece90fc..a6ec0a11fb 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -15,52 +15,46 @@ 
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/domain_page.h>
 #include <xen/guest_access.h>
+#include <xen/hypercall.h>
 #include <xen/init.h>
+#include <xen/irq.h>
 #include <xen/lib.h>
 #include <xen/param.h>
-#include <xen/trace.h>
+#include <xen/perfc.h>
 #include <xen/sched.h>
-#include <xen/irq.h>
 #include <xen/softirq.h>
-#include <xen/domain_page.h>
-#include <xen/hypercall.h>
-#include <xen/perfc.h>
-#include <asm/current.h>
-#include <asm/io.h>
-#include <asm/iocap.h>
-#include <asm/regs.h>
+#include <xen/trace.h>
+
+#include <asm/altp2m.h>
+#include <asm/apic.h>
 #include <asm/cpufeature.h>
-#include <asm/processor.h>
+#include <asm/current.h>
+#include <asm/gdbsx.h>
 #include <asm/debugreg.h>
-#include <asm/msr.h>
-#include <asm/p2m.h>
-#include <asm/mem_sharing.h>
+#include <asm/event.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/hvm.h>
+#include <asm/hvm/monitor.h>
+#include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/support.h>
-#include <asm/hvm/vmx/vmx.h>
+#include <asm/hvm/trace.h>
+#include <asm/hvm/vlapic.h>
 #include <asm/hvm/vmx/vmcs.h>
-#include <public/sched.h>
-#include <public/hvm/ioreq.h>
+#include <asm/hvm/vmx/vmx.h>
+#include <asm/iocap.h>
 #include <asm/i387.h>
-#include <asm/hvm/vpic.h>
-#include <asm/hvm/vlapic.h>
-#include <asm/x86_emulate.h>
-#include <asm/hvm/vpt.h>
-#include <public/hvm/save.h>
-#include <asm/hvm/trace.h>
-#include <asm/hvm/monitor.h>
-#include <asm/xenoprof.h>
-#include <asm/gdbsx.h>
-#include <asm/apic.h>
-#include <asm/hvm/nestedhvm.h>
-#include <asm/altp2m.h>
-#include <asm/event.h>
-#include <asm/mce.h>
 #include <asm/monitor.h>
+#include <asm/msr.h>
+#include <asm/processor.h>
 #include <asm/prot-key.h>
-#include <public/arch-x86/cpuid.h>
+#include <asm/p2m.h>
+#include <asm/xenoprof.h>
+#include <asm/x86_emulate.h>
+
+#include <public/sched.h>
+#include <public/hvm/ioreq.h>
 
 #include "vmx.h"