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

Re: [PATCH 09/37] xen/x86: introduce two helpers to access memory hotplug end


  • To: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 24 Jan 2022 17:24:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XJCpdDZul5aslzNFf+cOi/5hQjqSyEBcGBEvuVE1lGs=; b=jDC/M7HZusL7YjXhx4/4KNdltAZEKDuK72nK3eplq7MC3cYbQbuSqlP/nfcv5puP/r36ffl/Zgg2rGXzsEKfPaUmYDQzAl6fgPtF3JYsiVA4bovIVjbpyqQjKObOvUHHiqcMGauaLAq3tnhFqwrdQyKdOJxLIkiPZNnTHc8y74Qy4kcmcjHvCmVEOV5BPk2bR/hA8cBDaAPdfDugr4qcwrCJygj/i+Slz7g3ny/VT+ktg1eNpyi2JW2NmZiZLUwp1uE0uaxm4fktsduqq78ECTIn5ILG3H53LtOcu7mW/pp4WLeMCw0dcNmSD8BC133iW85MwPN2W6ko5vhf30BA3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hf/C3pk5uufXXxXCJOfVZEa+lArlCDfQgwsoR3Kr98Bin890kVAygXbfBNoZPvy63PfLpo+IfZaWB8slyxEkjhAGP+4Elt/kl05a9QH0AXmiod0vc90CO1oRNDtqG6zbvXmgHvYGa1gK+akheS4j2IMqOmiroaaUiIaObJymjUCHA6YfRYcp1B1FVxmhtMunVAOp4oPYJWr9m09L4TSKpBH1w81sLIb3fwXFKDNPnc7Jb6sf+gnrAB9np5IsCLDZkZaL88viB7WNXPnVYkGWqrcutmldOLKojH4Uulkz4Xjn3PIEUhoAOQCeQ6hxkrwrbg9gZun7nHVNZDr2OcUwjg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand.Marquis@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx
  • Delivery-date: Mon, 24 Jan 2022 16:25:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.09.2021 14:02, Wei Chen wrote:
> x86 provides a mem_hotplug to maintain the end of memory hotplug
> end address. This variable can be accessed out of mm.c. We want
> some code out of mm.c can be reused by other architectures without
> memory hotplug ability. So in this patch, we introduce these two
> helpers to replace mem_hotplug direct access. This will give the
> ability to stub these two API.
> 
> Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> ---
>  xen/include/asm-x86/mm.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
> index cb90527499..af2fc4b0cd 100644
> --- a/xen/include/asm-x86/mm.h
> +++ b/xen/include/asm-x86/mm.h
> @@ -475,6 +475,16 @@ static inline int get_page_and_type(struct page_info 
> *page,
>  
>  extern paddr_t mem_hotplug;
>  
> +static inline void mem_hotplug_update_boundary(paddr_t end)
> +{
> +    mem_hotplug = end;
> +}
> +
> +static inline paddr_t mem_hotplug_boundary(void)
> +{
> +    return mem_hotplug;
> +}
> +
>  
> /******************************************************************************
>   * With shadow pagetables, the different kinds of address start
>   * to get get confusing.

Imo for this to make sense you want to also use the new functions
right away in the place(s) where the direct access(es) get(s) in
your way.

Jan




 


Rackspace

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