Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276657
b: refs/heads/master
c: b5a7e97
h: refs/heads/master
i:
  276655: 587619f
v: v3
  • Loading branch information
Theodore Ts'o committed Dec 12, 2011
1 parent ed53fcc commit 2e1c7fb
Show file tree
Hide file tree
Showing 54 changed files with 608 additions and 567 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: 30aaca4582eac20a52ac7b2ec35bdb908133e5b1
refs/heads/master: b5a7e97039a80fae673ccc115ce595d5b88fb4ee
7 changes: 7 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-bus-rbd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ create_snap

$ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_create

rollback_snap

Rolls back data to the specified snapshot. This goes over the entire
list of rados blocks and sends a rollback command to each.

$ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_rollback

snap_*

A directory per each snapshot
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ config NEED_MACH_MEMORY_H
be avoided when possible.

config PHYS_OFFSET
hex "Physical address of main memory" if MMU
hex "Physical address of main memory"
depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
default DRAM_BASE if !MMU
help
Please provide the physical address corresponding to the
location of main memory in your system.
Expand Down
16 changes: 12 additions & 4 deletions trunk/arch/arm/include/asm/unwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ enum unwind_reason_code {
};

struct unwind_idx {
unsigned long addr_offset;
unsigned long addr;
unsigned long insn;
};

struct unwind_table {
struct list_head list;
const struct unwind_idx *start;
const struct unwind_idx *origin;
const struct unwind_idx *stop;
struct unwind_idx *start;
struct unwind_idx *stop;
unsigned long begin_addr;
unsigned long end_addr;
};
Expand All @@ -50,6 +49,15 @@ extern struct unwind_table *unwind_table_add(unsigned long start,
extern void unwind_table_del(struct unwind_table *tab);
extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk);

#ifdef CONFIG_ARM_UNWIND
extern int __init unwind_init(void);
#else
static inline int __init unwind_init(void)
{
return 0;
}
#endif

#endif /* !__ASSEMBLY__ */

#ifdef CONFIG_ARM_UNWIND
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,6 @@ static struct platform_device_id armpmu_plat_device_ids[] = {

static int __devinit armpmu_device_probe(struct platform_device *pdev)
{
if (!cpu_pmu)
return -ENODEV;

cpu_pmu->plat_device = pdev;
return 0;
}
Expand Down
14 changes: 8 additions & 6 deletions trunk/arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,19 +895,15 @@ void __init setup_arch(char **cmdline_p)
{
struct machine_desc *mdesc;

unwind_init();

setup_processor();
mdesc = setup_machine_fdt(__atags_pointer);
if (!mdesc)
mdesc = setup_machine_tags(machine_arch_type);
machine_desc = mdesc;
machine_name = mdesc->name;

#ifdef CONFIG_ZONE_DMA
if (mdesc->dma_zone_size) {
extern unsigned long arm_dma_zone_size;
arm_dma_zone_size = mdesc->dma_zone_size;
}
#endif
if (mdesc->soft_reboot)
reboot_setup("s");

Expand Down Expand Up @@ -938,6 +934,12 @@ void __init setup_arch(char **cmdline_p)

tcm_init();

#ifdef CONFIG_ZONE_DMA
if (mdesc->dma_zone_size) {
extern unsigned long arm_dma_zone_size;
arm_dma_zone_size = mdesc->dma_zone_size;
}
#endif
#ifdef CONFIG_MULTI_IRQ_HANDLER
handle_arch_irq = mdesc->handle_irq;
#endif
Expand Down
129 changes: 45 additions & 84 deletions trunk/arch/arm/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ EXPORT_SYMBOL(__aeabi_unwind_cpp_pr2);

struct unwind_ctrl_block {
unsigned long vrs[16]; /* virtual register set */
const unsigned long *insn; /* pointer to the current instructions word */
unsigned long *insn; /* pointer to the current instructions word */
int entries; /* number of entries left to interpret */
int byte; /* current byte number in the instructions word */
};
Expand All @@ -83,9 +83,8 @@ enum regs {
PC = 15
};

extern const struct unwind_idx __start_unwind_idx[];
static const struct unwind_idx *__origin_unwind_idx;
extern const struct unwind_idx __stop_unwind_idx[];
extern struct unwind_idx __start_unwind_idx[];
extern struct unwind_idx __stop_unwind_idx[];

static DEFINE_SPINLOCK(unwind_lock);
static LIST_HEAD(unwind_tables);
Expand All @@ -99,99 +98,45 @@ static LIST_HEAD(unwind_tables);
})

/*
* Binary search in the unwind index. The entries are
* Binary search in the unwind index. The entries entries are
* guaranteed to be sorted in ascending order by the linker.
*
* start = first entry
* origin = first entry with positive offset (or stop if there is no such entry)
* stop - 1 = last entry
*/
static const struct unwind_idx *search_index(unsigned long addr,
const struct unwind_idx *start,
const struct unwind_idx *origin,
const struct unwind_idx *stop)
static struct unwind_idx *search_index(unsigned long addr,
struct unwind_idx *first,
struct unwind_idx *last)
{
unsigned long addr_prel31;

pr_debug("%s(%08lx, %p, %p, %p)\n",
__func__, addr, start, origin, stop);

/*
* only search in the section with the matching sign. This way the
* prel31 numbers can be compared as unsigned longs.
*/
if (addr < (unsigned long)start)
/* negative offsets: [start; origin) */
stop = origin;
else
/* positive offsets: [origin; stop) */
start = origin;

/* prel31 for address relavive to start */
addr_prel31 = (addr - (unsigned long)start) & 0x7fffffff;
pr_debug("%s(%08lx, %p, %p)\n", __func__, addr, first, last);

while (start < stop - 1) {
const struct unwind_idx *mid = start + ((stop - start) >> 1);

/*
* As addr_prel31 is relative to start an offset is needed to
* make it relative to mid.
*/
if (addr_prel31 - ((unsigned long)mid - (unsigned long)start) <
mid->addr_offset)
stop = mid;
else {
/* keep addr_prel31 relative to start */
addr_prel31 -= ((unsigned long)mid -
(unsigned long)start);
start = mid;
}
}

if (likely(start->addr_offset <= addr_prel31))
return start;
else {
if (addr < first->addr) {
pr_warning("unwind: Unknown symbol address %08lx\n", addr);
return NULL;
}
}
} else if (addr >= last->addr)
return last;

static const struct unwind_idx *unwind_find_origin(
const struct unwind_idx *start, const struct unwind_idx *stop)
{
pr_debug("%s(%p, %p)\n", __func__, start, stop);
while (start < stop - 1) {
const struct unwind_idx *mid = start + ((stop - start) >> 1);
while (first < last - 1) {
struct unwind_idx *mid = first + ((last - first + 1) >> 1);

if (mid->addr_offset >= 0x40000000)
/* negative offset */
start = mid;
if (addr < mid->addr)
last = mid;
else
/* positive offset */
stop = mid;
first = mid;
}
pr_debug("%s -> %p\n", __func__, stop);
return stop;

return first;
}

static const struct unwind_idx *unwind_find_idx(unsigned long addr)
static struct unwind_idx *unwind_find_idx(unsigned long addr)
{
const struct unwind_idx *idx = NULL;
struct unwind_idx *idx = NULL;
unsigned long flags;

pr_debug("%s(%08lx)\n", __func__, addr);

if (core_kernel_text(addr)) {
if (unlikely(!__origin_unwind_idx))
__origin_unwind_idx =
unwind_find_origin(__start_unwind_idx,
__stop_unwind_idx);

if (core_kernel_text(addr))
/* main unwind table */
idx = search_index(addr, __start_unwind_idx,
__origin_unwind_idx,
__stop_unwind_idx);
} else {
__stop_unwind_idx - 1);
else {
/* module unwind tables */
struct unwind_table *table;

Expand All @@ -200,8 +145,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr)
if (addr >= table->begin_addr &&
addr < table->end_addr) {
idx = search_index(addr, table->start,
table->origin,
table->stop);
table->stop - 1);
/* Move-to-front to exploit common traces */
list_move(&table->list, &unwind_tables);
break;
Expand Down Expand Up @@ -330,7 +274,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
int unwind_frame(struct stackframe *frame)
{
unsigned long high, low;
const struct unwind_idx *idx;
struct unwind_idx *idx;
struct unwind_ctrl_block ctrl;

/* only go to a higher address on the stack */
Expand Down Expand Up @@ -455,6 +399,7 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
unsigned long text_size)
{
unsigned long flags;
struct unwind_idx *idx;
struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL);

pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size,
Expand All @@ -463,12 +408,15 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
if (!tab)
return tab;

tab->start = (const struct unwind_idx *)start;
tab->stop = (const struct unwind_idx *)(start + size);
tab->origin = unwind_find_origin(tab->start, tab->stop);
tab->start = (struct unwind_idx *)start;
tab->stop = (struct unwind_idx *)(start + size);
tab->begin_addr = text_addr;
tab->end_addr = text_addr + text_size;

/* Convert the symbol addresses to absolute values */
for (idx = tab->start; idx < tab->stop; idx++)
idx->addr = prel31_to_addr(&idx->addr);

spin_lock_irqsave(&unwind_lock, flags);
list_add_tail(&tab->list, &unwind_tables);
spin_unlock_irqrestore(&unwind_lock, flags);
Expand All @@ -489,3 +437,16 @@ void unwind_table_del(struct unwind_table *tab)

kfree(tab);
}

int __init unwind_init(void)
{
struct unwind_idx *idx;

/* Convert the symbol addresses to absolute values */
for (idx = __start_unwind_idx; idx < __stop_unwind_idx; idx++)
idx->addr = prel31_to_addr(&idx->addr);

pr_debug("unwind: ARM stack unwinding initialised\n");

return 0;
}
8 changes: 8 additions & 0 deletions trunk/arch/x86/include/asm/e820.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
*/
#define E820_RESERVED_KERN 128

/*
* Address ranges that need to be mapped by the kernel direct
* mapping. This is used to make sure regions such as
* EFI_RUNTIME_SERVICES_DATA are directly mapped. See setup_arch().
*/
#define E820_RESERVED_EFI 129

#ifndef __ASSEMBLY__
#include <linux/types.h>
struct e820entry {
Expand Down Expand Up @@ -115,6 +122,7 @@ static inline void early_memtest(unsigned long start, unsigned long end)
}
#endif

extern unsigned long e820_end_pfn(unsigned long limit_pfn, unsigned type);
extern unsigned long e820_end_of_ram_pfn(void);
extern unsigned long e820_end_of_low_ram_pfn(void);
extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align);
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/x86/include/asm/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ 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)

#else /* !CONFIG_X86_32 */

extern u64 efi_call0(void *fp);
Expand Down Expand Up @@ -84,9 +82,6 @@ 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);

#endif /* CONFIG_X86_32 */

extern int add_efi_memmap;
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ static void __init e820_print_type(u32 type)
printk(KERN_CONT "(usable)");
break;
case E820_RESERVED:
case E820_RESERVED_EFI:
printk(KERN_CONT "(reserved)");
break;
case E820_ACPI:
Expand Down Expand Up @@ -783,7 +784,7 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align)
/*
* Find the highest page frame number we have available
*/
static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
{
int i;
unsigned long last_pfn = 0;
Expand Down
Loading

0 comments on commit 2e1c7fb

Please sign in to comment.