[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/9] xen/x86: introduce a helper to update memory hotplug end
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Wei Chen <wei.chen@xxxxxxx>
- Date: Fri, 8 Jul 2022 22:54:16 +0800
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
- Arc-message-signature: i=2; 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=Aj9rrheaoXEduUj4KYU6olJZRmwgTRCWkOezbyAQ/9k=; b=CdX08dIF1t+OzPMGHOfbdHfGyX/WB7XI0H7VPs4LGHzao3EgfdIgDO6GhyIN2Gx+f9HPOmwWhTaGCsgnpZFGcmI4/1N51NXElhNFFyVHqJWu6xWL285IFEbvy2AdD4oD1rj9bDdn+YjhHGon6nVMmwppwldtJwmOSOXX0THTAZtx/hJAtg51P9FD87xXeHb1ZCP99npRwUCLSwPE5PNf9es0jFIGq1AM2OhXNemFEtS1S/ga/c0FHIIfpgS6+M++BAOgzsmuljOdqGRSb8ElRnQ1rmyw/5TV++tfbgj7bTA4227KQAYQH+3s9BKdEg4pUGP4wLtFrXTrm7yIAHVkDw==
- 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=Aj9rrheaoXEduUj4KYU6olJZRmwgTRCWkOezbyAQ/9k=; b=cJkgh39BvCfHn8c5CfEkcNtG850YgYxJZ2tkMVEX8ZaTeA+CHiNEi3lV16c7aVV2EaW1BdjnFpiCzAJ/EC3TIZ5DJYim3vNXO/QEW/195eq9KTPusszT+igTLZPiAji9XBDYYuvUkb7EvN7fgApXfInFShY1Sxq2vbAg2w5HQU8R9olgdPqq5vqTiZSDbUsNmk4B/vvwtjFTN7iS97/93nrp/NgCP9+tLCNKjH5QBKcE9WKogr+yNSQx3t2MIUgx7MY+hAgnbZiGTol6y/QrfIl2lHanG1/y11HQl+0Xh4uYjVbibMD1DgDryFcwHnlg4qXu9Omc8J4WwqnswoRygA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=dj1O6EmXJOY+M8DnRPih7/dBxbFEv5B3XYg7ujizs2fjCIqtb3LnzdsSVemnfBzHL6Yi9CNL0niHVaEiQ+zA0C12VO9rQuHFxSPA/ZuVGtyVuXp2mRxW9Ju8q54UcZspvolWq0128s3FTHI8h9SMHc2Nx4gUvcbIVfj/z4B9cqO8gpt+zZeXt87qPsEnwU4UjbDpc1MCg+t8rm7VGZdApPaRokMII/U1TWvck73DoZNckrbYotVa8tdNbrq7Aukg3Gd83cCClLuCY8bq3dBQEUpldNWr7k2rgwY6Yjf2/iUnaRazm5GOnv0n8YcbSImhwdqrJ9pW/k2SKS7h3UM3pg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i91Ow+/rBOw/ykikzC2hBDM1oCRvJLjx8E75C5oujeboLGSPZgbBDME85Bf5+FWUNy5ZhStPmt/dkaboWmymo7kbXycsUyZrQspZJkHch4r2vjKtpls0qwgmDgLIEOyX2U64r8ojQCuhFiL5L/fITZbLyfSo5asO4Ts1qThQKm5omcq8ur9GJJzpgWjul0MsRebxRa3kIigs7iQAfCefrw4/BA3b9UDZpgjTUkjpt1h9AJc4CfyLk7cx9KWvRJ8hS7h0gM5R+BDFbzC+UBvOYbBqEphPg0IIGtcjkHjkH4ORnlbTvRdsZesPV0zWoljb3I7zWN531iPG9j0iZ0uBrQ==
- Cc: <nd@xxxxxxx>, Wei Chen <wei.chen@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Fri, 08 Jul 2022 14:55:21 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
x86 provides a mem_hotplug variable to maintain the memory hotplug
end address. We want to move some codes from x86 to common, so that
it can be reused by other architectures. But not all architectures
have supported memory hotplug. So in this patch, we introduce this
helper to replace mem_hotplug direct access in these codes. This
will give the ability of stubbing this helper to those architectures
without memory hotplug support.
Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
v1 -> v2:
1. Refine the commit message.
2. Merge v1 patch#9,10 into one patch. Introduce the new functions
in the same patch that this patch will be used first time.
3. Fold if ( end > mem_hotplug ) to mem_hotplug_update_boundary,
in this case, we can drop mem_hotplug_boundary.
---
xen/arch/x86/include/asm/mm.h | 6 ++++++
xen/arch/x86/srat.c | 3 +--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 07b59c982b..b3dfbdb52b 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -476,6 +476,12 @@ 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)
+{
+ if ( end > mem_hotplug )
+ mem_hotplug = end;
+}
+
/******************************************************************************
* With shadow pagetables, the different kinds of address start
* to get get confusing.
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index b62a152911..f53431f5e8 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -418,8 +418,7 @@ acpi_numa_memory_affinity_init(const struct
acpi_srat_mem_affinity *ma)
memblk_nodeid[num_node_memblks] = node;
if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
__set_bit(num_node_memblks, memblk_hotplug);
- if (end > mem_hotplug)
- mem_hotplug = end;
+ mem_hotplug_update_boundary(end);
}
num_node_memblks++;
}
--
2.25.1
|