All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ashish Kalra <Ashish.Kalra@amd.com>
To: <tglx@kernel.org>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
	<seanjc@google.com>, <peterz@infradead.org>,
	<thomas.lendacky@amd.com>, <herbert@gondor.apana.org.au>,
	<davem@davemloft.net>, <ardb@kernel.org>
Cc: <pbonzini@redhat.com>, <aik@amd.com>, <Michael.Roth@amd.com>,
	<KPrateek.Nayak@amd.com>, <Tycho.Andersen@amd.com>,
	<Nathan.Fontenot@amd.com>, <ackerleytng@google.com>,
	<jackyli@google.com>, <pgonda@google.com>, <rientjes@google.com>,
	<jacobhxu@google.com>, <nikunj@amd.com>,
	<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
	<linux-coco@lists.linux.dev>
Subject: [PATCH v2 0/2] x86/sev: Per-node RMPOPT windows for >2TB systems
Date: Mon, 30 Nov 2026 22:50:24 +0000	[thread overview]
Message-ID: <cover.1796076281.git.ashish.kalra@amd.com> (raw)

From: Ashish Kalra <ashish.kalra@amd.com>

RMPOPT_BASE is a per-core MSR whose optimization window covers at most 2 TB
of physical address space from its base.  The merged RMPOPT series programs
every core with the same base (start of RAM), so on a machine with more
than 2 TB of RAM only the first 2 TB is ever RMP-check-skipped; everything
above 2 TB pays full RMP checks for the life of the system.

This series extends the optimization across all of physical memory on >2 TB
systems by giving each NUMA node's cores a 2 TB window placed over that
node's own local memory.  A core overwhelmingly accesses its local node's
RAM, so spending each node's 2 TB budget on that memory puts the
optimization where the accesses land; whole-machine coverage is the union
of the per-node windows.  The <=2 TB case is unchanged: the window search
returns start-of-RAM for every node, so all cores share one window.

  Patch 1 generalizes the optimization scan to read each core's own
    RMPOPT_BASE (base and window size straight from the MSR) and walk only
    that window.  No behavioral change while every core shares one window.
  Patch 2 adds the per-node window selection and programming, and warms
    every window before the interrupts-disabled fan-out.

HW-validated on a ~3 TB 2-socket NPS2 box: every node optimizes its own
local memory and all populated memory is covered.

v2:
 - Classify each 1 GB region by its overlap with a NUMA node's pfn range
   rather than by its start pfn, so node 0's first GB -- whose start pfn is
   reserved -- is covered instead of dropped.  (Sashiko AI review)
 - Initialize the per-node warm-up work for all possible nodes rather than
   only the online ones.  (Sashiko AI review)
 - Rebased onto current tip/master, converting to the new rdmsrq()
   calling convention.

Ashish Kalra (2):
  x86/sev: Scan each core's own RMPOPT window
  x86/sev: Add per-node RMPOPT windows for >2TB systems

 arch/x86/include/asm/msr-index.h |   2 +
 arch/x86/virt/svm/sev.c          | 167 +++++++++++++++++++++++++++----
 2 files changed, 149 insertions(+), 20 deletions(-)


base-commit: 75b8262a97abcb972ef897dad5f94d425157b635
-- 
2.43.0


             reply	other threads:[~2026-11-30 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 22:50 Ashish Kalra [this message]
2026-11-30 22:50 ` [PATCH v2 1/2] x86/sev: Scan each core's own RMPOPT window Ashish Kalra
2026-11-30 22:51 ` [PATCH v2 2/2] x86/sev: Add per-node RMPOPT windows for >2TB systems Ashish Kalra

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=cover.1796076281.git.ashish.kalra@amd.com \
    --to=ashish.kalra@amd.com \
    --cc=KPrateek.Nayak@amd.com \
    --cc=Michael.Roth@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=Tycho.Andersen@amd.com \
    --cc=ackerleytng@google.com \
    --cc=aik@amd.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jackyli@google.com \
    --cc=jacobhxu@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pgonda@google.com \
    --cc=rientjes@google.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.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.