Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223325
b: refs/heads/master
c: 2b3e502
h: refs/heads/master
i:
  223323: 96f6853
v: v3
  • Loading branch information
Ralf Baechle committed Dec 16, 2010
1 parent bd080c9 commit bc0c701
Show file tree
Hide file tree
Showing 12 changed files with 82 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: b3444d164be8f977f4133ef0c6f4a18f2741373f
refs/heads/master: 2b3e50234eafc40a04f5f4a2b7bb24b506fd7e87
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 = 37
EXTRAVERSION = -rc6
EXTRAVERSION = -rc5
NAME = Flesh-Eating Bats with Fangs

# *DOCUMENTATION*
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/mips/sibyte/swarm/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int swarm_be_handler(struct pt_regs *regs, int is_fixup)
enum swarm_rtc_type {
RTC_NONE,
RTC_XICOR,
RTC_M4LT81
RTC_M41T81,
};

enum swarm_rtc_type swarm_rtc_type;
Expand All @@ -96,7 +96,7 @@ void read_persistent_clock(struct timespec *ts)
sec = xicor_get_time();
break;

case RTC_M4LT81:
case RTC_M41T81:
sec = m41t81_get_time();
break;

Expand All @@ -115,7 +115,7 @@ int rtc_mips_set_time(unsigned long sec)
case RTC_XICOR:
return xicor_set_time(sec);

case RTC_M4LT81:
case RTC_M41T81:
return m41t81_set_time(sec);

case RTC_NONE:
Expand All @@ -141,7 +141,7 @@ void __init plat_mem_setup(void)
if (xicor_probe())
swarm_rtc_type = RTC_XICOR;
if (m41t81_probe())
swarm_rtc_type = RTC_M4LT81;
swarm_rtc_type = RTC_M41T81;

#ifdef CONFIG_VT
screen_info = (struct screen_info) {
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/crypto/ghash-clmulni-intel_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* by the Free Software Foundation.
*/

#include <linux/err.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,13 @@ ENTRY(initial_code)
__PAGE_ALIGNED_BSS
.align PAGE_SIZE_asm
#ifdef CONFIG_X86_PAE
ENTRY(initial_pg_pmd)
initial_pg_pmd:
.fill 1024*KPMDS,4,0
#else
ENTRY(initial_page_table)
.fill 1024,4,0
#endif
ENTRY(initial_pg_fixmap)
initial_pg_fixmap:
.fill 1024,4,0
ENTRY(empty_zero_page)
.fill 4096,1,0
Expand Down
16 changes: 8 additions & 8 deletions trunk/arch/x86/lguest/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,7 @@ static void lguest_write_cr3(unsigned long cr3)
{
lguest_data.pgdir = cr3;
lazy_hcall1(LHCALL_NEW_PGTABLE, cr3);

/* These two page tables are simple, linear, and used during boot */
if (cr3 != __pa(swapper_pg_dir) && cr3 != __pa(initial_page_table))
cr3_changed = true;
cr3_changed = true;
}

static unsigned long lguest_read_cr3(void)
Expand Down Expand Up @@ -706,9 +703,9 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
* to forget all of them. Fortunately, this is very rare.
*
* ... except in early boot when the kernel sets up the initial pagetables,
* which makes booting astonishingly slow: 48 seconds! So we don't even tell
* the Host anything changed until we've done the first real page table switch,
* which brings boot back to 4.3 seconds.
* which makes booting astonishingly slow: 1.83 seconds! So we don't even tell
* the Host anything changed until we've done the first page table switch,
* which brings boot back to 0.25 seconds.
*/
static void lguest_set_pte(pte_t *ptep, pte_t pteval)
{
Expand Down Expand Up @@ -1005,7 +1002,7 @@ static void lguest_time_init(void)
clockevents_register_device(&lguest_clockevent);

/* Finally, we unblock the timer interrupt. */
clear_bit(0, lguest_data.blocked_interrupts);
enable_lguest_irq(0);
}

/*
Expand Down Expand Up @@ -1352,6 +1349,9 @@ __init void lguest_init(void)
*/
switch_to_new_gdt(0);

/* We actually boot with all memory mapped, but let's say 128MB. */
max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT;

/*
* The Host<->Guest Switcher lives at the top of our address space, and
* the Host told us how big it is when we made LGUEST_INIT hypercall:
Expand Down
105 changes: 0 additions & 105 deletions trunk/arch/x86/lguest/i386_head.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/processor-flags.h>
#include <asm/pgtable.h>

/*G:020
* Our story starts with the kernel booting into startup_32 in
Expand Down Expand Up @@ -38,113 +37,9 @@ ENTRY(lguest_entry)
/* Set up the initial stack so we can run C code. */
movl $(init_thread_union+THREAD_SIZE),%esp

call init_pagetables

/* Jumps are relative: we're running __PAGE_OFFSET too low. */
jmp lguest_init+__PAGE_OFFSET

/*
* Initialize page tables. This creates a PDE and a set of page
* tables, which are located immediately beyond __brk_base. The variable
* _brk_end is set up to point to the first "safe" location.
* Mappings are created both at virtual address 0 (identity mapping)
* and PAGE_OFFSET for up to _end.
*
* FIXME: This code is taken verbatim from arch/x86/kernel/head_32.S: they
* don't have a stack at this point, so we can't just use call and ret.
*/
init_pagetables:
#if PTRS_PER_PMD > 1
#define PAGE_TABLE_SIZE(pages) (((pages) / PTRS_PER_PMD) + PTRS_PER_PGD)
#else
#define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
#endif
#define pa(X) ((X) - __PAGE_OFFSET)

/* Enough space to fit pagetables for the low memory linear map */
MAPPING_BEYOND_END = \
PAGE_TABLE_SIZE(((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) << PAGE_SHIFT
#ifdef CONFIG_X86_PAE

/*
* In PAE mode initial_page_table is statically defined to contain
* enough entries to cover the VMSPLIT option (that is the top 1, 2 or 3
* entries). The identity mapping is handled by pointing two PGD entries
* to the first kernel PMD.
*
* Note the upper half of each PMD or PTE are always zero at this stage.
*/

#define KPMDS (((-__PAGE_OFFSET) >> 30) & 3) /* Number of kernel PMDs */

xorl %ebx,%ebx /* %ebx is kept at zero */

movl $pa(__brk_base), %edi
movl $pa(initial_pg_pmd), %edx
movl $PTE_IDENT_ATTR, %eax
10:
leal PDE_IDENT_ATTR(%edi),%ecx /* Create PMD entry */
movl %ecx,(%edx) /* Store PMD entry */
/* Upper half already zero */
addl $8,%edx
movl $512,%ecx
11:
stosl
xchgl %eax,%ebx
stosl
xchgl %eax,%ebx
addl $0x1000,%eax
loop 11b

/*
* End condition: we must map up to the end + MAPPING_BEYOND_END.
*/
movl $pa(_end) + MAPPING_BEYOND_END + PTE_IDENT_ATTR, %ebp
cmpl %ebp,%eax
jb 10b
1:
addl $__PAGE_OFFSET, %edi
movl %edi, pa(_brk_end)
shrl $12, %eax
movl %eax, pa(max_pfn_mapped)

/* Do early initialization of the fixmap area */
movl $pa(initial_pg_fixmap)+PDE_IDENT_ATTR,%eax
movl %eax,pa(initial_pg_pmd+0x1000*KPMDS-8)
#else /* Not PAE */

page_pde_offset = (__PAGE_OFFSET >> 20);

movl $pa(__brk_base), %edi
movl $pa(initial_page_table), %edx
movl $PTE_IDENT_ATTR, %eax
10:
leal PDE_IDENT_ATTR(%edi),%ecx /* Create PDE entry */
movl %ecx,(%edx) /* Store identity PDE entry */
movl %ecx,page_pde_offset(%edx) /* Store kernel PDE entry */
addl $4,%edx
movl $1024, %ecx
11:
stosl
addl $0x1000,%eax
loop 11b
/*
* End condition: we must map up to the end + MAPPING_BEYOND_END.
*/
movl $pa(_end) + MAPPING_BEYOND_END + PTE_IDENT_ATTR, %ebp
cmpl %ebp,%eax
jb 10b
addl $__PAGE_OFFSET, %edi
movl %edi, pa(_brk_end)
shrl $12, %eax
movl %eax, pa(max_pfn_mapped)

/* Do early initialization of the fixmap area */
movl $pa(initial_pg_fixmap)+PDE_IDENT_ATTR,%eax
movl %eax,pa(initial_page_table+0xffc)
#endif
ret

/*G:055
* We create a macro which puts the assembler code between lgstart_ and lgend_
* markers. These templates are put in the .text section: they can't be
Expand Down
113 changes: 55 additions & 58 deletions trunk/drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,73 +534,76 @@ static int handle_eviocgbit(struct input_dev *dev,
}
#undef OLD_KEY_MAX

static int evdev_handle_get_keycode(struct input_dev *dev, void __user *p)
static int evdev_handle_get_keycode(struct input_dev *dev,
void __user *p, size_t size)
{
struct input_keymap_entry ke = {
.len = sizeof(unsigned int),
.flags = 0,
};
int __user *ip = (int __user *)p;
struct input_keymap_entry ke;
int error;

/* legacy case */
if (copy_from_user(ke.scancode, p, sizeof(unsigned int)))
return -EFAULT;
memset(&ke, 0, sizeof(ke));

error = input_get_keycode(dev, &ke);
if (error)
return error;
if (size == sizeof(unsigned int[2])) {
/* legacy case */
int __user *ip = (int __user *)p;

if (put_user(ke.keycode, ip + 1))
return -EFAULT;
if (copy_from_user(ke.scancode, p, sizeof(unsigned int)))
return -EFAULT;

return 0;
}
ke.len = sizeof(unsigned int);
ke.flags = 0;

static int evdev_handle_get_keycode_v2(struct input_dev *dev, void __user *p)
{
struct input_keymap_entry ke;
int error;
error = input_get_keycode(dev, &ke);
if (error)
return error;

if (copy_from_user(&ke, p, sizeof(ke)))
return -EFAULT;
if (put_user(ke.keycode, ip + 1))
return -EFAULT;

error = input_get_keycode(dev, &ke);
if (error)
return error;
} else {
size = min(size, sizeof(ke));

if (copy_to_user(p, &ke, sizeof(ke)))
return -EFAULT;
if (copy_from_user(&ke, p, size))
return -EFAULT;

error = input_get_keycode(dev, &ke);
if (error)
return error;

if (copy_to_user(p, &ke, size))
return -EFAULT;
}
return 0;
}

static int evdev_handle_set_keycode(struct input_dev *dev, void __user *p)
static int evdev_handle_set_keycode(struct input_dev *dev,
void __user *p, size_t size)
{
struct input_keymap_entry ke = {
.len = sizeof(unsigned int),
.flags = 0,
};
int __user *ip = (int __user *)p;
struct input_keymap_entry ke;

if (copy_from_user(ke.scancode, p, sizeof(unsigned int)))
return -EFAULT;
memset(&ke, 0, sizeof(ke));

if (get_user(ke.keycode, ip + 1))
return -EFAULT;
if (size == sizeof(unsigned int[2])) {
/* legacy case */
int __user *ip = (int __user *)p;

return input_set_keycode(dev, &ke);
}
if (copy_from_user(ke.scancode, p, sizeof(unsigned int)))
return -EFAULT;

static int evdev_handle_set_keycode_v2(struct input_dev *dev, void __user *p)
{
struct input_keymap_entry ke;
if (get_user(ke.keycode, ip + 1))
return -EFAULT;

if (copy_from_user(&ke, p, sizeof(ke)))
return -EFAULT;
ke.len = sizeof(unsigned int);
ke.flags = 0;

if (ke.len > sizeof(ke.scancode))
return -EINVAL;
} else {
size = min(size, sizeof(ke));

if (copy_from_user(&ke, p, size))
return -EFAULT;

if (ke.len > sizeof(ke.scancode))
return -EINVAL;
}

return input_set_keycode(dev, &ke);
}
Expand Down Expand Up @@ -666,18 +669,6 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
return evdev_grab(evdev, client);
else
return evdev_ungrab(evdev, client);

case EVIOCGKEYCODE:
return evdev_handle_get_keycode(dev, p);

case EVIOCSKEYCODE:
return evdev_handle_set_keycode(dev, p);

case EVIOCGKEYCODE_V2:
return evdev_handle_get_keycode_v2(dev, p);

case EVIOCSKEYCODE_V2:
return evdev_handle_set_keycode_v2(dev, p);
}

size = _IOC_SIZE(cmd);
Expand Down Expand Up @@ -717,6 +708,12 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
return -EFAULT;

return error;

case EVIOC_MASK_SIZE(EVIOCGKEYCODE):
return evdev_handle_get_keycode(dev, p, size);

case EVIOC_MASK_SIZE(EVIOCSKEYCODE):
return evdev_handle_set_keycode(dev, p, size);
}

/* Multi-number variable-length handlers */
Expand Down
Loading

0 comments on commit bc0c701

Please sign in to comment.