[PATCH 0/5] i386/cpu: Support APX for KVM

Zhao Liu posted 5 patches 2 days, 3 hours ago
Failed in applying to current master (apply log)
target/i386/cpu.c          | 68 ++++++++++++++++++++++++++++++++++++--
target/i386/cpu.h          | 26 +++++++++++++--
target/i386/machine.c      | 24 ++++++++++++++
target/i386/xsave_helper.c | 14 ++++++++
4 files changed, 128 insertions(+), 4 deletions(-)
[PATCH 0/5] i386/cpu: Support APX for KVM
Posted by Zhao Liu 2 days, 3 hours ago
Hi,

This series adds APX (Advanced Performance Extensions) support in QEMU
to enable APX in Guest based on KVM.

This series is based on CET v4:

https://lore.kernel.org/qemu-devel/20251118034231.704240-1-zhao1.liu@intel.com/

And you can also find the code here:

https://gitlab.com/zhao.liu/qemu/-/commits/i386-all-for-dmr-v1.1-11-17-2025

The patches for KVM side can be found at:

https://lore.kernel.org/kvm/20251110180131.28264-1-chang.seok.bae@intel.com/


Thanks for your review!


Overview
========

Intel Advanced Performance Extensions (Intel APX) expands the Intel 64
instruction set architecture with access to more registers (16
additional general-purpose registers (GPRs) R16–R31) and adds various
new features that improve general-purpose performance. The extensions
are designed to provide efficient performance gains across a variety of
workloads without significantly increasing silicon area or power
consumption of the core. 

APX spec link (rev.07) is:
https://cdrdv2.intel.com/v1/dl/getContent/861610

At QEMU side, the enabling work mainly includes two parts:

1. save/restore/migrate the xstate of APX.
   * APX xstate is a user xstate, but it reuses MPX xstate area in
     un-compacted XSAVE buffer.
   * To address this, QEMU will reject both APX and MPX if their CPUID
     feature bits are set at the same (in Patch 1).

2. add related CPUIDs support in feature words.

Thanks and Best Regards,
Zhao
---
Zhao Liu (2):
  i386/cpu: Support APX CPUIDs
  i386/cpu: Mark apx xstate as migratable

Zide Chen (3):
  i386/cpu: Add APX EGPRs into xsave area
  i386/cpu: Cache EGPRs in CPUX86State
  i386/cpu: Add APX migration support

 target/i386/cpu.c          | 68 ++++++++++++++++++++++++++++++++++++--
 target/i386/cpu.h          | 26 +++++++++++++--
 target/i386/machine.c      | 24 ++++++++++++++
 target/i386/xsave_helper.c | 14 ++++++++
 4 files changed, 128 insertions(+), 4 deletions(-)

-- 
2.34.1


Re: [PATCH 0/5] i386/cpu: Support APX for KVM
Posted by Paolo Bonzini 2 days, 1 hour ago
On Tue, Nov 18, 2025 at 7:36 AM Zhao Liu <zhao1.liu@intel.com> wrote:
>
> Hi,
>
> This series adds APX (Advanced Performance Extensions) support in QEMU
> to enable APX in Guest based on KVM.

Thanks for sending this out, I left some comments on the patch that
adds EGPRs but otherwise it's pretty simple---good.

Paolo

> This series is based on CET v4:
>
> https://lore.kernel.org/qemu-devel/20251118034231.704240-1-zhao1.liu@intel.com/
>
> And you can also find the code here:
>
> https://gitlab.com/zhao.liu/qemu/-/commits/i386-all-for-dmr-v1.1-11-17-2025
>
> The patches for KVM side can be found at:
>
> https://lore.kernel.org/kvm/20251110180131.28264-1-chang.seok.bae@intel.com/
>
>
> Thanks for your review!
>
>
> Overview
> ========
>
> Intel Advanced Performance Extensions (Intel APX) expands the Intel 64
> instruction set architecture with access to more registers (16
> additional general-purpose registers (GPRs) R16–R31) and adds various
> new features that improve general-purpose performance. The extensions
> are designed to provide efficient performance gains across a variety of
> workloads without significantly increasing silicon area or power
> consumption of the core.
>
> APX spec link (rev.07) is:
> https://cdrdv2.intel.com/v1/dl/getContent/861610
>
> At QEMU side, the enabling work mainly includes two parts:
>
> 1. save/restore/migrate the xstate of APX.
>    * APX xstate is a user xstate, but it reuses MPX xstate area in
>      un-compacted XSAVE buffer.
>    * To address this, QEMU will reject both APX and MPX if their CPUID
>      feature bits are set at the same (in Patch 1).
>
> 2. add related CPUIDs support in feature words.
>
> Thanks and Best Regards,
> Zhao
> ---
> Zhao Liu (2):
>   i386/cpu: Support APX CPUIDs
>   i386/cpu: Mark apx xstate as migratable
>
> Zide Chen (3):
>   i386/cpu: Add APX EGPRs into xsave area
>   i386/cpu: Cache EGPRs in CPUX86State
>   i386/cpu: Add APX migration support
>
>  target/i386/cpu.c          | 68 ++++++++++++++++++++++++++++++++++++--
>  target/i386/cpu.h          | 26 +++++++++++++--
>  target/i386/machine.c      | 24 ++++++++++++++
>  target/i386/xsave_helper.c | 14 ++++++++
>  4 files changed, 128 insertions(+), 4 deletions(-)
>
> --
> 2.34.1
>