Commit 72f48a38 authored by Thomas Gleixner's avatar Thomas Gleixner

x86/apic: Reorganize struct apic

struct apic has just grown over time by adding function pointers in random
places. Reorganize it so it becomes more cache line friendly.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJuergen Gross <jgross@suse.com>
Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
Acked-by: default avatarJuergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20170913213153.913642524@linutronix.de
parent 83a10522
...@@ -274,73 +274,63 @@ struct irq_data; ...@@ -274,73 +274,63 @@ struct irq_data;
* James Cleverdon. * James Cleverdon.
*/ */
struct apic { struct apic {
char *name; /* Hotpath functions first */
void (*eoi_write)(u32 reg, u32 v);
int (*probe)(void); void (*native_eoi_write)(u32 reg, u32 v);
int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); void (*write)(u32 reg, u32 v);
int (*apic_id_valid)(int apicid); u32 (*read)(u32 reg);
int (*apic_id_registered)(void);
/* IPI related functions */
u32 irq_delivery_mode; void (*wait_icr_idle)(void);
u32 irq_dest_mode; u32 (*safe_wait_icr_idle)(void);
void (*send_IPI)(int cpu, int vector);
void (*send_IPI_mask)(const struct cpumask *mask, int vector);
void (*send_IPI_mask_allbutself)(const struct cpumask *msk, int vec);
void (*send_IPI_allbutself)(int vector);
void (*send_IPI_all)(int vector);
void (*send_IPI_self)(int vector);
/* dest_logical is used by the IPI functions */
u32 dest_logical;
u32 disable_esr;
u32 irq_delivery_mode;
u32 irq_dest_mode;
/* Functions and data related to vector allocation */
const struct cpumask *(*target_cpus)(void); const struct cpumask *(*target_cpus)(void);
void (*vector_allocation_domain)(int cpu, struct cpumask *retmask,
const struct cpumask *mask);
int (*cpu_mask_to_apicid)(const struct cpumask *cpumask,
struct irq_data *irqdata,
unsigned int *apicid);
int disable_esr; /* ICR related functions */
u64 (*icr_read)(void);
int dest_logical; void (*icr_write)(u32 low, u32 high);
bool (*check_apicid_used)(physid_mask_t *map, int apicid);
void (*vector_allocation_domain)(int cpu, struct cpumask *retmask,
const struct cpumask *mask);
void (*init_apic_ldr)(void);
void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
void (*setup_apic_routing)(void);
int (*cpu_present_to_apicid)(int mps_cpu);
void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
int (*check_phys_apicid_present)(int phys_apicid);
int (*phys_pkg_id)(int cpuid_apic, int index_msb);
unsigned int (*get_apic_id)(unsigned long x); /* Probe, setup and smpboot functions */
/* Can't be NULL on 64-bit */ int (*probe)(void);
u32 (*set_apic_id)(unsigned int id); int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
int (*apic_id_valid)(int apicid);
int (*apic_id_registered)(void);
int (*cpu_mask_to_apicid)(const struct cpumask *cpumask, bool (*check_apicid_used)(physid_mask_t *map, int apicid);
struct irq_data *irqdata, void (*init_apic_ldr)(void);
unsigned int *apicid); void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
void (*setup_apic_routing)(void);
int (*cpu_present_to_apicid)(int mps_cpu);
void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
int (*check_phys_apicid_present)(int phys_apicid);
int (*phys_pkg_id)(int cpuid_apic, int index_msb);
/* ipi */ u32 (*get_apic_id)(unsigned long x);
void (*send_IPI)(int cpu, int vector); u32 (*set_apic_id)(unsigned int id);
void (*send_IPI_mask)(const struct cpumask *mask, int vector);
void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
int vector);
void (*send_IPI_allbutself)(int vector);
void (*send_IPI_all)(int vector);
void (*send_IPI_self)(int vector);
/* wakeup_secondary_cpu */ /* wakeup_secondary_cpu */
int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
void (*inquire_remote_apic)(int apicid);
/* apic ops */ void (*inquire_remote_apic)(int apicid);
u32 (*read)(u32 reg);
void (*write)(u32 reg, u32 v);
/*
* ->eoi_write() has the same signature as ->write().
*
* Drivers can support both ->eoi_write() and ->write() by passing the same
* callback value. Kernel can override ->eoi_write() and fall back
* on write for EOI.
*/
void (*eoi_write)(u32 reg, u32 v);
void (*native_eoi_write)(u32 reg, u32 v);
u64 (*icr_read)(void);
void (*icr_write)(u32 low, u32 high);
void (*wait_icr_idle)(void);
u32 (*safe_wait_icr_idle)(void);
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* /*
...@@ -355,6 +345,7 @@ struct apic { ...@@ -355,6 +345,7 @@ struct apic {
*/ */
int (*x86_32_early_logical_apicid)(int cpu); int (*x86_32_early_logical_apicid)(int cpu);
#endif #endif
char *name;
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment