|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 4/8] x86/IDT: Rename idt_table[] to bsp_idt[]
On 24.02.2025 17:05, Andrew Cooper wrote:
> Having variables named idt_table[] and idt_tables[] is not ideal.
>
> Use X86_IDT_VECTORS and remove IDT_ENTRIES. State the size of bsp_idt[] in
> idt.h so that load_system_tables() and cpu_smpboot_alloc() can use sizeof()
> rather than opencoding the calculation.
>
> Move the variable into a new traps-init.c, to make a start at splitting
> traps.c in half.
Hmm, I'd expect a file of that name to contain only __init code/data, and
hence for it to be possible to ...
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -65,6 +65,7 @@ obj-y += spec_ctrl.o
> obj-y += srat.o
> obj-y += string.o
> obj-y += time.o
> +obj-y += traps-init.o
... use
obj-bin-y += traps-init.init.o
here.
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -831,7 +831,7 @@ void load_system_tables(void)
> };
> const struct desc_ptr idtr = {
> .base = (unsigned long)idt_tables[cpu],
> - .limit = (IDT_ENTRIES * sizeof(idt_entry_t)) - 1,
> + .limit = sizeof(bsp_idt) - 1,
> };
This ends up being odd: base address and size (limit) are taken from
different variables. Should we perhaps use ...
> --- a/xen/arch/x86/include/asm/idt.h
> +++ b/xen/arch/x86/include/asm/idt.h
> @@ -29,8 +29,7 @@ typedef union {
> };
> } idt_entry_t;
>
> -#define IDT_ENTRIES 256
> -extern idt_entry_t idt_table[];
> +extern idt_entry_t bsp_idt[X86_IDT_VECTORS];
> extern idt_entry_t *idt_tables[];
extern idt_entry_t (*idt_tables[])[X86_IDT_VECTORS];
and then sizeof(*idt_tables[cpu]) above? Of course we have quite a few uses
of idt_tables[], which all would then need adjusting for the additional
(abstract) level of indirection.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |