Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190108
b: refs/heads/master
c: da9c99f
h: refs/heads/master
v: v3
  • Loading branch information
Arnaud Patard authored and Ben Dooks committed Apr 20, 2010
1 parent 6d2d0a4 commit bee78e0
Show file tree
Hide file tree
Showing 55 changed files with 254 additions and 379 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: 74a920139a0f1119c5a604cef0ce5d6f591dc782
refs/heads/master: da9c99fc32e2d84f80672d192a7aaf7239057a2e
9 changes: 4 additions & 5 deletions trunk/arch/ia64/kvm/kvm-ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1802,8 +1802,7 @@ static int kvm_ia64_sync_dirty_log(struct kvm *kvm,
{
struct kvm_memory_slot *memslot;
int r, i;
long base;
unsigned long n;
long n, base;
unsigned long *dirty_bitmap = (unsigned long *)(kvm->arch.vm_base +
offsetof(struct kvm_vm_data, kvm_mem_dirty_log));

Expand All @@ -1816,7 +1815,7 @@ static int kvm_ia64_sync_dirty_log(struct kvm *kvm,
if (!memslot->dirty_bitmap)
goto out;

n = kvm_dirty_bitmap_bytes(memslot);
n = ALIGN(memslot->npages, BITS_PER_LONG) / 8;
base = memslot->base_gfn / BITS_PER_LONG;

for (i = 0; i < n/sizeof(long); ++i) {
Expand All @@ -1832,7 +1831,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
struct kvm_dirty_log *log)
{
int r;
unsigned long n;
int n;
struct kvm_memory_slot *memslot;
int is_dirty = 0;

Expand All @@ -1851,7 +1850,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
if (is_dirty) {
kvm_flush_remote_tlbs(kvm);
memslot = &kvm->memslots->memslots[log->slot];
n = kvm_dirty_bitmap_bytes(memslot);
n = ALIGN(memslot->npages, BITS_PER_LONG) / 8;
memset(memslot->dirty_bitmap, 0, n);
}
r = 0;
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/m68k/include/asm/mcfuart.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,5 @@ struct mcf_platform_uart {
#define MCFUART_URF_RXS 0xc0 /* Receiver status */
#endif

#if defined(CONFIG_M5272)
#define MCFUART_TXFIFOSIZE 25
#else
#define MCFUART_TXFIFOSIZE 1
#endif
/****************************************************************************/
#endif /* mcfuart_h */
2 changes: 1 addition & 1 deletion trunk/arch/m68knommu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200)
cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307)
cflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200)
cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307)
cflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5272,-m5307)
cflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5271,-m5200)
cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307)
cflags-$(CONFIG_M528x) := $(call cc-option,-m528x,-m5307)
cflags-$(CONFIG_M5307) := $(call cc-option,-m5307,-m5200)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m68knommu/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ ENTRY(ret_from_user_signal)
trap #0

ENTRY(ret_from_user_rt_signal)
movel #__NR_rt_sigreturn,%d0
move #__NR_rt_sigreturn,%d0
trap #0

1 change: 1 addition & 0 deletions trunk/arch/m68knommu/platform/68360/ints.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void init_IRQ(void)
_ramvec[vba+CPMVEC_PIO_PC7] = inthandler; /* pio - pc7 */
_ramvec[vba+CPMVEC_PIO_PC6] = inthandler; /* pio - pc6 */
_ramvec[vba+CPMVEC_TIMER3] = inthandler; /* timer 3 */
_ramvec[vba+CPMVEC_RISCTIMER] = inthandler; /* reserved */
_ramvec[vba+CPMVEC_PIO_PC5] = inthandler; /* pio - pc5 */
_ramvec[vba+CPMVEC_PIO_PC4] = inthandler; /* pio - pc4 */
_ramvec[vba+CPMVEC_RESERVED2] = inthandler; /* reserved */
Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/powerpc/kvm/book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
struct kvm_vcpu *vcpu;
ulong ga, ga_end;
int is_dirty = 0;
int r;
unsigned long n;
int r, n;

mutex_lock(&kvm->slots_lock);

Expand All @@ -1023,7 +1022,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
kvm_for_each_vcpu(n, vcpu, kvm)
kvmppc_mmu_pte_pflush(vcpu, ga, ga_end);

n = kvm_dirty_bitmap_bytes(memslot);
n = ALIGN(memslot->npages, BITS_PER_LONG) / 8;
memset(memslot->dirty_bitmap, 0, n);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/include/asm/thread_info_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct thread_info {
#define THREAD_SHIFT PAGE_SHIFT
#endif /* PAGE_SHIFT == 13 */

#define PREEMPT_ACTIVE 0x10000000
#define PREEMPT_ACTIVE 0x4000000

/*
* macros/functions for gaining access to the thread information structure
Expand Down
20 changes: 18 additions & 2 deletions trunk/arch/sparc/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/seq_file.h>
#include <linux/ftrace.h>
#include <linux/irq.h>
#include <linux/kmemleak.h>

#include <asm/ptrace.h>
#include <asm/processor.h>
Expand All @@ -47,7 +46,6 @@

#include "entry.h"
#include "cpumap.h"
#include "kstack.h"

#define NUM_IVECS (IMAP_INR + 1)

Expand Down Expand Up @@ -714,6 +712,24 @@ void ack_bad_irq(unsigned int virt_irq)
void *hardirq_stack[NR_CPUS];
void *softirq_stack[NR_CPUS];

static __attribute__((always_inline)) void *set_hardirq_stack(void)
{
void *orig_sp, *sp = hardirq_stack[smp_processor_id()];

__asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp));
if (orig_sp < sp ||
orig_sp > (sp + THREAD_SIZE)) {
sp += THREAD_SIZE - 192 - STACK_BIAS;
__asm__ __volatile__("mov %0, %%sp" : : "r" (sp));
}

return orig_sp;
}
static __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp)
{
__asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp));
}

void __irq_entry handler_irq(int irq, struct pt_regs *regs)
{
unsigned long pstate, bucket_pa;
Expand Down
19 changes: 0 additions & 19 deletions trunk/arch/sparc/kernel/kstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,4 @@ static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs *

}

static inline __attribute__((always_inline)) void *set_hardirq_stack(void)
{
void *orig_sp, *sp = hardirq_stack[smp_processor_id()];

__asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp));
if (orig_sp < sp ||
orig_sp > (sp + THREAD_SIZE)) {
sp += THREAD_SIZE - 192 - STACK_BIAS;
__asm__ __volatile__("mov %0, %%sp" : : "r" (sp));
}

return orig_sp;
}

static inline __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp)
{
__asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp));
}

#endif /* _KSTACK_H */
7 changes: 0 additions & 7 deletions trunk/arch/sparc/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include <asm/ptrace.h>
#include <asm/pcr.h>

#include "kstack.h"

/* We don't have a real NMI on sparc64, but we can fake one
* up using profiling counter overflow interrupts and interrupt
* levels.
Expand Down Expand Up @@ -94,16 +92,13 @@ static void die_nmi(const char *str, struct pt_regs *regs, int do_panic)
notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
{
unsigned int sum, touched = 0;
void *orig_sp;

clear_softint(1 << irq);

local_cpu_data().__nmi_count++;

nmi_enter();

orig_sp = set_hardirq_stack();

if (notify_die(DIE_NMI, "nmi", regs, 0,
pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP)
touched = 1;
Expand All @@ -129,8 +124,6 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
pcr_ops->write(pcr_enable);
}

restore_hardirq_stack(orig_sp);

nmi_exit();
}

Expand Down
12 changes: 1 addition & 11 deletions trunk/arch/sparc/kernel/rtrap_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,7 @@ rtrap_xcall:
nop
call trace_hardirqs_on
nop
/* Do not actually set the %pil here. We will do that
* below after we clear PSTATE_IE in the %pstate register.
* If we re-enable interrupts here, we can recurse down
* the hardirq stack potentially endlessly, causing a
* stack overflow.
*
* It is tempting to put this test and trace_hardirqs_on
* call at the 'rt_continue' label, but that will not work
* as that path hits unconditionally and we do not want to
* execute this in NMI return paths, for example.
*/
wrpr %l4, %pil
#endif
rtrap_no_irq_enable:
andcc %l1, TSTATE_PRIV, %l3
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/sparc/kernel/unaligned_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static inline enum direction decode_direction(unsigned int insn)
}

/* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */
static inline int decode_access_size(struct pt_regs *regs, unsigned int insn)
static inline int decode_access_size(unsigned int insn)
{
unsigned int tmp;

Expand All @@ -66,7 +66,7 @@ static inline int decode_access_size(struct pt_regs *regs, unsigned int insn)
return 2;
else {
printk("Impossible unaligned trap. insn=%08x\n", insn);
die_if_kernel("Byte sized unaligned access?!?!", regs);
die_if_kernel("Byte sized unaligned access?!?!", current_thread_info()->kregs);

/* GCC should never warn that control reaches the end
* of this function without returning a value because
Expand Down Expand Up @@ -286,7 +286,7 @@ static void log_unaligned(struct pt_regs *regs)
asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
{
enum direction dir = decode_direction(insn);
int size = decode_access_size(regs, insn);
int size = decode_access_size(insn);
int orig_asi, asi;

current_thread_info()->kern_una_regs = regs;
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/sparc/lib/mcount.S
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mcount:
cmp %g1, %g2
be,pn %icc, 1f
mov %i7, %g3
save %sp, -176, %sp
save %sp, -128, %sp
mov %g3, %o1
jmpl %g1, %o7
mov %i7, %o0
Expand All @@ -56,7 +56,7 @@ mcount:
nop
5: mov %i7, %g2
mov %fp, %g3
save %sp, -176, %sp
save %sp, -128, %sp
mov %g2, %l0
ba,pt %xcc, ftrace_graph_caller
mov %g3, %l1
Expand Down Expand Up @@ -85,7 +85,7 @@ ftrace_caller:
lduw [%g1 + %lo(function_trace_stop)], %g1
brnz,pn %g1, ftrace_stub
mov %fp, %g3
save %sp, -176, %sp
save %sp, -128, %sp
mov %g2, %o1
mov %g2, %l0
mov %g3, %l1
Expand Down Expand Up @@ -120,7 +120,7 @@ ENTRY(ftrace_graph_caller)
END(ftrace_graph_caller)

ENTRY(return_to_handler)
save %sp, -176, %sp
save %sp, -128, %sp
call ftrace_return_to_handler
mov %fp, %o0
jmpl %o0 + 8, %g0
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ ia32_sys_call_table:
.quad stub32_sigreturn
.quad stub32_clone /* 120 */
.quad sys_setdomainname
.quad sys_newuname
.quad sys_uname
.quad sys_modify_ldt
.quad compat_sys_adjtimex
.quad sys32_mprotect /* 125 */
Expand Down
8 changes: 2 additions & 6 deletions trunk/arch/x86/kernel/dumpstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#define get_bp(bp) asm("movq %%rbp, %0" : "=r" (bp) :)
#endif

#include <linux/uaccess.h>

extern void
show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, unsigned long bp, char *log_lvl);
Expand Down Expand Up @@ -44,10 +42,8 @@ static inline unsigned long rewind_frame_pointer(int n)
get_bp(frame);

#ifdef CONFIG_FRAME_POINTER
while (n--) {
if (probe_kernel_address(&frame->next_frame, frame))
break;
}
while (n--)
frame = frame->next_frame;
#endif

return (unsigned long)frame;
Expand Down
11 changes: 4 additions & 7 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1490,8 +1490,8 @@ static int mmu_zap_unsync_children(struct kvm *kvm,
for_each_sp(pages, sp, parents, i) {
kvm_mmu_zap_page(kvm, sp);
mmu_pages_clear_parents(&parents);
zapped++;
}
zapped += pages.nr;
kvm_mmu_pages_init(parent, &parents, &pages);
}

Expand Down Expand Up @@ -1542,16 +1542,14 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages)
*/

if (used_pages > kvm_nr_mmu_pages) {
while (used_pages > kvm_nr_mmu_pages &&
!list_empty(&kvm->arch.active_mmu_pages)) {
while (used_pages > kvm_nr_mmu_pages) {
struct kvm_mmu_page *page;

page = container_of(kvm->arch.active_mmu_pages.prev,
struct kvm_mmu_page, link);
used_pages -= kvm_mmu_zap_page(kvm, page);
kvm_mmu_zap_page(kvm, page);
used_pages--;
}
kvm_nr_mmu_pages = used_pages;
kvm->arch.n_free_mmu_pages = 0;
}
else
Expand Down Expand Up @@ -1598,8 +1596,7 @@ static void mmu_unshadow(struct kvm *kvm, gfn_t gfn)
&& !sp->role.invalid) {
pgprintk("%s: zap %lx %x\n",
__func__, gfn, sp->role.word);
if (kvm_mmu_zap_page(kvm, sp))
nn = bucket->first;
kvm_mmu_zap_page(kvm, sp);
}
}
}
Expand Down
Loading

0 comments on commit bee78e0

Please sign in to comment.