[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 4/4] x86/mem_sharing: compile mem_sharing subsystem only when kconfig is enabled



>>> On 26.04.19 at 19:21, <tamas@xxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -17,7 +17,6 @@ config X86
>       select HAS_KEXEC
>       select MEM_ACCESS_ALWAYS_ON
>       select HAS_MEM_PAGING
> -     select HAS_MEM_SHARING
>       select HAS_NS16550
>       select HAS_PASSTHROUGH
>       select HAS_PCI
> @@ -198,6 +197,13 @@ config PV_SHIM_EXCLUSIVE
>         firmware, and will not function correctly in other scenarios.
>  
>         If unsure, say N.
> +
> +config MEM_SHARING
> +    bool
> +    default n
> +    depends on HVM
> +    prompt "Xen memory sharing support" if EXPERT = "y"
> +

As per all the context above, please use proper (tab) indentation.
Also please omit the pointless "default n". And then the "bool"
and "prompt ..." can (and hence should) be combined into a
single line.

I also wonder whether this shouldn't be in common/Kconfig, but
then again it can be moved there if Arm would ever gain
mem-sharing support.

> @@ -98,4 +100,33 @@ void mem_sharing_init(void);
>   */
>  int relinquish_shared_pages(struct domain *d);
>  
> +#else
> +
> +static inline unsigned int mem_sharing_get_nr_saved_mfns(void)
> +{
> +    return 0;
> +}
> +static inline unsigned int mem_sharing_get_nr_shared_mfns(void)
> +{
> +    return 0;
> +}

I follow you for these.

> +static inline int mem_sharing_unshare_page(struct domain *d,
> +                                           unsigned long gfn,
> +                                           uint16_t flags)
> +{
> +    return 0;
> +}

But shouldn't this one (just as an example, there may be more
below) return -EOPNOTSUPP?

And in general - if these inline functions are needed, shouldn't
all of them (or at least some) gain ASSERT_UNREACHABLE(), as we
do elsewhere?

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.