Commit 535d8e8f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-fixes-for-linus' of...

Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: enable DMAR by default
  xen: disable interrupts early, as start_kernel expects
  gpu/drm, x86, PAT: io_mapping_create_wc and resource_size_t
  gpu/drm, x86, PAT: Handle io_mapping_create_wc() errors in a clean way
  x86, Voyager: fix compile by lifting the degeneracy of phys_cpu_present_map
  x86, doc: fix references to Documentation/x86/i386/boot.txt
parents 6febf65b f6be37fd
...@@ -114,7 +114,7 @@ In addition, the following text indicates that the option: ...@@ -114,7 +114,7 @@ In addition, the following text indicates that the option:
Parameters denoted with BOOT are actually interpreted by the boot Parameters denoted with BOOT are actually interpreted by the boot
loader, and have no meaning to the kernel directly. loader, and have no meaning to the kernel directly.
Do not modify the syntax of boot loader parameters without extreme Do not modify the syntax of boot loader parameters without extreme
need or coordination with <Documentation/x86/i386/boot.txt>. need or coordination with <Documentation/x86/boot.txt>.
There are also arch-specific kernel-parameters not documented here. There are also arch-specific kernel-parameters not documented here.
See for example <Documentation/x86/x86_64/boot-options.txt>. See for example <Documentation/x86/x86_64/boot-options.txt>.
...@@ -2451,7 +2451,7 @@ and is between 256 and 4096 characters. It is defined in the file ...@@ -2451,7 +2451,7 @@ and is between 256 and 4096 characters. It is defined in the file
See Documentation/fb/modedb.txt. See Documentation/fb/modedb.txt.
vga= [BOOT,X86-32] Select a particular video mode vga= [BOOT,X86-32] Select a particular video mode
See Documentation/x86/i386/boot.txt and See Documentation/x86/boot.txt and
Documentation/svga.txt. Documentation/svga.txt.
Use vga=ask for menu. Use vga=ask for menu.
This is actually a boot loader parameter; the value is This is actually a boot loader parameter; the value is
......
...@@ -1803,7 +1803,7 @@ config DMAR ...@@ -1803,7 +1803,7 @@ config DMAR
remapping devices. remapping devices.
config DMAR_DEFAULT_ON config DMAR_DEFAULT_ON
def_bool n def_bool y
prompt "Enable DMA Remapping Devices by default" prompt "Enable DMA Remapping Devices by default"
depends on DMAR depends on DMAR
help help
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
int
is_io_mapping_possible(resource_size_t base, unsigned long size);
void * void *
iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
......
...@@ -65,7 +65,7 @@ static volatile unsigned long smp_invalidate_needed; ...@@ -65,7 +65,7 @@ static volatile unsigned long smp_invalidate_needed;
/* Bitmask of CPUs present in the system - exported by i386_syms.c, used /* Bitmask of CPUs present in the system - exported by i386_syms.c, used
* by scheduler but indexed physically */ * by scheduler but indexed physically */
cpumask_t phys_cpu_present_map = CPU_MASK_NONE; static cpumask_t voyager_phys_cpu_present_map = CPU_MASK_NONE;
/* The internal functions */ /* The internal functions */
static void send_CPI(__u32 cpuset, __u8 cpi); static void send_CPI(__u32 cpuset, __u8 cpi);
...@@ -366,19 +366,19 @@ void __init find_smp_config(void) ...@@ -366,19 +366,19 @@ void __init find_smp_config(void)
/* set up everything for just this CPU, we can alter /* set up everything for just this CPU, we can alter
* this as we start the other CPUs later */ * this as we start the other CPUs later */
/* now get the CPU disposition from the extended CMOS */ /* now get the CPU disposition from the extended CMOS */
cpus_addr(phys_cpu_present_map)[0] = cpus_addr(voyager_phys_cpu_present_map)[0] =
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK); voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK);
cpus_addr(phys_cpu_present_map)[0] |= cpus_addr(voyager_phys_cpu_present_map)[0] |=
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8; voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8;
cpus_addr(phys_cpu_present_map)[0] |= cpus_addr(voyager_phys_cpu_present_map)[0] |=
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
2) << 16; 2) << 16;
cpus_addr(phys_cpu_present_map)[0] |= cpus_addr(voyager_phys_cpu_present_map)[0] |=
voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
3) << 24; 3) << 24;
init_cpu_possible(&phys_cpu_present_map); init_cpu_possible(&voyager_phys_cpu_present_map);
printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n", printk("VOYAGER SMP: voyager_phys_cpu_present_map = 0x%lx\n",
cpus_addr(phys_cpu_present_map)[0]); cpus_addr(voyager_phys_cpu_present_map)[0]);
/* Here we set up the VIC to enable SMP */ /* Here we set up the VIC to enable SMP */
/* enable the CPIs by writing the base vector to their register */ /* enable the CPIs by writing the base vector to their register */
outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER); outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER);
...@@ -628,15 +628,15 @@ void __init smp_boot_cpus(void) ...@@ -628,15 +628,15 @@ void __init smp_boot_cpus(void)
/* now that the cat has probed the Voyager System Bus, sanity /* now that the cat has probed the Voyager System Bus, sanity
* check the cpu map */ * check the cpu map */
if (((voyager_quad_processors | voyager_extended_vic_processors) if (((voyager_quad_processors | voyager_extended_vic_processors)
& cpus_addr(phys_cpu_present_map)[0]) != & cpus_addr(voyager_phys_cpu_present_map)[0]) !=
cpus_addr(phys_cpu_present_map)[0]) { cpus_addr(voyager_phys_cpu_present_map)[0]) {
/* should panic */ /* should panic */
printk("\n\n***WARNING*** " printk("\n\n***WARNING*** "
"Sanity check of CPU present map FAILED\n"); "Sanity check of CPU present map FAILED\n");
} }
} else if (voyager_level == 4) } else if (voyager_level == 4)
voyager_extended_vic_processors = voyager_extended_vic_processors =
cpus_addr(phys_cpu_present_map)[0]; cpus_addr(voyager_phys_cpu_present_map)[0];
/* this sets up the idle task to run on the current cpu */ /* this sets up the idle task to run on the current cpu */
voyager_extended_cpus = 1; voyager_extended_cpus = 1;
...@@ -670,7 +670,7 @@ void __init smp_boot_cpus(void) ...@@ -670,7 +670,7 @@ void __init smp_boot_cpus(void)
/* loop over all the extended VIC CPUs and boot them. The /* loop over all the extended VIC CPUs and boot them. The
* Quad CPUs must be bootstrapped by their extended VIC cpu */ * Quad CPUs must be bootstrapped by their extended VIC cpu */
for (i = 0; i < nr_cpu_ids; i++) { for (i = 0; i < nr_cpu_ids; i++) {
if (i == boot_cpu_id || !cpu_isset(i, phys_cpu_present_map)) if (i == boot_cpu_id || !cpu_isset(i, voyager_phys_cpu_present_map))
continue; continue;
do_boot_cpu(i); do_boot_cpu(i);
/* This udelay seems to be needed for the Quad boots /* This udelay seems to be needed for the Quad boots
......
...@@ -20,6 +20,24 @@ ...@@ -20,6 +20,24 @@
#include <asm/pat.h> #include <asm/pat.h>
#include <linux/module.h> #include <linux/module.h>
#ifdef CONFIG_X86_PAE
int
is_io_mapping_possible(resource_size_t base, unsigned long size)
{
return 1;
}
#else
int
is_io_mapping_possible(resource_size_t base, unsigned long size)
{
/* There is no way to map greater than 1 << 32 address without PAE */
if (base + size > 0x100000000ULL)
return 0;
return 1;
}
#endif
/* Map 'pfn' using fixed map 'type' and protections 'prot' /* Map 'pfn' using fixed map 'type' and protections 'prot'
*/ */
void * void *
......
...@@ -1672,6 +1672,9 @@ asmlinkage void __init xen_start_kernel(void) ...@@ -1672,6 +1672,9 @@ asmlinkage void __init xen_start_kernel(void)
possible map and a non-dummy shared_info. */ possible map and a non-dummy shared_info. */
per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
local_irq_disable();
early_boot_irqs_off();
xen_raw_console_write("mapping kernel into physical memory\n"); xen_raw_console_write("mapping kernel into physical memory\n");
pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages); pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages);
......
...@@ -1090,6 +1090,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1090,6 +1090,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
dev_priv->mm.gtt_mapping = dev_priv->mm.gtt_mapping =
io_mapping_create_wc(dev->agp->base, io_mapping_create_wc(dev->agp->base,
dev->agp->agp_info.aper_size * 1024*1024); dev->agp->agp_info.aper_size * 1024*1024);
if (dev_priv->mm.gtt_mapping == NULL) {
ret = -EIO;
goto out_rmmap;
}
/* Set up a WC MTRR for non-PAT systems. This is more common than /* Set up a WC MTRR for non-PAT systems. This is more common than
* one would think, because the kernel disables PAT on first * one would think, because the kernel disables PAT on first
* generation Core chips because WC PAT gets overridden by a UC * generation Core chips because WC PAT gets overridden by a UC
...@@ -1122,7 +1127,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1122,7 +1127,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
if (!I915_NEED_GFX_HWS(dev)) { if (!I915_NEED_GFX_HWS(dev)) {
ret = i915_init_phys_hws(dev); ret = i915_init_phys_hws(dev);
if (ret != 0) if (ret != 0)
goto out_rmmap; goto out_iomapfree;
} }
/* On the 945G/GM, the chipset reports the MSI capability on the /* On the 945G/GM, the chipset reports the MSI capability on the
...@@ -1161,6 +1166,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1161,6 +1166,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
return 0; return 0;
out_iomapfree:
io_mapping_free(dev_priv->mm.gtt_mapping);
out_rmmap: out_rmmap:
iounmap(dev_priv->regs); iounmap(dev_priv->regs);
free_priv: free_priv:
......
...@@ -30,11 +30,14 @@ ...@@ -30,11 +30,14 @@
* See Documentation/io_mapping.txt * See Documentation/io_mapping.txt
*/ */
/* this struct isn't actually defined anywhere */
struct io_mapping;
#ifdef CONFIG_HAVE_ATOMIC_IOMAP #ifdef CONFIG_HAVE_ATOMIC_IOMAP
struct io_mapping {
resource_size_t base;
unsigned long size;
pgprot_t prot;
};
/* /*
* For small address space machines, mapping large objects * For small address space machines, mapping large objects
* into the kernel virtual space isn't practical. Where * into the kernel virtual space isn't practical. Where
...@@ -43,23 +46,40 @@ struct io_mapping; ...@@ -43,23 +46,40 @@ struct io_mapping;
*/ */
static inline struct io_mapping * static inline struct io_mapping *
io_mapping_create_wc(unsigned long base, unsigned long size) io_mapping_create_wc(resource_size_t base, unsigned long size)
{ {
return (struct io_mapping *) base; struct io_mapping *iomap;
if (!is_io_mapping_possible(base, size))
return NULL;
iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
if (!iomap)
return NULL;
iomap->base = base;
iomap->size = size;
iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL));
return iomap;
} }
static inline void static inline void
io_mapping_free(struct io_mapping *mapping) io_mapping_free(struct io_mapping *mapping)
{ {
kfree(mapping);
} }
/* Atomic map/unmap */ /* Atomic map/unmap */
static inline void * static inline void *
io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset)
{ {
offset += (unsigned long) mapping; resource_size_t phys_addr;
return iomap_atomic_prot_pfn(offset >> PAGE_SHIFT, KM_USER0, unsigned long pfn;
__pgprot(__PAGE_KERNEL_WC));
BUG_ON(offset >= mapping->size);
phys_addr = mapping->base + offset;
pfn = (unsigned long) (phys_addr >> PAGE_SHIFT);
return iomap_atomic_prot_pfn(pfn, KM_USER0, mapping->prot);
} }
static inline void static inline void
...@@ -71,8 +91,9 @@ io_mapping_unmap_atomic(void *vaddr) ...@@ -71,8 +91,9 @@ io_mapping_unmap_atomic(void *vaddr)
static inline void * static inline void *
io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
{ {
offset += (unsigned long) mapping; BUG_ON(offset >= mapping->size);
return ioremap_wc(offset, PAGE_SIZE); resource_size_t phys_addr = mapping->base + offset;
return ioremap_wc(phys_addr, PAGE_SIZE);
} }
static inline void static inline void
...@@ -83,9 +104,12 @@ io_mapping_unmap(void *vaddr) ...@@ -83,9 +104,12 @@ io_mapping_unmap(void *vaddr)
#else #else
/* this struct isn't actually defined anywhere */
struct io_mapping;
/* Create the io_mapping object*/ /* Create the io_mapping object*/
static inline struct io_mapping * static inline struct io_mapping *
io_mapping_create_wc(unsigned long base, unsigned long size) io_mapping_create_wc(resource_size_t base, unsigned long size)
{ {
return (struct io_mapping *) ioremap_wc(base, size); return (struct io_mapping *) ioremap_wc(base, size);
} }
......
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