|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] xen: Refactor altp2m options into a structured format
commit 5956e5b2d6f156233196c18ea3a7f9a722c6e30c
Author: Petr Beneš <w1benny@xxxxxxxxx>
AuthorDate: Mon Jul 7 11:47:15 2025 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jul 7 11:47:15 2025 +0200
xen: Refactor altp2m options into a structured format
Encapsulate the altp2m options within a struct. This change is preparatory
and sets the groundwork for introducing additional parameter in subsequent
commit.
Signed-off-by: Petr Beneš <w1benny@xxxxxxxxx>
Acked-by: Christian Lindig <christian.lindig@xxxxxxxxx>
Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx> # arm
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> # hypervisor
---
tools/libs/light/libxl_create.c | 6 +++---
tools/ocaml/libs/xc/xenctrl_stubs.c | 4 +++-
xen/arch/arm/domain.c | 2 +-
xen/arch/x86/domain.c | 4 ++--
xen/arch/x86/hvm/hvm.c | 2 +-
xen/include/public/domctl.h | 4 +++-
6 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 9525d22312..8a85fba1cf 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -622,17 +622,17 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config
*d_config,
LOG(DETAIL, "altp2m: %s", libxl_altp2m_mode_to_string(b_info->altp2m));
switch(b_info->altp2m) {
case LIBXL_ALTP2M_MODE_MIXED:
- create.altp2m_opts |=
+ create.altp2m.opts |=
XEN_DOMCTL_ALTP2M_mode(XEN_DOMCTL_ALTP2M_mixed);
break;
case LIBXL_ALTP2M_MODE_EXTERNAL:
- create.altp2m_opts |=
+ create.altp2m.opts |=
XEN_DOMCTL_ALTP2M_mode(XEN_DOMCTL_ALTP2M_external);
break;
case LIBXL_ALTP2M_MODE_LIMITED:
- create.altp2m_opts |=
+ create.altp2m.opts |=
XEN_DOMCTL_ALTP2M_mode(XEN_DOMCTL_ALTP2M_limited);
break;
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c
b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 863ab3c778..b51fd66788 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -225,7 +225,9 @@ CAMLprim value stub_xc_domain_create(value xch_val, value
wanted_domid, value co
.max_maptrack_frames = Int_val(VAL_MAX_MAPTRACK_FRAMES),
.grant_opts =
XEN_DOMCTL_GRANT_version(Int_val(VAL_MAX_GRANT_VERSION)),
- .altp2m_opts = Int32_val(VAL_ALTP2M_OPTS),
+ .altp2m = {
+ .opts = Int32_val(VAL_ALTP2M_OPTS),
+ },
.vmtrace_size = vmtrace_size,
.cpupool_id = Int32_val(VAL_CPUPOOL_ID),
};
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index be58a23dd7..79a144e61b 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -693,7 +693,7 @@ int arch_sanitise_domain_config(struct
xen_domctl_createdomain *config)
return -EINVAL;
}
- if ( config->altp2m_opts )
+ if ( config->altp2m.opts )
{
dprintk(XENLOG_INFO, "Altp2m not supported\n");
return -EINVAL;
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index b67342797f..56c3816187 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -622,7 +622,7 @@ int arch_sanitise_domain_config(struct
xen_domctl_createdomain *config)
bool hap = config->flags & XEN_DOMCTL_CDF_hap;
bool nested_virt = config->flags & XEN_DOMCTL_CDF_nested_virt;
unsigned int max_vcpus;
- unsigned int altp2m_mode = MASK_EXTR(config->altp2m_opts,
+ unsigned int altp2m_mode = MASK_EXTR(config->altp2m.opts,
XEN_DOMCTL_ALTP2M_mode_mask);
if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) )
@@ -709,7 +709,7 @@ int arch_sanitise_domain_config(struct
xen_domctl_createdomain *config)
return -EINVAL;
}
- if ( config->altp2m_opts & ~XEN_DOMCTL_ALTP2M_mode_mask )
+ if ( config->altp2m.opts & ~XEN_DOMCTL_ALTP2M_mode_mask )
{
dprintk(XENLOG_INFO, "Invalid altp2m options selected: %#x\n",
config->flags);
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 056360d5fe..56c7de3977 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -665,7 +665,7 @@ int hvm_domain_initialise(struct domain *d,
d->arch.hvm.params[HVM_PARAM_TRIPLE_FAULT_REASON] = SHUTDOWN_reboot;
/* Set altp2m based on domctl flags. */
- switch ( MASK_EXTR(config->altp2m_opts, XEN_DOMCTL_ALTP2M_mode_mask) )
+ switch ( MASK_EXTR(config->altp2m.opts, XEN_DOMCTL_ALTP2M_mode_mask) )
{
case XEN_DOMCTL_ALTP2M_mixed:
d->arch.hvm.params[HVM_PARAM_ALTP2M] = XEN_ALTP2M_mixed;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index be19ab5e26..a69dd96084 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -99,6 +99,7 @@ struct xen_domctl_createdomain {
uint32_t grant_opts;
+ struct {
/*
* Enable altp2m mixed mode.
*
@@ -115,7 +116,8 @@ struct xen_domctl_createdomain {
/* Altp2m mode signaling uses bits [0, 1]. */
#define XEN_DOMCTL_ALTP2M_mode_mask (0x3U)
#define XEN_DOMCTL_ALTP2M_mode(m) ((m) & XEN_DOMCTL_ALTP2M_mode_mask)
- uint32_t altp2m_opts;
+ uint32_t opts;
+ } altp2m;
/* Per-vCPU buffer size in bytes. 0 to disable. */
uint32_t vmtrace_size;
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |