On 14.08.2021 01:28, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshche...@epam.com>
> 
> We need to pass info about maximum supported address space size
> to the toolstack on Arm in order to properly calculate the base
> and size of the safe range for the guest. Use p2m_ipa_bits variable
> which purpose is to hold the bit size of IPAs in P2M tables.

What is "the safe range"?

> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -332,6 +332,11 @@ struct xen_arch_domainconfig {
>       */
>      uint32_t clock_frequency;
>  };
> +
> +struct arch_physinfo {
> +    /* Holds the bit size of IPAs in p2m tables. */
> +    uint32_t p2m_ipa_bits;
> +};
>  #endif /* __XEN__ || __XEN_TOOLS__ */
>  
>  struct arch_vcpu_info {
> --- a/xen/include/public/arch-x86/xen.h
> +++ b/xen/include/public/arch-x86/xen.h
> @@ -346,6 +346,8 @@ typedef struct xen_msr_entry {
>  } xen_msr_entry_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_msr_entry_t);
>  
> +struct arch_physinfo {
> +};
>  #endif /* !__ASSEMBLY__ */

While the term "p2m_ipa_bits" surely isn't arch-agnostic, I wonder
whether the expressed information is (the x86 equivalent being
hap_paddr_bits, at a guess), and hence whether this really ought
to live in an arch-specific sub-struct. If indeed so, please name
the struct in a name space clean way, i.e. add xen_ as prefix.

Also please retain a blank line before the #endif. I wonder whether
on Arm you wouldn't want to add one at this occasion.

Jan


Reply via email to