1. 29 1月, 2009 10 次提交
    • I
      x86, apic: clean up check_apicid*() callbacks · d1d7cae8
      Ingo Molnar 提交于
      Clean up these methods - to make it clearer which function is
      used in which case.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d1d7cae8
    • I
      x86: clean up the APIC_DEST_LOGICAL logic · 0b06e734
      Ingo Molnar 提交于
      Impact: cleanup
      
      The bigsmp and es7000 subarchitectures un-defined APIC_DEST_LOGICAL in
      a rather nasty way by re-defining it to zero. That is infinitely
      fragile and makes it very hard to see what to code really does in
      a given context. The very same constant has different meanings and
      values - depending on which subarch is enabled.
      
      Untangle this mess by never undefining the constant, but instead
      propagating the right values into the genapic driver templates.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0b06e734
    • I
      x86: clean up esr_disable() methods · f6f52baf
      Ingo Molnar 提交于
      Impact: cleanup
      
      Most subarchitectures want to disable the APIC ESR (Error Status Register),
      because they generally have hardware hacks that wrap standard CPUs into
      a bigger system and hence the APIC bus is quite non-standard and weirdnesses
      (lockups) have been seen with ESR reporting.
      
      Remove the esr_disable macros and put the desired flag into each
      subarchitecture's genapic template directly.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f6f52baf
    • I
      x86, apic: clean up / remove TARGET_CPUS · fe402e1f
      Ingo Molnar 提交于
      Impact: cleanup
      
      use apic->target_cpus() directly instead of the TARGET_CPUS wrapper.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fe402e1f
    • I
      x86, apic: clean up target_cpus methods · 0a9cc20b
      Ingo Molnar 提交于
      Impact: cleanup
      
      Clean up all the target_cpus() namespace overlap that exists
      between bigsmp, es7000, mach-default, numaq and summit - by
      separating the different functions into different names.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0a9cc20b
    • I
      x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE · 38bd77a6
      Ingo Molnar 提交于
      Impact: cleanup
      
      They were only used in a single place and obscured the apic_es7000
      driver template.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      38bd77a6
    • I
      x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE · 9b5bc8dc
      Ingo Molnar 提交于
      Remove the wrapper macros IRQ_DEST_MODE and IRQ_DELIVERY_MODE.
      
      The typical 32-bit and the 64-bit build all dereference via the genapic,
      so it's pointless to hide that indirection via these ugly macros.
      
      Furthermore, it also obscures subarchitecture details.
      
      So replace it with apic->irq_dest_mode / etc. accesses.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9b5bc8dc
    • I
      x86, genapic: rename int_delivery_mode, et. al. · f8987a10
      Ingo Molnar 提交于
      int_delivery_mode is supposed to mean 'interrupt delivery mode', but
      it's quite a misnomer as 'int' we usually think of as an integer type ...
      
      The standard naming for such attributes is 'irq' - so rename the following
      fields and macros:
      
       int_delivery_mode => irq_delivery_mode
       INT_DELIVERY_MODE => IRQ_DELIVERY_MODE
       int_dest_mode     => irq_dest_mode
       INT_DEST_MODE     => IRQ_DEST_MODE
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f8987a10
    • I
      x86: clean up apic->apic_id_registered() methods · 7ed248da
      Ingo Molnar 提交于
      Impact: cleanup
      
      x86 subarchitectures each defined a "apic_id_registered()" method,
      which could be an inline function depending on which subarch we build
      for, and which was also the name of a genapic field.
      
      Untangle this namespace spaghetti by giving each of the instances
      a separate name.
      
      Also remove wrapper macro obfuscation.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7ed248da
    • I
      x86: clean up apic->acpi_madt_oem_check methods · 306db03b
      Ingo Molnar 提交于
      Impact: refactor code
      
      x86 subarchitectures each defined a "acpi_madt_oem_check()" method,
      which could be an inline function, or an extern, or a static function,
      and which was also the name of a genapic field.
      
      Untangle this namespace spaghetti by setting ->acpi_madt_oem_check()
      to NULL on those subarchitectures that have no detection quirks,
      and rename the other ones (summit, es7000) that do.
      
      Also change default_acpi_madt_oem_check() to handle NULL entries,
      and clean its control flow up as well.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      306db03b
  2. 06 1月, 2009 1 次提交
  3. 04 1月, 2009 2 次提交
  4. 18 12月, 2008 1 次提交
    • M
      x86: fix cpu_mask_to_apicid_and to include cpu_online_mask · a775a38b
      Mike Travis 提交于
      Impact: fix potential APIC crash
      
      In determining the destination apicid, there are usually three cpumasks
      that are considered: the incoming cpumask arg, cfg->domain and the
      cpu_online_mask.  Since we are just introducing the cpu_mask_to_apicid_and
      function, make sure it includes the cpu_online_mask in it's evaluation.
      [Added with this patch.]
      
      There are two io_apic.c functions that did not previously use the
      cpu_online_mask:  setup_IO_APIC_irq and msi_compose_msg.  Both of these
      simply used cpu_mask_to_apicid(cfg->domain & TARGET_CPUS), and all but
      one arch (NUMAQ[*]) returns only online cpus in the TARGET_CPUS mask,
      so the behavior is identical for all cases.
      
      [*: NUMAQ bug?]
      
      Note that alloc_cpumask_var is only used for the 32-bit cases where
      it's highly likely that the cpumask set size will be small and therefore
      CPUMASK_OFFSTACK=n.  But if that's not the case, failing the allocate
      will cause the same return value as the default.
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a775a38b
  5. 17 12月, 2008 4 次提交
  6. 19 11月, 2008 1 次提交
  7. 18 11月, 2008 1 次提交
    • Y
      x86: fix wakeup_cpu with numaq/es7000, v2 · 569712b2
      Yinghai Lu 提交于
      Impact: fix secondary-CPU wakeup/init path with numaq and es7000
      
      While looking at wakeup_secondary_cpu for WAKE_SECONDARY_VIA_NMI:
      
      |#ifdef WAKE_SECONDARY_VIA_NMI
      |/*
      | * Poke the other CPU in the eye via NMI to wake it up. Remember that the normal
      | * INIT, INIT, STARTUP sequence will reset the chip hard for us, and this
      | * won't ... remember to clear down the APIC, etc later.
      | */
      |static int __devinit
      |wakeup_secondary_cpu(int logical_apicid, unsigned long start_eip)
      |{
      |        unsigned long send_status, accept_status = 0;
      |        int maxlvt;
      |...
      |        if (APIC_INTEGRATED(apic_version[phys_apicid])) {
      |                maxlvt = lapic_get_maxlvt();
      
      I noticed that there is no warning about undefined phys_apicid...
      
      because WAKE_SECONDARY_VIA_NMI and WAKE_SECONDARY_VIA_INIT can not be
      defined at the same time. So NUMAQ is using wrong wakeup_secondary_cpu.
      
      WAKE_SECONDARY_VIA_NMI, WAKE_SECONDARY_VIA_INIT and
      WAKE_SECONDARY_VIA_MIP are variants of a weird and fragile
      preprocessor-driven "HAL" mechanisms to specify the kind of secondary-CPU
      wakeup strategy a given x86 kernel will use.
      
      The vast majority of systems want to use INIT for secondary wakeup - NUMAQ
      uses an NMI, (old-style-) ES7000 uses 'MIP' (a firmware driven in-memory
      flag to let secondaries continue).
      
      So convert these mechanisms to x86_quirks and add a
      ->wakeup_secondary_cpu() method to specify the rare exception
      to the sane default.
      
      Extend genapic accordingly as well, for 32-bit.
      
      While looking further, I noticed that functions in wakecup.h for numaq
      and es7000 are different to the default in mach_wakecpu.h - but smpboot.c
      will only use default mach_wakecpu.h with smphook.h.
      
      So we need to add mach_wakecpu.h for mach_generic, to properly support
      numaq and es7000, and vectorize the following SMP init methods:
      
      	int trampoline_phys_low;
      	int trampoline_phys_high;
      	void (*wait_for_init_deassert)(atomic_t *deassert);
      	void (*smp_callin_clear_local_apic)(void);
      	void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
      	void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
      	void (*inquire_remote_apic)(int apicid);
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      569712b2
  8. 28 10月, 2008 1 次提交
  9. 23 10月, 2008 1 次提交