Re: [PATCH v7 0/6] Introduce CET supervisor state support

From: Dave Hansen
Date: Fri May 16 2025 - 11:17:23 EST


On 5/16/25 00:51, Uros Bizjak wrote:
> I wonder if the same approach can be used to optimize switching of
> Intel PT configuration context. There was a patch series [1] posted
> some time ago that showed substantial reduction of overhead when
> switching Intel PT configuration context on VM-Entry/Exit using
> XSAVES/XRSTORS instructions:
>
> Manual save(rdmsr): ~334 cycles
> Manual restore(wrmsr): ~1668 cycles
>
> XSAVES insturction: ~124 cycles
> XRSTORS instruction: ~378 cycles

There's nothing stopping us from using XSAVES/XRSTORS for PT,
independent of the kernel FPU infrastructure. RFBM exists for a reason.

There's also WRMSRLIST which we're not using yet either. It's an even
better fit and doesn't have the goofiness that using XSAVE does like the
legacy portion of the save area including the header.