mbox series

[XEN,v1,00/15] x86: make cpu virtualization support configurable

Message ID 20240416061845.3467822-1-Sergiy_Kibrik@epam.com (mailing list archive)
Headers show
Series x86: make cpu virtualization support configurable | expand

Message

Sergiy Kibrik April 16, 2024, 6:18 a.m. UTC
This series aims to continue what Xenia started a year ago:

https://lore.kernel.org/xen-devel/20230213145751.1047236-1-burzalodowa@gmail.com/

Here's an attempt to provide a means to render the cpu virtualization
technology support in Xen configurable.
Currently, irrespectively of the target platform, both AMD-V and Intel VT-x
drivers are built.
The series adds two new Kconfig controls, SVM and VMX, that can be
used to switch to a finer-grained configuration for a given platform, and
reduce dead code.

The code separation is done using the new config guards.

Since the initial RFC series felt rather welcomed, I took a courage naming
it v1 and continuing from there. New changes are:

v1:
 * changed Kconfig options naming
 * use IS_ENABLED() instead of #ifdef where possible
 * move altp2m code apart from p2m & hide under VMX option
 * introduce helper in cpu_has_vmx_* macros
 * and address other comments from Jan

Sergiy Kibrik (6):
  x86/monitor: guard altp2m usage
  x86/p2m: guard altp2m init/teardown
  x86/p2m: move altp2m-related code to separate file
  x86/p2m: guard altp2m code with CONFIG_VMX option
  x86/vpmu: separate amd/intel vPMU code
  x86/vmx: introduce helper function for vmcs macro

Xenia Ragiadakou (9):
  x86: introduce AMD-V and Intel VT-x Kconfig options
  x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers
  x86/p2m: guard vmx specific ept functions with CONFIG_VMX
  x86/traps: guard vmx specific functions with CONFIG_VMX
  x86/domain: guard svm specific functions with CONFIG_SVM
  x86/oprofile: guard svm specific symbols with CONFIG_SVM
  x86: wire cpu_has_{svm/vmx}_* to false when svm/vmx not enabled
  x86/ioreq: guard VIO_realmode_completion with CONFIG_VMX
  x86/hvm: make AMD-V and Intel VT-x support configurable

 xen/arch/x86/Kconfig                    |  20 +
 xen/arch/x86/cpu/Makefile               |   4 +-
 xen/arch/x86/domain.c                   |  10 +-
 xen/arch/x86/hvm/Makefile               |   4 +-
 xen/arch/x86/hvm/emulate.c              |   2 +
 xen/arch/x86/hvm/hvm.c                  |   4 +-
 xen/arch/x86/hvm/ioreq.c                |   2 +
 xen/arch/x86/hvm/monitor.c              |   4 +-
 xen/arch/x86/include/asm/altp2m.h       |   5 +-
 xen/arch/x86/include/asm/hvm/hvm.h      |   7 +
 xen/arch/x86/include/asm/hvm/svm/svm.h  |   8 +
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  96 ++--
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  |  28 +-
 xen/arch/x86/include/asm/p2m.h          |  18 +-
 xen/arch/x86/include/asm/vpmu.h         |  19 +
 xen/arch/x86/mm/Makefile                |   5 +-
 xen/arch/x86/mm/altp2m.c                | 631 +++++++++++++++++++++++
 xen/arch/x86/mm/hap/Makefile            |   2 +-
 xen/arch/x86/mm/p2m-basic.c             |  23 +-
 xen/arch/x86/mm/p2m.c                   | 636 +-----------------------
 xen/arch/x86/mm/p2m.h                   |   3 +
 xen/arch/x86/oprofile/op_model_athlon.c |   2 +-
 xen/arch/x86/traps.c                    |   8 +-
 xen/drivers/passthrough/Kconfig         |   4 +-
 xen/include/xen/sched.h                 |   2 +-
 25 files changed, 834 insertions(+), 713 deletions(-)

Comments

Jan Beulich April 17, 2024, 2:46 p.m. UTC | #1
On 16.04.2024 08:18, Sergiy Kibrik wrote:
> This series aims to continue what Xenia started a year ago:
> 
> https://lore.kernel.org/xen-devel/20230213145751.1047236-1-burzalodowa@gmail.com/
> 
> Here's an attempt to provide a means to render the cpu virtualization
> technology support in Xen configurable.
> Currently, irrespectively of the target platform, both AMD-V and Intel VT-x
> drivers are built.
> The series adds two new Kconfig controls, SVM and VMX, that can be
> used to switch to a finer-grained configuration for a given platform, and
> reduce dead code.
> 
> The code separation is done using the new config guards.
> 
> Since the initial RFC series felt rather welcomed, I took a courage naming
> it v1 and continuing from there. New changes are:
> 
> v1:
>  * changed Kconfig options naming
>  * use IS_ENABLED() instead of #ifdef where possible
>  * move altp2m code apart from p2m & hide under VMX option
>  * introduce helper in cpu_has_vmx_* macros
>  * and address other comments from Jan
> 
> Sergiy Kibrik (6):
>   x86/monitor: guard altp2m usage
>   x86/p2m: guard altp2m init/teardown
>   x86/p2m: move altp2m-related code to separate file
>   x86/p2m: guard altp2m code with CONFIG_VMX option
>   x86/vpmu: separate amd/intel vPMU code
>   x86/vmx: introduce helper function for vmcs macro
> 
> Xenia Ragiadakou (9):
>   x86: introduce AMD-V and Intel VT-x Kconfig options
>   x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers
>   x86/p2m: guard vmx specific ept functions with CONFIG_VMX
>   x86/traps: guard vmx specific functions with CONFIG_VMX
>   x86/domain: guard svm specific functions with CONFIG_SVM
>   x86/oprofile: guard svm specific symbols with CONFIG_SVM
>   x86: wire cpu_has_{svm/vmx}_* to false when svm/vmx not enabled
>   x86/ioreq: guard VIO_realmode_completion with CONFIG_VMX
>   x86/hvm: make AMD-V and Intel VT-x support configurable

Going forward, can you please make sure you send patch series as threads
(i.e. individual patches with Reply-to: referencing the cover letter)?

Jan
Sergiy Kibrik April 18, 2024, 1:14 p.m. UTC | #2
17.04.24 17:46, Jan Beulich:
> Going forward, can you please make sure you send patch series as threads
> (i.e. individual patches with Reply-to: referencing the cover letter)?

oh, yes.. sorry about that, I myself noticed a broken threading only 
after git send-email started firing..

   -Sergiy