NUMA node-specifc memory allocation: Difference between revisions

From Xen
Jump to navigationJump to search
(Created page with "__NOTOC__ {{sidebar | name = Content | outertitlestyle = text-align: left; | headingstyle = text-align: left; | contentstyle = text-align: left; | content1 = __TOC__ }} = NUMA node-specific memory allocation in X86 meminit_hvm() = == Entry point: <code>xenguest --mode hvm_build</code> == <code>xenguest --mode hvm_build</code>: It calls [https://github.com/xenserver-next/xen/blob/xenguest/tools/xenguest/xenguest.c#L499|<code>do_hvm_build()</code>], which cal...")
 
mNo edit summary
Line 23: Line 23:
== <code>hvm_build_setup_mem()</code> ==
== <code>hvm_build_setup_mem()</code> ==


- Gets <code>struct xc_dom_image *dom</code>, <code>max_mem_mib</code>, and <code>max_start_mib</code>.
* Gets <code>struct xc_dom_image *dom</code>, <code>max_mem_mib</code>, and <code>max_start_mib</code>.
- Calculates start and size of most parts of the domain’s memory maps
* Calculates start and size of most parts of the domain’s memory maps
- taking memory holes for I/O into account, e.g. <code>mmio_size</code> and <code>mmio_start</code>.
** taking memory holes for I/O into account, e.g. <code>mmio_size</code> and <code>mmio_start</code>.


- It then uses those to calculate <code>lowmem_end</code> and <code>highmem_end</code>.
* It then uses those to calculate <code>lowmem_end</code> and <code>highmem_end</code>.
- Finally, calls <code>xc_dom_boot_mem_init()</code>.
* Finally, calls <code>xc_dom_boot_mem_init()</code>.


== <code>xc_dom_boot_mem_init()</code> ==
== <code>xc_dom_boot_mem_init()</code> ==
Line 37: Line 37:


<syntaxhighlight lang="c">rc = dom->arch_hooks->meminit(dom);</syntaxhighlight>
<syntaxhighlight lang="c">rc = dom->arch_hooks->meminit(dom);</syntaxhighlight>



[[Category:NUMA]]
[[Category:NUMA]]

Revision as of 15:09, 30 January 2025

NUMA node-specific memory allocation in X86 meminit_hvm()

Entry point: xenguest --mode hvm_build

xenguest --mode hvm_build: It calls do_hvm_build(), which calls stub_xc_hvm_build().

stub_xc_hvm_build()

It starts the HVM/PVH domain creation by filling out the fields of struct flags and struct xc_dom_image and calls hvm_build_setup_mem().

hvm_build_setup_mem()

  • Gets struct xc_dom_image *dom, max_mem_mib, and max_start_mib.
  • Calculates start and size of most parts of the domain’s memory maps
    • taking memory holes for I/O into account, e.g. mmio_size and mmio_start.
  • It then uses those to calculate lowmem_end and highmem_end.
  • Finally, calls xc_dom_boot_mem_init().

xc_dom_boot_mem_init()

In all cases, xc_dom_boot_mem_init() is called.

It calls the architecture-specific meminit hook for the domain type:

rc = dom->arch_hooks->meminit(dom);