Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147974
b: refs/heads/master
c: 713b15b
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell committed Jun 12, 2009
1 parent f961a5a commit 034936f
Show file tree
Hide file tree
Showing 113 changed files with 1,244 additions and 2,286 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: 16ffc3eeaa00d513b0076b7b2b96419f28acc912
refs/heads/master: 713b15b3781240653d2b38414da3f4567dcbcf91
2 changes: 0 additions & 2 deletions trunk/Documentation/ide/ide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ Other kernel parameters for ide_core are:

* "noflush=[interface_number.device_number]" to disable flush requests

* "nohpa=[interface_number.device_number]" to disable Host Protected Area

* "noprobe=[interface_number.device_number]" to skip probing

* "nowerr=[interface_number.device_number]" to ignore the WRERR_STAT bit
Expand Down
7 changes: 5 additions & 2 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,11 @@ and is between 256 and 4096 characters. It is defined in the file

ide-core.nodma= [HW] (E)IDE subsystem
Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
.vlb_clock .pci_clock .noflush .nohpa .noprobe .nowerr
.cdrom .chs .ignore_cable are additional options
.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
.chs .ignore_cable are additional options
See Documentation/ide/ide.txt.

idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
See Documentation/ide/ide.txt.

ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
Expand Down
27 changes: 17 additions & 10 deletions trunk/Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ struct device
/* The linked-list pointer. */
struct device *next;

/* The this device's descriptor, as mapped into the Guest. */
/* The device's descriptor, as mapped into the Guest. */
struct lguest_device_desc *desc;

/* We can't trust desc values once Guest has booted: we use these. */
unsigned int feature_len;
unsigned int num_vq;

/* The name of this device, for --verbose. */
const char *name;

Expand Down Expand Up @@ -245,7 +249,7 @@ static void iov_consume(struct iovec iov[], unsigned num_iov, unsigned len)
static u8 *get_feature_bits(struct device *dev)
{
return (u8 *)(dev->desc + 1)
+ dev->desc->num_vq * sizeof(struct lguest_vqconfig);
+ dev->num_vq * sizeof(struct lguest_vqconfig);
}

/*L:100 The Launcher code itself takes us out into userspace, that scary place
Expand Down Expand Up @@ -979,8 +983,8 @@ static void update_device_status(struct device *dev)
verbose("Resetting device %s\n", dev->name);

/* Clear any features they've acked. */
memset(get_feature_bits(dev) + dev->desc->feature_len, 0,
dev->desc->feature_len);
memset(get_feature_bits(dev) + dev->feature_len, 0,
dev->feature_len);

/* Zero out the virtqueues. */
for (vq = dev->vq; vq; vq = vq->next) {
Expand All @@ -994,12 +998,12 @@ static void update_device_status(struct device *dev)
unsigned int i;

verbose("Device %s OK: offered", dev->name);
for (i = 0; i < dev->desc->feature_len; i++)
for (i = 0; i < dev->feature_len; i++)
verbose(" %02x", get_feature_bits(dev)[i]);
verbose(", accepted");
for (i = 0; i < dev->desc->feature_len; i++)
for (i = 0; i < dev->feature_len; i++)
verbose(" %02x", get_feature_bits(dev)
[dev->desc->feature_len+i]);
[dev->feature_len+i]);

if (dev->ready)
dev->ready(dev);
Expand Down Expand Up @@ -1129,8 +1133,8 @@ static void handle_input(int fd)
static u8 *device_config(const struct device *dev)
{
return (void *)(dev->desc + 1)
+ dev->desc->num_vq * sizeof(struct lguest_vqconfig)
+ dev->desc->feature_len * 2;
+ dev->num_vq * sizeof(struct lguest_vqconfig)
+ dev->feature_len * 2;
}

/* This routine allocates a new "struct lguest_device_desc" from descriptor
Expand Down Expand Up @@ -1191,6 +1195,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
* yet, otherwise we'd be overwriting them. */
assert(dev->desc->config_len == 0 && dev->desc->feature_len == 0);
memcpy(device_config(dev), &vq->config, sizeof(vq->config));
dev->num_vq++;
dev->desc->num_vq++;

verbose("Virtqueue page %#lx\n", to_guest_phys(p));
Expand Down Expand Up @@ -1219,7 +1224,7 @@ static void add_feature(struct device *dev, unsigned bit)
/* We can't extend the feature bits once we've added config bytes */
if (dev->desc->feature_len <= bit / CHAR_BIT) {
assert(dev->desc->config_len == 0);
dev->desc->feature_len = (bit / CHAR_BIT) + 1;
dev->feature_len = dev->desc->feature_len = (bit/CHAR_BIT) + 1;
}

features[bit / CHAR_BIT] |= (1 << (bit % CHAR_BIT));
Expand Down Expand Up @@ -1259,6 +1264,8 @@ static struct device *new_device(const char *name, u16 type, int fd,
dev->name = name;
dev->vq = NULL;
dev->ready = NULL;
dev->feature_len = 0;
dev->num_vq = 0;

/* Append to device list. Prepending to a single-linked list is
* easier, but the user expects the devices to be arranged on the bus
Expand Down
21 changes: 0 additions & 21 deletions trunk/arch/alpha/mm/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,6 @@ void sort_extable(struct exception_table_entry *start,
cmp_ex, swap_ex);
}

#ifdef CONFIG_MODULES
/*
* Any entry referring to the module init will be at the beginning or
* the end.
*/
void trim_init_extable(struct module *m)
{
/*trim the beginning*/
while (m->num_exentries &&
within_module_init(ex_to_addr(&m->extable[0]), m)) {
m->extable++;
m->num_exentries--;
}
/*trim the end*/
while (m->num_exentries &&
within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]),
m))
m->num_exentries--;
}
#endif /* CONFIG_MODULES */

const struct exception_table_entry *
search_extable(const struct exception_table_entry *first,
const struct exception_table_entry *last,
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/avr32/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ void module_free(struct module *mod, void *module_region)
mod->arch.syminfo = NULL;

vfree(module_region);
/* FIXME: if module_region == mod->init_region, trim exception
* table entries. */
}

static inline int check_rela(Elf32_Rela *rela, struct module *module,
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/cris/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
FREE_MODULE(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* We don't need anything special. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/frv/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* We don't need anything special. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/h8300/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* We don't need anything special. */
Expand Down
26 changes: 0 additions & 26 deletions trunk/arch/ia64/mm/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,6 @@ void sort_extable (struct exception_table_entry *start,
cmp_ex, swap_ex);
}

static inline unsigned long ex_to_addr(const struct exception_table_entry *x)
{
return (unsigned long)&x->insn + x->insn;
}

#ifdef CONFIG_MODULES
/*
* Any entry referring to the module init will be at the beginning or
* the end.
*/
void trim_init_extable(struct module *m)
{
/*trim the beginning*/
while (m->num_exentries &&
within_module_init(ex_to_addr(&m->extable[0]), m)) {
m->extable++;
m->num_exentries--;
}
/*trim the end*/
while (m->num_exentries &&
within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]),
m))
m->num_exentries--;
}
#endif /* CONFIG_MODULES */

const struct exception_table_entry *
search_extable (const struct exception_table_entry *first,
const struct exception_table_entry *last,
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m32r/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* We don't need anything special. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m68k/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* We don't need anything special. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m68knommu/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* We don't need anything special. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/mips/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/mn10300/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
* table entries. */
}

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/parisc/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ void module_free(struct module *mod, void *module_region)
mod->arch.section = NULL;

vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* Additional bytes needed in front of individual sections */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/s390/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

static void
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/sh/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* We don't need anything special. */
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/sparc/include/asm/uaccess_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

#ifndef __ASSEMBLY__

#define ARCH_HAS_SORT_EXTABLE
#define ARCH_HAS_SEARCH_EXTABLE

/* Sparc is not segmented, however we need to be able to fool access_ok()
* when doing system calls from kernel mode legitimately.
*
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/sparc/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}

/* Make generic code ignore STT_REGISTER dummy undefined symbols. */
Expand Down
29 changes: 0 additions & 29 deletions trunk/arch/sparc/mm/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ search_extable(const struct exception_table_entry *start,
* word 3: last insn address + 4 bytes
* word 4: fixup code address
*
* Deleted entries are encoded as:
* word 1: unused
* word 2: -1
*
* See asm/uaccess.h for more details.
*/

Expand All @@ -43,10 +39,6 @@ search_extable(const struct exception_table_entry *start,
continue;
}

/* A deleted entry; see trim_init_extable */
if (walk->fixup == -1)
continue;

if (walk->insn == value)
return walk;
}
Expand All @@ -65,27 +57,6 @@ search_extable(const struct exception_table_entry *start,
return NULL;
}

#ifdef CONFIG_MODULES
/* We could memmove them around; easier to mark the trimmed ones. */
void trim_init_extable(struct module *m)
{
unsigned int i;
bool range;

for (i = 0; i < m->num_exentries; i += range ? 2 : 1) {
range = m->extable[i].fixup == 0;

if (within_module_init(m->extable[i].insn, m)) {
m->extable[i].fixup = -1;
if (range)
m->extable[i+1].fixup = -1;
}
if (range)
i++;
}
}
#endif /* CONFIG_MODULES */

/* Special extable search, which handles ranges. Returns fixup */
unsigned long search_extables_range(unsigned long addr, unsigned long *g2)
{
Expand Down
7 changes: 1 addition & 6 deletions trunk/arch/um/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,16 @@ extern unsigned long end_iomem;
#else
# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
#endif
#define MODULES_VADDR VMALLOC_START
#define MODULES_END VMALLOC_END
#define MODULES_LEN (MODULES_VADDR - MODULES_END)

#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)

#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)

/*
* The i386 can't do page protection for execute, and considers that the same
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/sys-i386/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \

subarch-obj-y = lib/semaphore_32.o lib/string_32.o
subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
subarch-obj-$(CONFIG_MODULES) += kernel/module.o
subarch-obj-$(CONFIG_MODULES) += kernel/module_32.o

USER_OBJS := bugs.o ptrace_user.o fault.o

Expand Down
Loading

0 comments on commit 034936f

Please sign in to comment.