All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: George Dunlap <gwd@xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Teddy Astie" <teddy.astie@vates.tech>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 25/44] x86/mm: introduce a per-vCPU state window in the perdomain area
Date: Wed, 18 Nov 2026 12:51:19 +0100	[thread overview]
Message-ID: <ff3a75ce-acf1-4fd3-abfe-9835a27d694d@suse.com> (raw)
In-Reply-To: <20261103-asi-hvm-v6-25-59dbc5ce9615@xenproject.org>

On 03.11.2026 23:13, George Dunlap wrote:
> --- a/xen/arch/x86/include/asm/config.h
> +++ b/xen/arch/x86/include/asm/config.h
> @@ -158,7 +158,7 @@
>  /* Slot 260: per-domain mappings (including map cache). */
>  #define PERDOMAIN_VIRT_START    (PML4_ADDR(260))
>  #define PERDOMAIN_SLOT_MBYTES   (PML4_ENTRY_BYTES >> (20 + PAGETABLE_ORDER))
> -#define PERDOMAIN_SLOTS         3
> +#define PERDOMAIN_SLOTS         4
>  #define PERDOMAIN_VIRT_SLOT(s)  (PERDOMAIN_VIRT_START + (s) * \
>                                   (PERDOMAIN_SLOT_MBYTES << 20))
>  /* Slot 4: mirror of per-domain mappings (for compat xlat area accesses). */
> @@ -293,6 +293,25 @@ extern unsigned long xen_phys_start;
>  #define ARG_XLAT_START(v)        \
>      (ARG_XLAT_VIRT_START + ((v)->vcpu_id << ARG_XLAT_VA_SHIFT))
>  
> +/*
> + * Per-vCPU state window. The fourth per-domain-mapping sub-area: a small
> + * per-vCPU stride of page slots holding long-lived per-vCPU structures kept
> + * out of always-mapped memory, each mapped once for the life of the vCPU at
> + * a fixed index within the stride.
> + */
> +#define VCPU_STATE_SLOT          3
> +#define VCPU_STATE_VIRT_START    PERDOMAIN_VIRT_SLOT(VCPU_STATE_SLOT)
> +#define VCPU_STATE_ORDER         3

As long as this remains <= GDT_LDT_VCPU_SHIFT, it won't further constrain
MAX_VIRT_CPUS (primarily relevant to PV, when right here you cover HVM
stuff only, but anyway). Nevertheless I wonder whether ...

> +#define VCPU_STATE_NR_PAGES      (1U << VCPU_STATE_ORDER)
> +#define VCPU_STATE_VA_SHIFT      (VCPU_STATE_ORDER + PAGE_SHIFT)
> +#define VCPU_STATE_START(v)      \
> +    (VCPU_STATE_VIRT_START + ((v)->vcpu_id << VCPU_STATE_VA_SHIFT))
> +#define VCPU_STATE_ADDR(v, idx)  \
> +    (VCPU_STATE_START(v) + (idx) * PAGE_SIZE)
> +#define VCPU_STATE_IDX_VMCB      0
> +#define VCPU_STATE_IDX_N2VMCB    1
> +#define VCPU_STATE_IDX_VMX_MSR   2

... we wouldn't better conserve on space use from the very start: VMX_MSR
could re-use either of the other two slots.

Jan


  reply	other threads:[~2026-11-18 11:51 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 22:13 [PATCH v6 00/44] ASI: HVM through X4 George Dunlap
2026-11-03 22:13 ` [PATCH v6 01/44] x86/mm: allocate the per-domain L3 in arch_domain_create() George Dunlap
2026-11-04 10:46   ` Jan Beulich
2026-11-03 22:13 ` [PATCH v6 02/44] x86/mm: purge unneeded destroy_perdomain_mapping() George Dunlap
2026-11-03 22:13 ` [PATCH v6 03/44] x86/mm: prepare destroy_perdomain_mapping() for per-vCPU perdomain areas George Dunlap
2026-11-03 22:13 ` [PATCH v6 04/44] x86/domain_page: drop redundant create_perdomain_mapping() call George Dunlap
2026-11-03 22:13 ` [PATCH v6 05/44] x86/mm: prepare create_perdomain_mapping() for per-vCPU perdomain areas George Dunlap
2026-11-03 22:13 ` [PATCH v6 06/44] x86/spec-ctrl: introduce Address Space Isolation command line option George Dunlap
2026-11-03 22:13 ` [PATCH v6 07/44] x86/mm: have init_xen_l4_slots() take a vCPU in place of the domain George Dunlap
2026-11-03 22:13 ` [PATCH v6 08/44] x86/hvm: introduce per-vCPU L3 page-table George Dunlap
2026-11-03 22:13 ` [PATCH v6 09/44] x86/domain_page: drop redundant is_pv_vcpu() checks George Dunlap
2026-11-03 22:13 ` [PATCH v6 10/44] x86/domain_page: prepare the mapcache for per-vCPU accounting George Dunlap
2026-11-03 22:13 ` [PATCH v6 11/44] x86/domain_page: move struct mapcache_vcpu to struct arch_vcpu George Dunlap
2026-11-03 22:13 ` [PATCH v6 12/44] x86/domain_page: don't unmap a mapcache entry that is not present George Dunlap
2026-11-03 22:13 ` [PATCH v6 13/44] x86/hvm: introduce per-vCPU mapcache for vCPU-PT domains George Dunlap
2026-11-03 22:13 ` [PATCH v6 14/44] x86/mm: let Xen's page-table walker operate on a given root George Dunlap
2026-11-03 22:13 ` [PATCH v6 15/44] xen/gunzip: process pending softirqs once per deflate block George Dunlap
2026-11-18 11:56   ` Jan Beulich
2026-11-03 22:13 ` [PATCH v6 16/44] x86/mm: add hooks for a sparse view of the directmap George Dunlap
2026-11-03 22:13 ` [PATCH v6 17/44] x86/mm: build and maintain " George Dunlap
2026-11-03 22:13 ` [PATCH v6 18/44] x86/domain_page: key the directmap fast paths on the loaded view George Dunlap
2026-11-03 22:13 ` [PATCH v6 19/44] x86/domain_page: clear a mapcache slot at its last unmap George Dunlap
2026-11-03 22:13 ` [PATCH v6 20/44] x86/mm: run guest contexts on the sparse directmap view George Dunlap
2026-11-03 22:13 ` [PATCH v6 21/44] x86/spec-ctrl: wire the sparse directmap view into the asi= option George Dunlap
2026-11-03 22:13 ` [PATCH v6 22/44] xen/xmalloc: return an emptied region after dropping the pool lock George Dunlap
2026-11-18 12:05   ` Jan Beulich
2026-11-19 14:11     ` George Dunlap
2026-11-03 22:13 ` [PATCH v6 23/44] x86/mm: split a sparse directmap superpage with a page being freed George Dunlap
2026-11-03 22:13 ` [PATCH v6 24/44] x86/mm: introduce populate_perdomain_mapping() George Dunlap
2026-11-03 22:13 ` [PATCH v6 25/44] x86/mm: introduce a per-vCPU state window in the perdomain area George Dunlap
2026-11-18 11:51   ` Jan Beulich [this message]
2026-11-19 12:15     ` George Dunlap
2026-11-03 22:13 ` [PATCH v6 26/44] x86/svm: introduce SVM_MAP_VMCB() and SVM_UNMAP_VMCB() George Dunlap
2026-11-03 22:13 ` [PATCH v6 27/44] x86/svm: restore guest debug registers in svm_do_resume() George Dunlap
2026-11-03 22:13 ` [PATCH v6 28/44] x86/svm: drop svm_vmcb_dump()'s paddr George Dunlap
2026-11-18 11:54   ` Jan Beulich
2026-11-03 22:13 ` [PATCH v6 29/44] x86/svm: allocate VMCBs from the domain heap behind the vCPU state window George Dunlap
2026-11-03 22:13 ` [PATCH v6 30/44] x86/vmx: move the guest MSR load/save list off always-mapped memory George Dunlap
2026-11-03 22:13 ` [PATCH v6 31/44] x86: access a vCPU's saved register frame through map/unmap helpers George Dunlap
2026-11-03 22:13 ` [PATCH v6 32/44] x86: move the saved register frame behind the vCPU state window George Dunlap
2026-11-03 22:13 ` [PATCH v6 33/44] x86/hvm: move the emulator's operand caches " George Dunlap
2026-11-03 22:13 ` [PATCH v6 34/44] x86/hvm: clear the vCPU's copy of an emulated I/O request once consumed George Dunlap
2026-11-03 22:13 ` [PATCH v6 35/44] x86/domain_page: introduce map_domain_pages() George Dunlap
2026-11-03 22:13 ` [PATCH v6 36/44] x86/shadow: use map_domain_pages() for cross-page emulated writes George Dunlap
2026-11-03 22:13 ` [PATCH v6 37/44] x86/hvm: use map_domain_pages() for multi-frame emulated accesses George Dunlap
2026-11-03 22:14 ` [PATCH v6 38/44] x86/emulator: Refactor FXSAVE_AREA to use wrappers George Dunlap
2026-11-03 22:14 ` [PATCH v6 39/44] x86/mpx: Map/unmap xsave area in read_bndcfgu() George Dunlap
2026-11-03 22:14 ` [PATCH v6 40/44] x86/fpu: Pass explicit xsave areas to fpu_(f)xsave() George Dunlap
2026-11-03 22:14 ` [PATCH v6 41/44] x86/fpu: Pass explicit xsave areas to fpu_(f)xrstor() George Dunlap
2026-11-03 22:14 ` [PATCH v6 42/44] x86/xstate: classify xsave-area seam accesses by failure mode George Dunlap
2026-11-03 22:14 ` [PATCH v6 43/44] x86/domain: restore FPU state after switching to the new page tables George Dunlap
2026-11-03 22:14 ` [PATCH v6 44/44] x86/xstate: move guest XSAVE areas behind the vCPU state window George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff3a75ce-acf1-4fd3-abfe-9835a27d694d@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=gwd@xenproject.org \
    --cc=roger@xenproject.org \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.