Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156278
b: refs/heads/master
c: 7781de7
h: refs/heads/master
v: v3
  • Loading branch information
Jakob Bornecrantz authored and Dave Airlie committed Aug 4, 2009
1 parent 4485dcc commit be4f5fa
Show file tree
Hide file tree
Showing 60 changed files with 238 additions and 514 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ee5332cf67c2f5f468ad1a59033d57453bcad1a
refs/heads/master: 7781de74568bddfefbd2d32a934a8c791a2420cd
2 changes: 1 addition & 1 deletion trunk/arch/parisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@
* on most of those machines only handles cache transactions.
*/
extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0
depdi 1,12,1,\prot
depi 1,12,1,\prot

/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
convert_for_tlb_insert20 \pte
Expand Down
50 changes: 5 additions & 45 deletions trunk/arch/parisc/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,8 @@
* the bottom of the table, which has a maximum signed displacement of
* 0x3fff; however, since we're only going forward, this becomes
* 0x1fff, and thus, since each GOT entry is 8 bytes long we can have
* at most 1023 entries.
* To overcome this 14bit displacement with some kernel modules, we'll
* use instead the unusal 16bit displacement method (see reassemble_16a)
* which gives us a maximum positive displacement of 0x7fff, and as such
* allows us to allocate up to 4095 GOT entries. */
#define MAX_GOTS 4095
* at most 1023 entries */
#define MAX_GOTS 1023

/* three functions to determine where in the module core
* or init pieces the location is */
Expand Down Expand Up @@ -149,40 +145,12 @@ struct stub_entry {
/* The reassemble_* functions prepare an immediate value for
insertion into an opcode. pa-risc uses all sorts of weird bitfields
in the instruction to hold the value. */
static inline int sign_unext(int x, int len)
{
int len_ones;

len_ones = (1 << len) - 1;
return x & len_ones;
}

static inline int low_sign_unext(int x, int len)
{
int sign, temp;

sign = (x >> (len-1)) & 1;
temp = sign_unext(x, len-1);
return (temp << 1) | sign;
}

static inline int reassemble_14(int as14)
{
return (((as14 & 0x1fff) << 1) |
((as14 & 0x2000) >> 13));
}

static inline int reassemble_16a(int as16)
{
int s, t;

/* Unusual 16-bit encoding, for wide mode only. */
t = (as16 << 1) & 0xffff;
s = (as16 & 0x8000);
return (t ^ s ^ (s >> 1)) | (s >> 15);
}


static inline int reassemble_17(int as17)
{
return (((as17 & 0x10000) >> 16) |
Expand Down Expand Up @@ -439,7 +407,6 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
enum elf_stub_type stub_type, Elf_Addr loc0, unsigned int targetsec)
{
struct stub_entry *stub;
int __maybe_unused d;

/* initialize stub_offset to point in front of the section */
if (!me->arch.section[targetsec].stub_offset) {
Expand Down Expand Up @@ -493,19 +460,12 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
*/
switch (stub_type) {
case ELF_STUB_GOT:
d = get_got(me, value, addend);
if (d <= 15) {
/* Format 5 */
stub->insns[0] = 0x0f6010db; /* ldd 0(%dp),%dp */
stub->insns[0] |= low_sign_unext(d, 5) << 16;
} else {
/* Format 3 */
stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */
stub->insns[0] |= reassemble_16a(d);
}
stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */
stub->insns[1] = 0x53610020; /* ldd 10(%dp),%r1 */
stub->insns[2] = 0xe820d000; /* bve (%r1) */
stub->insns[3] = 0x537b0030; /* ldd 18(%dp),%dp */

stub->insns[0] |= reassemble_14(get_got(me, value, addend) & 0x3fff);
break;
case ELF_STUB_MILLI:
stub->insns[0] = 0x20200000; /* ldil 0,%r1 */
Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/x86/include/asm/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);
#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \
efi_call_virt(f, a1, a2, a3, a4, a5, a6)

#define efi_ioremap(addr, size, type) ioremap_cache(addr, size)
#define efi_ioremap(addr, size) ioremap_cache(addr, size)

#else /* !CONFIG_X86_32 */

Expand Down Expand Up @@ -84,8 +84,7 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3,
efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
(u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))

extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
u32 type);
extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size);

#endif /* CONFIG_X86_32 */

Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/x86/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ static inline unsigned long native_save_fl(void)
{
unsigned long flags;

/*
* Note: this needs to be "=r" not "=rm", because we have the
* stack offset from what gcc expects at the time the "pop" is
* executed, and so a memory reference with respect to the stack
* would end up using the wrong address.
*/
asm volatile("# __raw_save_flags\n\t"
"pushf ; pop %0"
: "=r" (flags)
: "=g" (flags)
: /* no input */
: "memory");

Expand Down
9 changes: 1 addition & 8 deletions trunk/arch/x86/include/asm/uv/uv_hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
#define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT))

#define UV_GLOBAL_MMR64_PNODE_BITS(p) \
(((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT)
((unsigned long)(UV_PNODE_TO_GNODE(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT)

#define UV_APIC_PNODE_SHIFT 6

Expand Down Expand Up @@ -327,7 +327,6 @@ struct uv_blade_info {
unsigned short nr_possible_cpus;
unsigned short nr_online_cpus;
unsigned short pnode;
short memory_nid;
};
extern struct uv_blade_info *uv_blade_info;
extern short *uv_node_to_blade;
Expand Down Expand Up @@ -364,12 +363,6 @@ static inline int uv_blade_to_pnode(int bid)
return uv_blade_info[bid].pnode;
}

/* Nid of memory node on blade. -1 if no blade-local memory */
static inline int uv_blade_to_memory_nid(int bid)
{
return uv_blade_info[bid].memory_nid;
}

/* Determine the number of possible cpus on a blade */
static inline int uv_blade_nr_possible_cpus(int bid)
{
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3793,9 +3793,6 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
mmr_pnode = uv_blade_to_pnode(mmr_blade);
uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);

if (cfg->move_in_progress)
send_cleanup_vector(cfg);

return irq;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/apic/x2apic_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static unsigned long set_apic_id(unsigned int id)

static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb)
{
return initial_apicid >> index_msb;
return current_cpu_data.initial_apicid >> index_msb;
}

static void x2apic_send_IPI_self(int vector)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/apic/x2apic_phys.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static unsigned long set_apic_id(unsigned int id)

static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
{
return initial_apicid >> index_msb;
return current_cpu_data.initial_apicid >> index_msb;
}

static void x2apic_send_IPI_self(int vector)
Expand Down
38 changes: 31 additions & 7 deletions trunk/arch/x86/kernel/apic/x2apic_uv_x.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ struct apic apic_x2apic_uv_x = {
.apic_id_registered = uv_apic_id_registered,

.irq_delivery_mode = dest_Fixed,
.irq_dest_mode = 0, /* physical */
.irq_dest_mode = 1, /* logical */

.target_cpus = uv_target_cpus,
.disable_esr = 0,
Expand Down Expand Up @@ -362,6 +362,12 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size)
BUG();
}

static __init void map_low_mmrs(void)
{
init_extra_mapping_uc(UV_GLOBAL_MMR32_BASE, UV_GLOBAL_MMR32_SIZE);
init_extra_mapping_uc(UV_LOCAL_MMR_BASE, UV_LOCAL_MMR_SIZE);
}

enum map_type {map_wb, map_uc};

static __init void map_high(char *id, unsigned long base, int shift,
Expand Down Expand Up @@ -389,6 +395,26 @@ static __init void map_gru_high(int max_pnode)
map_high("GRU", gru.s.base, shift, max_pnode, map_wb);
}

static __init void map_config_high(int max_pnode)
{
union uvh_rh_gam_cfg_overlay_config_mmr_u cfg;
int shift = UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR_BASE_SHFT;

cfg.v = uv_read_local_mmr(UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR);
if (cfg.s.enable)
map_high("CONFIG", cfg.s.base, shift, max_pnode, map_uc);
}

static __init void map_mmr_high(int max_pnode)
{
union uvh_rh_gam_mmr_overlay_config_mmr_u mmr;
int shift = UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_SHFT;

mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR);
if (mmr.s.enable)
map_high("MMR", mmr.s.base, shift, max_pnode, map_uc);
}

static __init void map_mmioh_high(int max_pnode)
{
union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh;
Expand Down Expand Up @@ -540,6 +566,8 @@ void __init uv_system_init(void)
unsigned long mmr_base, present, paddr;
unsigned short pnode_mask;

map_low_mmrs();

m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG);
m_val = m_n_config.s.m_skt;
n_val = m_n_config.s.n_skt;
Expand All @@ -563,8 +591,6 @@ void __init uv_system_init(void)
bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades();
uv_blade_info = kmalloc(bytes, GFP_KERNEL);
BUG_ON(!uv_blade_info);
for (blade = 0; blade < uv_num_possible_blades(); blade++)
uv_blade_info[blade].memory_nid = -1;

get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size);

Expand Down Expand Up @@ -603,9 +629,6 @@ void __init uv_system_init(void)
lcpu = uv_blade_info[blade].nr_possible_cpus;
uv_blade_info[blade].nr_possible_cpus++;

/* Any node on the blade, else will contain -1. */
uv_blade_info[blade].memory_nid = nid;

uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base;
uv_cpu_hub_info(cpu)->lowmem_remap_top = lowmem_redir_size;
uv_cpu_hub_info(cpu)->m_val = m_val;
Expand Down Expand Up @@ -639,10 +662,11 @@ void __init uv_system_init(void)
pnode = (paddr >> m_val) & pnode_mask;
blade = boot_pnode_to_blade(pnode);
uv_node_to_blade[nid] = blade;
max_pnode = max(pnode, max_pnode);
}

map_gru_high(max_pnode);
map_mmr_high(max_pnode);
map_config_high(max_pnode);
map_mmioh_high(max_pnode);

uv_cpu_init();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/apm_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ static int apm_do_idle(void)
u8 ret = 0;
int idled = 0;
int polling;
int err = 0;
int err;

polling = !!(current_thread_info()->status & TS_POLLING);
if (polling) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ void __init efi_enter_virtual_mode(void)
&& end_pfn <= max_pfn_mapped))
va = __va(md->phys_addr);
else
va = efi_ioremap(md->phys_addr, size, md->type);
va = efi_ioremap(md->phys_addr, size);

md->virt_addr = (u64) (unsigned long) va;

Expand Down
6 changes: 1 addition & 5 deletions trunk/arch/x86/kernel/efi_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,10 @@ void __init efi_call_phys_epilog(void)
early_runtime_code_mapping_set_exec(0);
}

void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
u32 type)
void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size)
{
unsigned long last_map_pfn;

if (type == EFI_MEMORY_MAPPED_IO)
return ioremap(phys_addr, size);

last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size)
return NULL;
Expand Down
6 changes: 1 addition & 5 deletions trunk/arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,7 @@ ignore_int:
#endif
iret

#ifndef CONFIG_HOTPLUG_CPU
__CPUINITDATA
#else
__REFDATA
#endif
.section .cpuinit.data,"wa"
.align 4
ENTRY(initial_code)
.long i386_start_kernel
Expand Down
34 changes: 1 addition & 33 deletions trunk/arch/x86/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/efi.h>
#include <linux/dmi.h>
#include <acpi/reboot.h>
#include <asm/io.h>
#include <asm/apic.h>
Expand All @@ -18,6 +17,7 @@
#include <asm/cpu.h>

#ifdef CONFIG_X86_32
# include <linux/dmi.h>
# include <linux/ctype.h>
# include <linux/mc146818rtc.h>
#else
Expand Down Expand Up @@ -404,38 +404,6 @@ EXPORT_SYMBOL(machine_real_restart);

#endif /* CONFIG_X86_32 */

/*
* Apple MacBook5,2 (2009 MacBook) needs reboot=p
*/
static int __init set_pci_reboot(const struct dmi_system_id *d)
{
if (reboot_type != BOOT_CF9) {
reboot_type = BOOT_CF9;
printk(KERN_INFO "%s series board detected. "
"Selecting PCI-method for reboots.\n", d->ident);
}
return 0;
}

static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
{ /* Handle problems with rebooting on Apple MacBook5,2 */
.callback = set_pci_reboot,
.ident = "Apple MacBook",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"),
},
},
{ }
};

static int __init pci_reboot_init(void)
{
dmi_check_system(pci_reboot_dmi_table);
return 0;
}
core_initcall(pci_reboot_init);

static inline void kb_wait(void)
{
int i;
Expand Down
Loading

0 comments on commit be4f5fa

Please sign in to comment.