Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300109
b: refs/heads/master
c: 789505b
h: refs/heads/master
i:
  300107: c945507
v: v3
  • Loading branch information
Linus Torvalds committed May 8, 2012
1 parent 7f66ce0 commit 5f3c4c7
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 50 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: ec9b3a9de6b2a8a08c5250b466db92adf82b8d65
refs/heads/master: 789505b05752239d957dbfa84b183e0d7a641952
24 changes: 9 additions & 15 deletions trunk/arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,27 +906,14 @@ long arch_ptrace(struct task_struct *child, long request,
return ret;
}

#ifdef __ARMEB__
#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB
#else
#define AUDIT_ARCH_NR AUDIT_ARCH_ARM
#endif

asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
{
unsigned long ip;

/*
* Save IP. IP is used to denote syscall entry/exit:
* IP = 0 -> entry, = 1 -> exit
*/
ip = regs->ARM_ip;
regs->ARM_ip = why;

if (!ip)
if (why)
audit_syscall_exit(regs);
else
audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0,
audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,
regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);

if (!test_thread_flag(TIF_SYSCALL_TRACE))
Expand All @@ -936,6 +923,13 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)

current_thread_info()->syscall = scno;

/*
* IP is used to denote syscall entry/exit:
* IP = 0 -> entry, =1 -> exit
*/
ip = regs->ARM_ip;
regs->ARM_ip = why;

/* the 0x80 provides a way for the tracing parent to distinguish
between a syscall stop and SIGTRAP delivery */
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
struct mm_struct *mm = &init_mm;
unsigned int cpu = smp_processor_id();

printk("CPU%u: Booted secondary processor\n", cpu);

/*
* All kernel threads share the same mm context; grab a
* reference and switch to it.
Expand All @@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
enter_lazy_tlb(mm, current);
local_flush_tlb_all();

printk("CPU%u: Booted secondary processor\n", cpu);

cpu_init();
preempt_disable();
trace_hardirqs_off();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/sys_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int kernel_execve(const char *filename,
"Ir" (THREAD_START_SP - sizeof(regs)),
"r" (&regs),
"Ir" (sizeof(regs))
: "r0", "r1", "r2", "r3", "ip", "lr", "memory");
: "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory");

out:
return ret;
Expand Down
14 changes: 13 additions & 1 deletion trunk/arch/x86/kernel/setup_percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void)
#endif
rc = -EINVAL;
if (pcpu_chosen_fc != PCPU_FC_PAGE) {
const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
const size_t dyn_size = PERCPU_MODULE_RESERVE +
PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
size_t atom_size;

/*
* On 64bit, use PMD_SIZE for atom_size so that embedded
* percpu areas are aligned to PMD. This, in the future,
* can also allow using PMD mappings in vmalloc area. Use
* PAGE_SIZE on 32bit as vmalloc space is highly contended
* and large vmalloc area allocs can easily fail.
*/
#ifdef CONFIG_X86_64
atom_size = PMD_SIZE;
#else
atom_size = PAGE_SIZE;
#endif
rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
dyn_size, atom_size,
pcpu_cpu_distance,
Expand Down
42 changes: 39 additions & 3 deletions trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include <asm/stackprotector.h>
#include <asm/hypervisor.h>
#include <asm/mwait.h>
#include <asm/pci_x86.h>

#ifdef CONFIG_ACPI
#include <linux/acpi.h>
Expand Down Expand Up @@ -809,9 +810,40 @@ static void xen_io_delay(void)
}

#ifdef CONFIG_X86_LOCAL_APIC
static unsigned long xen_set_apic_id(unsigned int x)
{
WARN_ON(1);
return x;
}
static unsigned int xen_get_apic_id(unsigned long x)
{
return ((x)>>24) & 0xFFu;
}
static u32 xen_apic_read(u32 reg)
{
return 0;
struct xen_platform_op op = {
.cmd = XENPF_get_cpuinfo,
.interface_version = XENPF_INTERFACE_VERSION,
.u.pcpu_info.xen_cpuid = 0,
};
int ret = 0;

/* Shouldn't need this as APIC is turned off for PV, and we only
* get called on the bootup processor. But just in case. */
if (!xen_initial_domain() || smp_processor_id())
return 0;

if (reg == APIC_LVR)
return 0x10;

if (reg != APIC_ID)
return 0;

ret = HYPERVISOR_dom0_op(&op);
if (ret)
return 0;

return op.u.pcpu_info.apic_id << 24;
}

static void xen_apic_write(u32 reg, u32 val)
Expand Down Expand Up @@ -849,6 +881,8 @@ static void set_xen_basic_apic_ops(void)
apic->icr_write = xen_apic_icr_write;
apic->wait_icr_idle = xen_apic_wait_icr_idle;
apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;
apic->set_apic_id = xen_set_apic_id;
apic->get_apic_id = xen_get_apic_id;
}

#endif
Expand Down Expand Up @@ -1365,8 +1399,10 @@ asmlinkage void __init xen_start_kernel(void)
/* Make sure ACS will be enabled */
pci_request_acs();
}


#ifdef CONFIG_PCI
/* PCI BIOS service won't work from a PV guest. */
pci_probe &= ~PCI_PROBE_BIOS;
#endif
xen_raw_console_write("about to get started...\n");

xen_setup_runstate_info(0);
Expand Down
7 changes: 6 additions & 1 deletion trunk/arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
{
if (val & _PAGE_PRESENT) {
unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
unsigned long pfn = mfn_to_pfn(mfn);

pteval_t flags = val & PTE_FLAGS_MASK;
val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags;
if (unlikely(pfn == ~0))
val = flags & ~_PAGE_PRESENT;
else
val = ((pteval_t)pfn << PAGE_SHIFT) | flags;
}

return val;
Expand Down
27 changes: 16 additions & 11 deletions trunk/drivers/video/xen-fbfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
struct fb_info *fb_info;
int fb_size;
int val;
int ret;
int ret = 0;

info = kzalloc(sizeof(*info), GFP_KERNEL);
if (info == NULL) {
Expand Down Expand Up @@ -458,26 +458,31 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
xenfb_init_shared_page(info, fb_info);

ret = xenfb_connect_backend(dev, info);
if (ret < 0)
goto error;
if (ret < 0) {
xenbus_dev_fatal(dev, ret, "xenfb_connect_backend");
goto error_fb;
}

ret = register_framebuffer(fb_info);
if (ret) {
fb_deferred_io_cleanup(fb_info);
fb_dealloc_cmap(&fb_info->cmap);
framebuffer_release(fb_info);
xenbus_dev_fatal(dev, ret, "register_framebuffer");
goto error;
goto error_fb;
}
info->fb_info = fb_info;

xenfb_make_preferred_console();
return 0;

error_nomem:
ret = -ENOMEM;
xenbus_dev_fatal(dev, ret, "allocating device memory");
error:
error_fb:
fb_deferred_io_cleanup(fb_info);
fb_dealloc_cmap(&fb_info->cmap);
framebuffer_release(fb_info);
error_nomem:
if (!ret) {
ret = -ENOMEM;
xenbus_dev_fatal(dev, ret, "allocating device memory");
}
error:
xenfb_remove(dev);
return ret;
}
Expand Down
22 changes: 12 additions & 10 deletions trunk/drivers/xen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,17 @@ config XEN_ACPI_PROCESSOR
depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ
default m
help
This ACPI processor uploads Power Management information to the Xen hypervisor.

To do that the driver parses the Power Management data and uploads said
information to the Xen hypervisor. Then the Xen hypervisor can select the
proper Cx and Pxx states. It also registers itslef as the SMM so that
other drivers (such as ACPI cpufreq scaling driver) will not load.

To compile this driver as a module, choose M here: the
module will be called xen_acpi_processor If you do not know what to choose,
select M here. If the CPUFREQ drivers are built in, select Y here.
This ACPI processor uploads Power Management information to the Xen
hypervisor.

To do that the driver parses the Power Management data and uploads
said information to the Xen hypervisor. Then the Xen hypervisor can
select the proper Cx and Pxx states. It also registers itslef as the
SMM so that other drivers (such as ACPI cpufreq scaling driver) will
not load.

To compile this driver as a module, choose M here: the module will be
called xen_acpi_processor If you do not know what to choose, select
M here. If the CPUFREQ drivers are built in, select Y here.

endmenu
10 changes: 5 additions & 5 deletions trunk/mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,20 +1132,20 @@ static void pcpu_dump_alloc_info(const char *lvl,
for (alloc_end += gi->nr_units / upa;
alloc < alloc_end; alloc++) {
if (!(alloc % apl)) {
printk("\n");
printk(KERN_CONT "\n");
printk("%spcpu-alloc: ", lvl);
}
printk("[%0*d] ", group_width, group);
printk(KERN_CONT "[%0*d] ", group_width, group);

for (unit_end += upa; unit < unit_end; unit++)
if (gi->cpu_map[unit] != NR_CPUS)
printk("%0*d ", cpu_width,
printk(KERN_CONT "%0*d ", cpu_width,
gi->cpu_map[unit]);
else
printk("%s ", empty_str);
printk(KERN_CONT "%s ", empty_str);
}
}
printk("\n");
printk(KERN_CONT "\n");
}

/**
Expand Down

0 comments on commit 5f3c4c7

Please sign in to comment.