Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004 James Cleverdon, IBM. |
| 3 | * Subject to the GNU Public License, v.2 |
| 4 | * |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 5 | * Flat APIC subarch code. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * |
| 7 | * Hacked for x86-64 by James Cleverdon from i386 architecture code by |
| 8 | * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and |
| 9 | * James Cleverdon. |
| 10 | */ |
Andi Kleen | f19cccf | 2007-05-02 19:27:21 +0200 | [diff] [blame] | 11 | #include <linux/errno.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/threads.h> |
| 13 | #include <linux/cpumask.h> |
| 14 | #include <linux/string.h> |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/ctype.h> |
Suresh Siddha | 0c81c74 | 2008-07-10 11:16:48 -0700 | [diff] [blame] | 17 | #include <linux/hardirq.h> |
Paul Gortmaker | 186f436 | 2016-07-13 20:18:56 -0400 | [diff] [blame] | 18 | #include <linux/export.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <asm/smp.h> |
Ingo Molnar | 7b6aa33 | 2009-02-17 13:58:15 +0100 | [diff] [blame] | 20 | #include <asm/apic.h> |
Yinghai Lu | c1eeb2d | 2009-02-16 23:02:14 -0800 | [diff] [blame] | 21 | #include <asm/ipi.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
Lv Zheng | 8b48463 | 2013-12-03 08:49:16 +0800 | [diff] [blame] | 23 | #include <linux/acpi.h> |
Yinghai Lu | 1b9b89e | 2008-07-21 22:08:21 -0700 | [diff] [blame] | 24 | |
Suresh Siddha | 1a8880a | 2011-05-20 17:51:20 -0700 | [diff] [blame] | 25 | static struct apic apic_physflat; |
| 26 | static struct apic apic_flat; |
| 27 | |
Kees Cook | 404f6aa | 2016-08-08 16:29:06 -0700 | [diff] [blame] | 28 | struct apic *apic __ro_after_init = &apic_flat; |
Suresh Siddha | 1a8880a | 2011-05-20 17:51:20 -0700 | [diff] [blame] | 29 | EXPORT_SYMBOL_GPL(apic); |
| 30 | |
Marcin Slusarz | 983f91f | 2008-10-12 11:44:08 +0200 | [diff] [blame] | 31 | static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
Yinghai Lu | 1b9b89e | 2008-07-21 22:08:21 -0700 | [diff] [blame] | 32 | { |
| 33 | return 1; |
| 34 | } |
| 35 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | /* |
| 37 | * Set up the logical destination ID. |
| 38 | * |
| 39 | * Intel recommends to set DFR, LDR and TPR before enabling |
| 40 | * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel |
| 41 | * document number 292116). So here it goes... |
| 42 | */ |
Daniel J Blueman | 9a0ebfb | 2011-12-05 16:20:36 +0800 | [diff] [blame] | 43 | void flat_init_apic_ldr(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | { |
| 45 | unsigned long val; |
| 46 | unsigned long num, id; |
| 47 | |
| 48 | num = smp_processor_id(); |
| 49 | id = 1UL << num; |
Andi Kleen | eddfb4e | 2005-09-12 18:49:23 +0200 | [diff] [blame] | 50 | apic_write(APIC_DFR, APIC_DFR_FLAT); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; |
| 52 | val |= SET_APIC_LOGICAL_ID(id); |
Andi Kleen | eddfb4e | 2005-09-12 18:49:23 +0200 | [diff] [blame] | 53 | apic_write(APIC_LDR, val); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Denys Vlasenko | fe2f954 | 2016-03-06 19:11:16 +0100 | [diff] [blame] | 56 | static void _flat_send_IPI_mask(unsigned long mask, int vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | unsigned long flags; |
| 59 | |
Fernando Luis Vázquez Cao | 2b94ab2 | 2006-09-26 10:52:33 +0200 | [diff] [blame] | 60 | local_irq_save(flags); |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 61 | __default_send_IPI_dest_field(mask, vector, apic->dest_logical); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | local_irq_restore(flags); |
| 63 | } |
| 64 | |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 65 | static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector) |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 66 | { |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 67 | unsigned long mask = cpumask_bits(cpumask)[0]; |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 68 | |
| 69 | _flat_send_IPI_mask(mask, vector); |
| 70 | } |
| 71 | |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 72 | static void |
Alexander Gordeev | 49d0c7a | 2012-06-05 13:23:15 +0200 | [diff] [blame] | 73 | flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector) |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 74 | { |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 75 | unsigned long mask = cpumask_bits(cpumask)[0]; |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 76 | int cpu = smp_processor_id(); |
| 77 | |
| 78 | if (cpu < BITS_PER_LONG) |
| 79 | clear_bit(cpu, &mask); |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 80 | |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 81 | _flat_send_IPI_mask(mask, vector); |
| 82 | } |
| 83 | |
Ashok Raj | 884d9e4 | 2005-06-25 14:55:02 -0700 | [diff] [blame] | 84 | static void flat_send_IPI_allbutself(int vector) |
| 85 | { |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 86 | int cpu = smp_processor_id(); |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 87 | #ifdef CONFIG_HOTPLUG_CPU |
| 88 | int hotplug = 1; |
Ashok Raj | fdf26d9 | 2005-09-09 13:01:52 -0700 | [diff] [blame] | 89 | #else |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 90 | int hotplug = 0; |
Ashok Raj | fdf26d9 | 2005-09-09 13:01:52 -0700 | [diff] [blame] | 91 | #endif |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 92 | if (hotplug || vector == NMI_VECTOR) { |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 93 | if (!cpumask_equal(cpu_online_mask, cpumask_of(cpu))) { |
| 94 | unsigned long mask = cpumask_bits(cpu_online_mask)[0]; |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 95 | |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 96 | if (cpu < BITS_PER_LONG) |
| 97 | clear_bit(cpu, &mask); |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 98 | |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 99 | _flat_send_IPI_mask(mask, vector); |
| 100 | } |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 101 | } else if (num_online_cpus() > 1) { |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 102 | __default_send_IPI_shortcut(APIC_DEST_ALLBUT, |
| 103 | vector, apic->dest_logical); |
Keith Owens | e77deac | 2006-06-26 13:59:56 +0200 | [diff] [blame] | 104 | } |
Ashok Raj | 884d9e4 | 2005-06-25 14:55:02 -0700 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | static void flat_send_IPI_all(int vector) |
| 108 | { |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 109 | if (vector == NMI_VECTOR) { |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 110 | flat_send_IPI_mask(cpu_online_mask, vector); |
Ingo Molnar | dac5f41 | 2009-01-28 15:42:24 +0100 | [diff] [blame] | 111 | } else { |
| 112 | __default_send_IPI_shortcut(APIC_DEST_ALLINC, |
| 113 | vector, apic->dest_logical); |
| 114 | } |
Ashok Raj | 884d9e4 | 2005-06-25 14:55:02 -0700 | [diff] [blame] | 115 | } |
| 116 | |
Ingo Molnar | ca6c8ed | 2009-01-28 14:08:38 +0100 | [diff] [blame] | 117 | static unsigned int flat_get_apic_id(unsigned long x) |
Yinghai Lu | f910a9d | 2008-07-12 01:01:20 -0700 | [diff] [blame] | 118 | { |
Masahiro Yamada | f148b41 | 2016-09-11 14:58:21 +0900 | [diff] [blame] | 119 | return (x >> 24) & 0xFF; |
Yinghai Lu | f910a9d | 2008-07-12 01:01:20 -0700 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | static unsigned long set_apic_id(unsigned int id) |
| 123 | { |
Masahiro Yamada | f148b41 | 2016-09-11 14:58:21 +0900 | [diff] [blame] | 124 | return (id & 0xFF) << 24; |
Yinghai Lu | f910a9d | 2008-07-12 01:01:20 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Suresh Siddha | 0c81c74 | 2008-07-10 11:16:48 -0700 | [diff] [blame] | 127 | static unsigned int read_xapic_id(void) |
| 128 | { |
Masahiro Yamada | f148b41 | 2016-09-11 14:58:21 +0900 | [diff] [blame] | 129 | return flat_get_apic_id(apic_read(APIC_ID)); |
Suresh Siddha | 0c81c74 | 2008-07-10 11:16:48 -0700 | [diff] [blame] | 130 | } |
| 131 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | static int flat_apic_id_registered(void) |
| 133 | { |
Suresh Siddha | 0c81c74 | 2008-07-10 11:16:48 -0700 | [diff] [blame] | 134 | return physid_isset(read_xapic_id(), phys_cpu_present_map); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | } |
| 136 | |
Ingo Molnar | d4c9a9f | 2009-01-28 13:31:22 +0100 | [diff] [blame] | 137 | static int flat_phys_pkg_id(int initial_apic_id, int index_msb) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | { |
Yinghai Lu | 2759c32 | 2009-05-15 13:05:16 -0700 | [diff] [blame] | 139 | return initial_apic_id >> index_msb; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | } |
| 141 | |
Yinghai Lu | e8524b2 | 2011-12-21 17:45:15 -0800 | [diff] [blame] | 142 | static int flat_probe(void) |
| 143 | { |
| 144 | return 1; |
| 145 | } |
| 146 | |
Kees Cook | 404f6aa | 2016-08-08 16:29:06 -0700 | [diff] [blame] | 147 | static struct apic apic_flat __ro_after_init = { |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 148 | .name = "flat", |
Yinghai Lu | e8524b2 | 2011-12-21 17:45:15 -0800 | [diff] [blame] | 149 | .probe = flat_probe, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 150 | .acpi_madt_oem_check = flat_acpi_madt_oem_check, |
Daniel J Blueman | fa63030 | 2012-03-14 15:17:34 +0800 | [diff] [blame] | 151 | .apic_id_valid = default_apic_id_valid, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 152 | .apic_id_registered = flat_apic_id_registered, |
| 153 | |
Ingo Molnar | f8987a1 | 2009-01-28 04:02:31 +0100 | [diff] [blame] | 154 | .irq_delivery_mode = dest_LowestPrio, |
Ingo Molnar | 0b06e73 | 2009-01-28 05:13:04 +0100 | [diff] [blame] | 155 | .irq_dest_mode = 1, /* logical */ |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 156 | |
Alexander Gordeev | bf721d3 | 2012-06-05 13:23:29 +0200 | [diff] [blame] | 157 | .target_cpus = online_target_cpus, |
Ingo Molnar | 08125d3 | 2009-01-28 05:08:44 +0100 | [diff] [blame] | 158 | .disable_esr = 0, |
Ingo Molnar | bdb1a9b | 2009-01-28 05:29:25 +0100 | [diff] [blame] | 159 | .dest_logical = APIC_DEST_LOGICAL, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 160 | .check_apicid_used = NULL, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 161 | |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 162 | .vector_allocation_domain = flat_vector_allocation_domain, |
| 163 | .init_apic_ldr = flat_init_apic_ldr, |
| 164 | |
| 165 | .ioapic_phys_id_map = NULL, |
| 166 | .setup_apic_routing = NULL, |
Ingo Molnar | a21769a4 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 167 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 168 | .apicid_to_cpu_present = NULL, |
Ingo Molnar | a27a621 | 2009-01-28 12:43:18 +0100 | [diff] [blame] | 169 | .check_phys_apicid_present = default_check_phys_apicid_present, |
Ingo Molnar | d4c9a9f | 2009-01-28 13:31:22 +0100 | [diff] [blame] | 170 | .phys_pkg_id = flat_phys_pkg_id, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 171 | |
Ingo Molnar | ca6c8ed | 2009-01-28 14:08:38 +0100 | [diff] [blame] | 172 | .get_apic_id = flat_get_apic_id, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 173 | .set_apic_id = set_apic_id, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 174 | |
Thomas Gleixner | 91cd9cb | 2017-06-20 01:37:43 +0200 | [diff] [blame] | 175 | .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 176 | |
Thomas Gleixner | 6153058 | 2015-11-04 22:57:08 +0000 | [diff] [blame] | 177 | .send_IPI = default_send_IPI_single, |
Ingo Molnar | f2f05ee | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 178 | .send_IPI_mask = flat_send_IPI_mask, |
| 179 | .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, |
| 180 | .send_IPI_allbutself = flat_send_IPI_allbutself, |
| 181 | .send_IPI_all = flat_send_IPI_all, |
| 182 | .send_IPI_self = apic_send_IPI_self, |
| 183 | |
Yinghai Lu | 08d63b1 | 2009-04-08 08:00:01 -0700 | [diff] [blame] | 184 | .inquire_remote_apic = default_inquire_remote_apic, |
Yinghai Lu | c1eeb2d | 2009-02-16 23:02:14 -0800 | [diff] [blame] | 185 | |
| 186 | .read = native_apic_mem_read, |
| 187 | .write = native_apic_mem_write, |
Michael S. Tsirkin | 2a43195 | 2012-05-16 19:03:52 +0300 | [diff] [blame] | 188 | .eoi_write = native_apic_mem_write, |
Yinghai Lu | c1eeb2d | 2009-02-16 23:02:14 -0800 | [diff] [blame] | 189 | .icr_read = native_apic_icr_read, |
| 190 | .icr_write = native_apic_icr_write, |
| 191 | .wait_icr_idle = native_apic_wait_icr_idle, |
| 192 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | }; |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 194 | |
| 195 | /* |
Jasper Spaans | e34b700 | 2009-11-20 14:20:05 +0100 | [diff] [blame] | 196 | * Physflat mode is used when there are more than 8 CPUs on a system. |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 197 | * We cannot use logical delivery in this case because the mask |
| 198 | * overflows, so use physical mode. |
| 199 | */ |
Marcin Slusarz | fae17216 | 2008-10-12 11:44:09 +0200 | [diff] [blame] | 200 | static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
Yinghai Lu | 1b9b89e | 2008-07-21 22:08:21 -0700 | [diff] [blame] | 201 | { |
| 202 | #ifdef CONFIG_ACPI |
| 203 | /* |
| 204 | * Quirk: some x86_64 machines can only use physical APIC mode |
| 205 | * regardless of how many processors are present (x86_64 ES7000 |
| 206 | * is an example). |
| 207 | */ |
Yinghai Lu | 61fe91e | 2009-05-09 23:47:42 -0700 | [diff] [blame] | 208 | if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID && |
Yinghai Lu | 02c1df1 | 2008-09-04 20:57:11 +0200 | [diff] [blame] | 209 | (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) { |
| 210 | printk(KERN_DEBUG "system APIC only can use physical flat"); |
Yinghai Lu | 1b9b89e | 2008-07-21 22:08:21 -0700 | [diff] [blame] | 211 | return 1; |
Yinghai Lu | 02c1df1 | 2008-09-04 20:57:11 +0200 | [diff] [blame] | 212 | } |
Suresh Siddha | dfea91d | 2010-01-18 12:10:48 -0800 | [diff] [blame] | 213 | |
| 214 | if (!strncmp(oem_id, "IBM", 3) && !strncmp(oem_table_id, "EXA", 3)) { |
| 215 | printk(KERN_DEBUG "IBM Summit detected, will use apic physical"); |
| 216 | return 1; |
| 217 | } |
Yinghai Lu | 1b9b89e | 2008-07-21 22:08:21 -0700 | [diff] [blame] | 218 | #endif |
| 219 | |
| 220 | return 0; |
| 221 | } |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 222 | |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 223 | static void physflat_send_IPI_allbutself(int vector) |
| 224 | { |
Yinghai Lu | 43f3989 | 2009-01-29 19:31:49 -0800 | [diff] [blame] | 225 | default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector); |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | static void physflat_send_IPI_all(int vector) |
| 229 | { |
Thomas Gleixner | 449112f | 2015-11-04 22:57:02 +0000 | [diff] [blame] | 230 | default_send_IPI_mask_sequence_phys(cpu_online_mask, vector); |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 231 | } |
| 232 | |
Suresh Siddha | 9ebd680 | 2011-05-19 16:45:46 -0700 | [diff] [blame] | 233 | static int physflat_probe(void) |
| 234 | { |
| 235 | if (apic == &apic_physflat || num_possible_cpus() > 8) |
| 236 | return 1; |
| 237 | |
| 238 | return 0; |
| 239 | } |
| 240 | |
Kees Cook | 404f6aa | 2016-08-08 16:29:06 -0700 | [diff] [blame] | 241 | static struct apic apic_physflat __ro_after_init = { |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 242 | |
| 243 | .name = "physical flat", |
Suresh Siddha | 9ebd680 | 2011-05-19 16:45:46 -0700 | [diff] [blame] | 244 | .probe = physflat_probe, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 245 | .acpi_madt_oem_check = physflat_acpi_madt_oem_check, |
Daniel J Blueman | fa63030 | 2012-03-14 15:17:34 +0800 | [diff] [blame] | 246 | .apic_id_valid = default_apic_id_valid, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 247 | .apic_id_registered = flat_apic_id_registered, |
| 248 | |
Ingo Molnar | f8987a1 | 2009-01-28 04:02:31 +0100 | [diff] [blame] | 249 | .irq_delivery_mode = dest_Fixed, |
Ingo Molnar | 0b06e73 | 2009-01-28 05:13:04 +0100 | [diff] [blame] | 250 | .irq_dest_mode = 0, /* physical */ |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 251 | |
Alexander Gordeev | bf721d3 | 2012-06-05 13:23:29 +0200 | [diff] [blame] | 252 | .target_cpus = online_target_cpus, |
Ingo Molnar | 08125d3 | 2009-01-28 05:08:44 +0100 | [diff] [blame] | 253 | .disable_esr = 0, |
Ingo Molnar | bdb1a9b | 2009-01-28 05:29:25 +0100 | [diff] [blame] | 254 | .dest_logical = 0, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 255 | .check_apicid_used = NULL, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 256 | |
Alexander Gordeev | 9d8e106 | 2012-06-07 15:14:49 +0200 | [diff] [blame] | 257 | .vector_allocation_domain = default_vector_allocation_domain, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 258 | /* not needed, but shouldn't hurt: */ |
| 259 | .init_apic_ldr = flat_init_apic_ldr, |
| 260 | |
| 261 | .ioapic_phys_id_map = NULL, |
| 262 | .setup_apic_routing = NULL, |
Ingo Molnar | a21769a4 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 263 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 264 | .apicid_to_cpu_present = NULL, |
Ingo Molnar | a27a621 | 2009-01-28 12:43:18 +0100 | [diff] [blame] | 265 | .check_phys_apicid_present = default_check_phys_apicid_present, |
Ingo Molnar | d4c9a9f | 2009-01-28 13:31:22 +0100 | [diff] [blame] | 266 | .phys_pkg_id = flat_phys_pkg_id, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 267 | |
Ingo Molnar | ca6c8ed | 2009-01-28 14:08:38 +0100 | [diff] [blame] | 268 | .get_apic_id = flat_get_apic_id, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 269 | .set_apic_id = set_apic_id, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 270 | |
Thomas Gleixner | 91cd9cb | 2017-06-20 01:37:43 +0200 | [diff] [blame] | 271 | .cpu_mask_to_apicid = default_cpu_mask_to_apicid, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 272 | |
Thomas Gleixner | 68cd88f | 2015-11-04 22:57:02 +0000 | [diff] [blame] | 273 | .send_IPI = default_send_IPI_single_phys, |
Thomas Gleixner | 449112f | 2015-11-04 22:57:02 +0000 | [diff] [blame] | 274 | .send_IPI_mask = default_send_IPI_mask_sequence_phys, |
| 275 | .send_IPI_mask_allbutself = default_send_IPI_mask_allbutself_phys, |
Ingo Molnar | 4c3e51e | 2009-01-28 02:37:01 +0100 | [diff] [blame] | 276 | .send_IPI_allbutself = physflat_send_IPI_allbutself, |
| 277 | .send_IPI_all = physflat_send_IPI_all, |
| 278 | .send_IPI_self = apic_send_IPI_self, |
| 279 | |
Yinghai Lu | 08d63b1 | 2009-04-08 08:00:01 -0700 | [diff] [blame] | 280 | .inquire_remote_apic = default_inquire_remote_apic, |
Yinghai Lu | c1eeb2d | 2009-02-16 23:02:14 -0800 | [diff] [blame] | 281 | |
| 282 | .read = native_apic_mem_read, |
| 283 | .write = native_apic_mem_write, |
Michael S. Tsirkin | 2a43195 | 2012-05-16 19:03:52 +0300 | [diff] [blame] | 284 | .eoi_write = native_apic_mem_write, |
Yinghai Lu | c1eeb2d | 2009-02-16 23:02:14 -0800 | [diff] [blame] | 285 | .icr_read = native_apic_icr_read, |
| 286 | .icr_write = native_apic_icr_write, |
| 287 | .wait_icr_idle = native_apic_wait_icr_idle, |
| 288 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
Andi Kleen | f8d3119 | 2005-07-28 21:15:42 -0700 | [diff] [blame] | 289 | }; |
Suresh Siddha | 107e0e0 | 2011-05-20 17:51:17 -0700 | [diff] [blame] | 290 | |
| 291 | /* |
| 292 | * We need to check for physflat first, so this order is important. |
| 293 | */ |
| 294 | apic_drivers(apic_physflat, apic_flat); |