Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132039
b: refs/heads/master
c: d0cdb07
h: refs/heads/master
i:
  132037: 4a2c7bc
  132035: 53e2dce
  132031: 0c47f96
v: v3
  • Loading branch information
Linus Torvalds committed Mar 8, 2009
1 parent bf9b49a commit a784171
Show file tree
Hide file tree
Showing 47 changed files with 410 additions and 199 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: f4f8056a862a9950320429dfda708c88b4ce6025
refs/heads/master: d0cdb070ced5453fd1790d83c32bdc59d8ff9375
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 29
EXTRAVERSION = -rc6
EXTRAVERSION = -rc7
NAME = Erotic Pickled Herring

# *DOCUMENTATION*
Expand Down
13 changes: 7 additions & 6 deletions trunk/arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,13 @@ static void __init cacheid_init(void)
unsigned int cachetype = read_cpuid_cachetype();
unsigned int arch = cpu_architecture();

if (arch >= CPU_ARCH_ARMv7) {
cacheid = CACHEID_VIPT_NONALIASING;
if ((cachetype & (3 << 14)) == 1 << 14)
cacheid |= CACHEID_ASID_TAGGED;
} else if (arch >= CPU_ARCH_ARMv6) {
if (cachetype & (1 << 23))
if (arch >= CPU_ARCH_ARMv6) {
if ((cachetype & (7 << 29)) == 4 << 29) {
/* ARMv7 register format */
cacheid = CACHEID_VIPT_NONALIASING;
if ((cachetype & (3 << 14)) == 1 << 14)
cacheid |= CACHEID_ASID_TAGGED;
} else if (cachetype & (1 << 23))
cacheid = CACHEID_VIPT_ALIASING;
else
cacheid = CACHEID_VIPT_NONALIASING;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-at91/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ static int at91_pm_enter(suspend_state_t state)
at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));

error:
sdram_selfrefresh_disable();
target_state = PM_SUSPEND_ON;
at91_irq_resume();
at91_gpio_resume();
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/arm/mm/abort-ev6.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ ENTRY(v6_early_abort)
#ifdef CONFIG_CPU_32v6K
clrex
#else
strex r0, r1, [sp] @ Clear the exclusive monitor
sub r1, sp, #4 @ Get unused stack location
strex r0, r1, [r1] @ Clear the exclusive monitor
#endif
mrc p15, 0, r1, c5, c0, 0 @ get FSR
mrc p15, 0, r0, c6, c0, 0 @ get FAR
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/plat-s3c64xx/irq-eint.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void s3c_irq_eint_unmask(unsigned int irq)
u32 mask;

mask = __raw_readl(S3C64XX_EINT0MASK);
mask |= eint_irq_to_bit(irq);
mask &= ~eint_irq_to_bit(irq);
__raw_writel(mask, S3C64XX_EINT0MASK);
}

Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/ia64/sn/pci/pcibr/pcibr_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ pcibr_dmatrans_direct64(struct pcidev_info * info, u64 paddr,
if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS)
pci_addr = IS_PIC_SOFT(pcibus_info) ?
PHYS_TO_DMA(paddr) :
PHYS_TO_TIODMA(paddr) | dma_attributes;
PHYS_TO_TIODMA(paddr);
else
pci_addr = IS_PIC_SOFT(pcibus_info) ?
paddr :
paddr | dma_attributes;
pci_addr = paddr;
pci_addr |= dma_attributes;

/* Handle Bus mode */
if (IS_PCIX(pcibus_info))
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/mips/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/*
* Architecture specific compatibility types
*/
#include <linux/seccomp.h>
#include <linux/thread_info.h>
#include <linux/types.h>
#include <asm/page.h>
#include <asm/ptrace.h>
Expand Down Expand Up @@ -218,4 +220,9 @@ struct compat_shmid64_ds {
compat_ulong_t __unused2;
};

static inline int is_compat_task(void)
{
return test_thread_flag(TIF_32BIT);
}

#endif /* _ASM_COMPAT_H */
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/platforms/86xx/gef_sbc610.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
{
unsigned int val;

/* Do not do the fixup on other platforms! */
if (!machine_is(gef_sbc610))
return;

printk(KERN_INFO "Running NEC uPD720101 Fixup\n");

/* Ensure ports 1, 2, 3, 4 & 5 are enabled */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/crypto/aes_s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ static void __exit aes_s390_fini(void)
module_init(aes_s390_init);
module_exit(aes_s390_fini);

MODULE_ALIAS("aes");
MODULE_ALIAS("aes-all");

MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
MODULE_LICENSE("GPL");
2 changes: 2 additions & 0 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
pos = start_pfn << PAGE_SHIFT;
end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT)
<< (PMD_SHIFT - PAGE_SHIFT);
if (end_pfn > (end >> PAGE_SHIFT))
end_pfn = end >> PAGE_SHIFT;
if (start_pfn < end_pfn) {
nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
pos = end_pfn << PAGE_SHIFT;
Expand Down
149 changes: 96 additions & 53 deletions trunk/arch/x86/mm/kmmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ struct kmmio_fault_page {
struct list_head list;
struct kmmio_fault_page *release_next;
unsigned long page; /* location of the fault page */
bool old_presence; /* page presence prior to arming */
bool armed;

/*
* Number of times this page has been registered as a part
* of a probe. If zero, page is disarmed and this may be freed.
* Used only by writers (RCU).
* Used only by writers (RCU) and post_kmmio_handler().
* Protected by kmmio_lock, when linked into kmmio_page_table.
*/
int count;
};
Expand Down Expand Up @@ -105,57 +108,85 @@ static struct kmmio_fault_page *get_kmmio_fault_page(unsigned long page)
return NULL;
}

static void set_page_present(unsigned long addr, bool present,
unsigned int *pglevel)
static void set_pmd_presence(pmd_t *pmd, bool present, bool *old)
{
pmdval_t v = pmd_val(*pmd);
*old = !!(v & _PAGE_PRESENT);
v &= ~_PAGE_PRESENT;
if (present)
v |= _PAGE_PRESENT;
set_pmd(pmd, __pmd(v));
}

static void set_pte_presence(pte_t *pte, bool present, bool *old)
{
pteval_t v = pte_val(*pte);
*old = !!(v & _PAGE_PRESENT);
v &= ~_PAGE_PRESENT;
if (present)
v |= _PAGE_PRESENT;
set_pte_atomic(pte, __pte(v));
}

static int set_page_presence(unsigned long addr, bool present, bool *old)
{
pteval_t pteval;
pmdval_t pmdval;
unsigned int level;
pmd_t *pmd;
pte_t *pte = lookup_address(addr, &level);

if (!pte) {
pr_err("kmmio: no pte for page 0x%08lx\n", addr);
return;
return -1;
}

if (pglevel)
*pglevel = level;

switch (level) {
case PG_LEVEL_2M:
pmd = (pmd_t *)pte;
pmdval = pmd_val(*pmd) & ~_PAGE_PRESENT;
if (present)
pmdval |= _PAGE_PRESENT;
set_pmd(pmd, __pmd(pmdval));
set_pmd_presence((pmd_t *)pte, present, old);
break;

case PG_LEVEL_4K:
pteval = pte_val(*pte) & ~_PAGE_PRESENT;
if (present)
pteval |= _PAGE_PRESENT;
set_pte_atomic(pte, __pte(pteval));
set_pte_presence(pte, present, old);
break;

default:
pr_err("kmmio: unexpected page level 0x%x.\n", level);
return;
return -1;
}

__flush_tlb_one(addr);
return 0;
}

/** Mark the given page as not present. Access to it will trigger a fault. */
static void arm_kmmio_fault_page(unsigned long page, unsigned int *pglevel)
/*
* Mark the given page as not present. Access to it will trigger a fault.
*
* Struct kmmio_fault_page is protected by RCU and kmmio_lock, but the
* protection is ignored here. RCU read lock is assumed held, so the struct
* will not disappear unexpectedly. Furthermore, the caller must guarantee,
* that double arming the same virtual address (page) cannot occur.
*
* Double disarming on the other hand is allowed, and may occur when a fault
* and mmiotrace shutdown happen simultaneously.
*/
static int arm_kmmio_fault_page(struct kmmio_fault_page *f)
{
set_page_present(page & PAGE_MASK, false, pglevel);
int ret;
WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n");
if (f->armed) {
pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n",
f->page, f->count, f->old_presence);
}
ret = set_page_presence(f->page, false, &f->old_presence);
WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page);
f->armed = true;
return ret;
}

/** Mark the given page as present. */
static void disarm_kmmio_fault_page(unsigned long page, unsigned int *pglevel)
/** Restore the given page to saved presence state. */
static void disarm_kmmio_fault_page(struct kmmio_fault_page *f)
{
set_page_present(page & PAGE_MASK, true, pglevel);
bool tmp;
int ret = set_page_presence(f->page, f->old_presence, &tmp);
WARN_ONCE(ret < 0,
KERN_ERR "kmmio disarming 0x%08lx failed.\n", f->page);
f->armed = false;
}

/*
Expand Down Expand Up @@ -202,28 +233,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr)

ctx = &get_cpu_var(kmmio_ctx);
if (ctx->active) {
disarm_kmmio_fault_page(faultpage->page, NULL);
if (addr == ctx->addr) {
/*
* On SMP we sometimes get recursive probe hits on the
* same address. Context is already saved, fall out.
* A second fault on the same page means some other
* condition needs handling by do_page_fault(), the
* page really not being present is the most common.
*/
pr_debug("kmmio: duplicate probe hit on CPU %d, for "
"address 0x%08lx.\n",
smp_processor_id(), addr);
ret = 1;
goto no_kmmio_ctx;
}
/*
* Prevent overwriting already in-flight context.
* This should not happen, let's hope disarming at least
* prevents a panic.
*/
pr_emerg("kmmio: recursive probe hit on CPU %d, "
pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n",
addr, smp_processor_id());

if (!faultpage->old_presence)
pr_info("kmmio: unexpected secondary hit for "
"address 0x%08lx on CPU %d.\n", addr,
smp_processor_id());
} else {
/*
* Prevent overwriting already in-flight context.
* This should not happen, let's hope disarming at
* least prevents a panic.
*/
pr_emerg("kmmio: recursive probe hit on CPU %d, "
"for address 0x%08lx. Ignoring.\n",
smp_processor_id(), addr);
pr_emerg("kmmio: previous hit was at 0x%08lx.\n",
ctx->addr);
pr_emerg("kmmio: previous hit was at 0x%08lx.\n",
ctx->addr);
disarm_kmmio_fault_page(faultpage);
}
goto no_kmmio_ctx;
}
ctx->active++;
Expand All @@ -244,7 +279,7 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr)
regs->flags &= ~X86_EFLAGS_IF;

/* Now we set present bit in PTE and single step. */
disarm_kmmio_fault_page(ctx->fpage->page, NULL);
disarm_kmmio_fault_page(ctx->fpage);

/*
* If another cpu accesses the same page while we are stepping,
Expand Down Expand Up @@ -275,15 +310,19 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs)
struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx);

if (!ctx->active) {
pr_debug("kmmio: spurious debug trap on CPU %d.\n",
pr_warning("kmmio: spurious debug trap on CPU %d.\n",
smp_processor_id());
goto out;
}

if (ctx->probe && ctx->probe->post_handler)
ctx->probe->post_handler(ctx->probe, condition, regs);

arm_kmmio_fault_page(ctx->fpage->page, NULL);
/* Prevent racing against release_kmmio_fault_page(). */
spin_lock(&kmmio_lock);
if (ctx->fpage->count)
arm_kmmio_fault_page(ctx->fpage);
spin_unlock(&kmmio_lock);

regs->flags &= ~X86_EFLAGS_TF;
regs->flags |= ctx->saved_flags;
Expand Down Expand Up @@ -315,20 +354,24 @@ static int add_kmmio_fault_page(unsigned long page)
f = get_kmmio_fault_page(page);
if (f) {
if (!f->count)
arm_kmmio_fault_page(f->page, NULL);
arm_kmmio_fault_page(f);
f->count++;
return 0;
}

f = kmalloc(sizeof(*f), GFP_ATOMIC);
f = kzalloc(sizeof(*f), GFP_ATOMIC);
if (!f)
return -1;

f->count = 1;
f->page = page;
list_add_rcu(&f->list, kmmio_page_list(f->page));

arm_kmmio_fault_page(f->page, NULL);
if (arm_kmmio_fault_page(f)) {
kfree(f);
return -1;
}

list_add_rcu(&f->list, kmmio_page_list(f->page));

return 0;
}
Expand All @@ -347,7 +390,7 @@ static void release_kmmio_fault_page(unsigned long page,
f->count--;
BUG_ON(f->count < 0);
if (!f->count) {
disarm_kmmio_fault_page(f->page, NULL);
disarm_kmmio_fault_page(f);
f->release_next = *release_list;
*release_list = f;
}
Expand Down
Loading

0 comments on commit a784171

Please sign in to comment.