[PATCH v2 0/5] x86/IDT: Generate the IDT at build time

Andrew Cooper posted 5 patches 4 days, 14 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250305000247.2772029-1-andrew.cooper3@citrix.com
xen/arch/x86/Makefile                  |   1 +
xen/arch/x86/cpu/common.c              |   7 +-
xen/arch/x86/crash.c                   |   8 +-
xen/arch/x86/domain.c                  |   2 +-
xen/arch/x86/hvm/svm/svm.c             |   4 +-
xen/arch/x86/hvm/vmx/vmcs.c            |   2 +-
xen/arch/x86/include/asm/gen-idt.h     | 122 +++++++++++++++++++++++++
xen/arch/x86/include/asm/gen-idt.lds.h |  27 ++++++
xen/arch/x86/include/asm/idt.h         |  22 +----
xen/arch/x86/include/asm/pv/traps.h    |   4 -
xen/arch/x86/machine_kexec.c           |   7 +-
xen/arch/x86/pv/traps.c                |  18 +---
xen/arch/x86/smpboot.c                 |  14 +--
xen/arch/x86/traps-setup.c             |   7 ++
xen/arch/x86/traps.c                   |  89 +-----------------
xen/arch/x86/x86_64/entry.S            | 106 ++++++++++++---------
xen/arch/x86/xen.lds.S                 |   2 +
17 files changed, 254 insertions(+), 188 deletions(-)
create mode 100644 xen/arch/x86/include/asm/gen-idt.h
create mode 100644 xen/arch/x86/include/asm/gen-idt.lds.h
create mode 100644 xen/arch/x86/traps-setup.c
[PATCH v2 0/5] x86/IDT: Generate the IDT at build time
Posted by Andrew Cooper 4 days, 14 hours ago
This is a chunk of the FRED work split out because it's pretty self contained.

It's mostly cleanup/refactoring, although patch

traps.c is already overly large and going to get larger with FRED, so I'm
splitting traps-setup.c out of it, as the two have reasonably-different logic.
That's implemented in this series but not used in anger in this series.

Since v1:
 * First 3 patches committed
 * Minor adjustments.  See individual patches for details

Andrew Cooper (5):
  x86/IDT: Rename idt_table[] to bsp_idt[]
  x86/IDT: Make idt_tables[] be per_cpu(idt)
  x86/IDT: Generate bsp_idt[] at build time
  x86/IDT: Don't rewrite bsp_idt[] at boot time
  x86/traps: Convert pv_trap_init() to being an initcall

 xen/arch/x86/Makefile                  |   1 +
 xen/arch/x86/cpu/common.c              |   7 +-
 xen/arch/x86/crash.c                   |   8 +-
 xen/arch/x86/domain.c                  |   2 +-
 xen/arch/x86/hvm/svm/svm.c             |   4 +-
 xen/arch/x86/hvm/vmx/vmcs.c            |   2 +-
 xen/arch/x86/include/asm/gen-idt.h     | 122 +++++++++++++++++++++++++
 xen/arch/x86/include/asm/gen-idt.lds.h |  27 ++++++
 xen/arch/x86/include/asm/idt.h         |  22 +----
 xen/arch/x86/include/asm/pv/traps.h    |   4 -
 xen/arch/x86/machine_kexec.c           |   7 +-
 xen/arch/x86/pv/traps.c                |  18 +---
 xen/arch/x86/smpboot.c                 |  14 +--
 xen/arch/x86/traps-setup.c             |   7 ++
 xen/arch/x86/traps.c                   |  89 +-----------------
 xen/arch/x86/x86_64/entry.S            | 106 ++++++++++++---------
 xen/arch/x86/xen.lds.S                 |   2 +
 17 files changed, 254 insertions(+), 188 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/gen-idt.h
 create mode 100644 xen/arch/x86/include/asm/gen-idt.lds.h
 create mode 100644 xen/arch/x86/traps-setup.c

-- 
2.39.5
Re: [PATCH v2 0/5] x86/IDT: Generate the IDT at build time
Posted by Jan Beulich 4 days ago
On 05.03.2025 01:02, Andrew Cooper wrote:
> This is a chunk of the FRED work split out because it's pretty self contained.
> 
> It's mostly cleanup/refactoring, although patch
> 
> traps.c is already overly large and going to get larger with FRED, so I'm
> splitting traps-setup.c out of it, as the two have reasonably-different logic.
> That's implemented in this series but not used in anger in this series.
> 
> Since v1:
>  * First 3 patches committed
>  * Minor adjustments.  See individual patches for details
> 
> Andrew Cooper (5):
>   x86/IDT: Rename idt_table[] to bsp_idt[]
>   x86/IDT: Make idt_tables[] be per_cpu(idt)
>   x86/IDT: Generate bsp_idt[] at build time
>   x86/IDT: Don't rewrite bsp_idt[] at boot time
>   x86/traps: Convert pv_trap_init() to being an initcall

For the two not having R-b already:
Acked-by: Jan Beulich <jbeulich@suse.com>
perhaps with patch 2's description slightly adjusted (see separate mail).

Jan