[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 2/4] xen/arm: Add new HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE} keys in HVMOP
For use cases such as Dom0less PV drivers, a mechanism to communicate Dom0less DomU's static data with the runtime control plane (Dom0) is needed. Since on Arm HVMOP is already the existing approach to address such use cases (for example the allocation of HVM_PARAM_CALLBACK_IRQ), add new HVMOP keys HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE} for storing the hypervisor reserved pages region base PFN and size. Currently, the hypervisor reserved pages region is used as the Arm Dom0less DomU guest magic pages region. Therefore protect the HVMOP keys with "#if defined(__arm__) || defined(__aarch64__)". The values will be set at Dom0less DomU construction time after Dom0less DomU's magic pages region has been allocated. Reported-by: Alec Kwapis <alec.kwapis@xxxxxxxxxxxxx> Signed-off-by: Henry Wang <xin.wang2@xxxxxxx> --- v2: - Rename the HVMOP keys to HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE}. (Daniel) - Add comment on top of HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE} to describe its usage. Protect them with #ifdef. (Daniel, Jan) --- xen/arch/arm/dom0less-build.c | 3 +++ xen/arch/arm/hvm.c | 2 ++ xen/include/public/hvm/params.h | 11 ++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c index 4b96ddd9ce..5bb53ebb47 100644 --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -764,6 +764,9 @@ static int __init alloc_magic_pages(struct domain *d) return rc; } + d->arch.hvm.params[HVM_PARAM_HV_RSRV_BASE_PFN] = gfn_x(gfn); + d->arch.hvm.params[HVM_PARAM_HV_RSRV_SIZE] = NR_MAGIC_PAGES; + return 0; } diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c index 0989309fea..949d804f8b 100644 --- a/xen/arch/arm/hvm.c +++ b/xen/arch/arm/hvm.c @@ -55,6 +55,8 @@ static int hvm_allow_get_param(const struct domain *d, unsigned int param) case HVM_PARAM_STORE_EVTCHN: case HVM_PARAM_CONSOLE_PFN: case HVM_PARAM_CONSOLE_EVTCHN: + case HVM_PARAM_HV_RSRV_BASE_PFN: + case HVM_PARAM_HV_RSRV_SIZE: return 0; /* diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h index a22b4ed45d..337f5b0bf8 100644 --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -296,6 +296,15 @@ #define XEN_HVM_MCA_CAP_LMCE (xen_mk_ullong(1) << 0) #define XEN_HVM_MCA_CAP_MASK XEN_HVM_MCA_CAP_LMCE -#define HVM_NR_PARAMS 39 +/* + * Base PFN and number of pages of the hypervisor reserved pages region. + * Currently only used on Arm for Dom0less DomUs as guest magic pages region. + */ +#if defined(__arm__) || defined(__aarch64__) +#define HVM_PARAM_HV_RSRV_BASE_PFN 39 +#define HVM_PARAM_HV_RSRV_SIZE 40 +#endif + +#define HVM_NR_PARAMS 41 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */ -- 2.34.1
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |