Re: [PATCH v2 3/7] x86/sev: add support for RMPOPT instruction

From: Dave Hansen

Date: Thu Mar 05 2026 - 14:40:51 EST


On 3/5/26 11:22, Kalra, Ashish wrote:
> But, these are the performance numbers you should be considering :
>
> RMPOPT during boot:
>
> [ 49.913402] SEV-SNP: RMPOPT largest cycles 1143020
> [ 49.913407] SEV-SNP: RMPOPT smallest cycles 60
> [ 49.913408] SEV-SNP: RMPOPT average cycles 5226
>
> RMPOPT after SNP guest shutdown:
>
> [ 276.435091] SEV-SNP: RMPOPT largest cycles 83680
> [ 276.435096] SEV-SNP: RMPOPT smallest cycles 60
> [ 276.435097] SEV-SNP: RMPOPT average cycles 5658

First of all, I'd really appreciate wall clock measurements on these.
It's just less math and guesswork. Cycles are easy to measure but hard
to read. Please make these easier to read. Also, the per-RMPOPT numbers
don't mean much. You have to scale it by the number of CPUs and memory
(or 2TB) to get to a real, useful number.

The thing that matters is how long this loop takes:

for (pa = pa_start; pa < pa_end; pa += PUD_SIZE)

and *especially* how long it takes per-cpu and when the system has a
full 2TB load of memory.

That will tell us how many resources this RMPOPT thing is going to take,
which is the _real_ thing we need to know.

Also, to some degree, the thing we care about here the *most* is the
worst case scenario. I think the worst possible case is that there's one
4k private page in each 1GB of memory, and that it's the last 4k page.
I'd like to see numbers for something close to *that*, not when there
are no private pages.

The two things you measured above are interesting, but they're only part
of the story.