It becomes to early for ioremap, so we use early_ioremap Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ravikiran Thirumalai <kiran@scalemp.com> Acked-by: Shai Fultheim <shai@scalemp.com> --- arch/x86/kernel/setup_64.c | 4 ++++ arch/x86/kernel/vsmp_64.c | 11 +++++------ include/asm-x86/setup.h | 4 ++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index a49f5f7..6f5571c 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c @@ -346,6 +346,10 @@ #endif if (efi_enabled) efi_init(); +#ifdef CONFIG_PARAVIRT + vsmp_init(); +#endif + dmi_scan_machine(); io_delay_init(); diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 9766917..fdf9fba 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c @@ -16,10 +16,10 @@ #include <linux/pci_regs.h> #include <asm/pci-direct.h> #include <asm/io.h> -static void __init vsmp_init(void) +void __init vsmp_init(void) { void *address; - unsigned int cap, ctl; + unsigned int cap, ctl, cfg; if (!early_pci_allowed()) return; @@ -32,7 +32,8 @@ static void __init vsmp_init(void) return; /* set vSMP magic bits to indicate vSMP capable kernel */ - address = ioremap(read_pci_config(0, 0x1f, 0, PCI_BASE_ADDRESS_0), 8); + cfg = read_pci_config(0, 0x1f, 0, PCI_BASE_ADDRESS_0); + address = early_ioremap(cfg, 8); cap = readl(address); ctl = readl(address + 4); printk(KERN_INFO "vSMP CTL: capabilities:0x%08x control:0x%08x\n", @@ -45,8 +46,6 @@ static void __init vsmp_init(void) printk(KERN_INFO "vSMP CTL: control set to:0x%08x\n", ctl); } - iounmap(address); + early_iounmap(address, 8); return; } - -core_initcall(vsmp_init); diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h index 071e054..f745de2 100644 --- a/include/asm-x86/setup.h +++ b/include/asm-x86/setup.h @@ -4,6 +4,10 @@ #define _ASM_X86_SETUP_H #define COMMAND_LINE_SIZE 2048 #ifndef __ASSEMBLY__ + +/* Interrupt control for vSMPowered x86_64 systems */ +void vsmp_init(void); + char *machine_specific_memory_setup(void); #ifndef CONFIG_PARAVIRT #define paravirt_post_allocator_init() do {} while (0) -- 1.4.2
Glauber Costa
2008-Feb-11 11:30 UTC
[PATCH 2/5] [PATCH] make vsmp_init void, instead of static int
Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ravikiran Thirumalai <kiran@scalemp.com> Acked-by: Shai Fultheim <shai@scalemp.com> --- arch/x86/kernel/vsmp_64.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index d971210..9766917 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c @@ -16,20 +16,20 @@ #include <linux/pci_regs.h> #include <asm/pci-direct.h> #include <asm/io.h> -static int __init vsmp_init(void) +static void __init vsmp_init(void) { void *address; unsigned int cap, ctl; if (!early_pci_allowed()) - return 0; + return; /* Check if we are running on a ScaleMP vSMP box */ if ((read_pci_config_16(0, 0x1f, 0, PCI_VENDOR_ID) ! PCI_VENDOR_ID_SCALEMP) || (read_pci_config_16(0, 0x1f, 0, PCI_DEVICE_ID) ! PCI_DEVICE_ID_SCALEMP_VSMP_CTL)) - return 0; + return; /* set vSMP magic bits to indicate vSMP capable kernel */ address = ioremap(read_pci_config(0, 0x1f, 0, PCI_BASE_ADDRESS_0), 8); @@ -46,7 +46,7 @@ static int __init vsmp_init(void) } iounmap(address); - return 0; + return; } core_initcall(vsmp_init); -- 1.4.2
Change Makefile so vsmp_64.o object is dependent on PARAVIRT, rather than X86_VSMP Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ravikiran Thirumalai <kiran@scalemp.com> Acked-by: Shai Fultheim <shai@scalemp.com> --- arch/x86/kernel/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 21dc1a0..71a92a2 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -52,7 +52,7 @@ obj-$(CONFIG_KEXEC) += relocate_kernel_ obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o obj-$(CONFIG_X86_NUMAQ) += numaq_32.o obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o -obj-$(CONFIG_X86_VSMP) += vsmp_64.o +obj-$(CONFIG_PARAVIRT) += vsmp_64.o obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_MODULES) += module_$(BITS).o obj-$(CONFIG_ACPI_SRAT) += srat_32.o -- 1.4.2
* Glauber Costa <gcosta at redhat.com> wrote:> --- a/arch/x86/kernel/setup_64.c > +++ b/arch/x86/kernel/setup_64.c > @@ -346,6 +346,10 @@ #endif > if (efi_enabled) > efi_init(); > > +#ifdef CONFIG_PARAVIRT > + vsmp_init(); > +#endifthat #ifdef should be in setup.h, instead of polluting a .c file with it. Ingo