Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45358
b: refs/heads/master
c: 6aa3e1e
h: refs/heads/master
v: v3
  • Loading branch information
David Gibson authored and Paul Mackerras committed Jan 9, 2007
1 parent 39ba2de commit 0ac8d84
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 51 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: 599c853195f43dfbcbf28b362e6ae80ffa33fec7
refs/heads/master: 6aa3e1e9447134ccda8b04b91c4ba8182274a78e
8 changes: 4 additions & 4 deletions trunk/arch/powerpc/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,8 @@ static int htlb_check_hinted_area(unsigned long addr, unsigned long len)
struct vm_area_struct *vma;

vma = find_vma(current->mm, addr);
if (!vma || ((addr + len) <= vma->vm_start))
if (TASK_SIZE - len >= addr &&
(!vma || ((addr + len) <= vma->vm_start)))
return 0;

return -ENOMEM;
Expand Down Expand Up @@ -815,6 +816,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
return -EINVAL;
if (len & ~HPAGE_MASK)
return -EINVAL;
if (len > TASK_SIZE)
return -ENOMEM;

if (!cpu_has_feature(CPU_FTR_16M_PAGE))
return -EINVAL;
Expand All @@ -823,9 +826,6 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
BUG_ON((addr + len) < addr);

if (test_thread_flag(TIF_32BIT)) {
/* Paranoia, caller should have dealt with this */
BUG_ON((addr + len) > 0x100000000UL);

curareas = current->mm->context.low_htlb_areas;

/* First see if we can use the hint address */
Expand Down
12 changes: 1 addition & 11 deletions trunk/arch/s390/kernel/head31.S
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,11 @@ startup_continue:
srl %r7,28
clr %r6,%r7 # compare cc with last access code
be .Lsame-.LPG1(%r13)
lhi %r8,0 # no program checks
b .Lsavchk-.LPG1(%r13)
b .Lchkmem-.LPG1(%r13)
.Lsame:
ar %r5,%r1 # add 128KB to end of chunk
bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop
.Lchkmem: # > 2GB or tprot got a program check
lhi %r8,1 # set program check flag
.Lsavchk:
clr %r4,%r5 # chunk size > 0?
be .Lchkloop-.LPG1(%r13)
st %r4,0(%r3) # store start address of chunk
Expand All @@ -193,15 +190,8 @@ startup_continue:
je .Ldonemem # if not, leave
chi %r10,0 # do we have chunks left?
je .Ldonemem
chi %r8,1 # program check ?
je .Lpgmchk
lr %r4,%r5 # potential new chunk
alr %r5,%r1 # add 128KB to end of chunk
j .Llpcnt
.Lpgmchk:
alr %r5,%r1 # add 128KB to end of chunk
lr %r4,%r5 # potential new chunk
.Llpcnt:
clr %r5,%r9 # should we go on?
jl .Lloop
.Ldonemem:
Expand Down
12 changes: 1 addition & 11 deletions trunk/arch/s390/kernel/head64.S
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,12 @@ startup_continue:
srl %r7,28
clr %r6,%r7 # compare cc with last access code
je .Lsame
lghi %r8,0 # no program checks
j .Lsavchk
j .Lchkmem
.Lsame:
algr %r5,%r1 # add 128KB to end of chunk
# no need to check here,
brc 12,.Lloop # this is the same chunk
.Lchkmem: # > 16EB or tprot got a program check
lghi %r8,1 # set program check flag
.Lsavchk:
clgr %r4,%r5 # chunk size > 0?
je .Lchkloop
stg %r4,0(%r3) # store start address of chunk
Expand All @@ -207,15 +204,8 @@ startup_continue:
chi %r10, 0 # do we have chunks left?
je .Ldonemem
.Lhsaskip:
chi %r8,1 # program check ?
je .Lpgmchk
lgr %r4,%r5 # potential new chunk
algr %r5,%r1 # add 128KB to end of chunk
j .Llpcnt
.Lpgmchk:
algr %r5,%r1 # add 128KB to end of chunk
lgr %r4,%r5 # potential new chunk
.Llpcnt:
clgr %r5,%r9 # should we go on?
jl .Lloop
.Ldonemem:
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static void __init setup_memory_end(void)
int i;

memory_size = real_size = 0;
max_phys = VMALLOC_END_INIT - VMALLOC_MIN_SIZE;
max_phys = VMALLOC_END - VMALLOC_MIN_SIZE;
memory_end &= PAGE_MASK;

max_mem = memory_end ? min(max_phys, memory_end) : max_phys;
Expand Down
5 changes: 1 addition & 4 deletions trunk/arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,10 +794,7 @@ static int __init topology_init(void)
int ret;

for_each_possible_cpu(cpu) {
struct cpu *c = &per_cpu(cpu_devices, cpu);

c->hotpluggable = 1;
ret = register_cpu(c, cpu);
ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu);
if (ret)
printk(KERN_WARNING "topology_init: register_cpu %d "
"failed (%d)\n", cpu, ret);
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/s390/lib/uaccess_pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

#include <linux/errno.h>
#include <linux/hardirq.h>
#include <linux/mm.h>
#include <asm/uaccess.h>
#include <asm/futex.h>
Expand All @@ -19,8 +18,6 @@ static inline int __handle_fault(struct mm_struct *mm, unsigned long address,
struct vm_area_struct *vma;
int ret = -EFAULT;

if (in_atomic())
return ret;
down_read(&mm->mmap_sem);
vma = find_vma(mm, address);
if (unlikely(!vma))
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/s390/lib/uaccess_std.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ int futex_atomic_op(int op, int __user *uaddr, int oparg, int *old)
{
int oldval = 0, newval, ret;

pagefault_disable();

switch (op) {
case FUTEX_OP_SET:
__futex_atomic_op("lr %2,%5\n",
Expand All @@ -282,6 +284,7 @@ int futex_atomic_op(int op, int __user *uaddr, int oparg, int *old)
default:
ret = -ENOSYS;
}
pagefault_enable();
*old = oldval;
return ret;
}
Expand Down
14 changes: 6 additions & 8 deletions trunk/drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,11 +1117,10 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_h
static void quirk_sis_96x_smbus(struct pci_dev *dev)
{
u8 val = 0;
printk(KERN_INFO "Enabling SiS 96x SMBus.\n");
pci_read_config_byte(dev, 0x77, &val);
pci_write_config_byte(dev, 0x77, val & ~0x10);
pci_read_config_byte(dev, 0x77, &val);
if (val & 0x10) {
printk(KERN_INFO "Enabling SiS 96x SMBus.\n");
pci_write_config_byte(dev, 0x77, val & ~0x10);
}
}

/*
Expand Down Expand Up @@ -1153,12 +1152,11 @@ static void quirk_sis_503(struct pci_dev *dev)
printk(KERN_WARNING "Uncovering SIS%x that hid as a SIS503 (compatible=%d)\n", devid, sis_96x_compatible);

/*
* Ok, it now shows up as a 96x.. run the 96x quirk by
* hand in case it has already been processed.
* (depends on link order, which is apparently not guaranteed)
* Ok, it now shows up as a 96x.. The 96x quirks are after
* the 503 quirk in the quirk table, so they'll automatically
* run and enable things like the SMBus device
*/
dev->device = devid;
quirk_sis_96x_smbus(dev);
}

static void __init quirk_sis_96x_compatible(struct pci_dev *dev)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/s390/char/vmcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ vmcp_write(struct file *file, const char __user * buff, size_t count,
return -ENOMEM;
}
debug_text_event(vmcp_debug, 1, cmd);
session->resp_size = cpcmd(cmd, session->response,
session->resp_size = __cpcmd(cmd, session->response,
session->bufsize,
&session->resp_code);
up(&session->mutex);
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/s390/cio/cio.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,15 +880,19 @@ static void cio_reset_pgm_check_handler(void)
static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr)
{
int rc;
register struct subchannel_id reg1 asm ("1") = schid;

pgm_check_occured = 0;
s390_reset_pgm_handler = cio_reset_pgm_check_handler;
rc = stsch(schid, addr);
s390_reset_pgm_handler = NULL;

/* The program check handler could have changed pgm_check_occured */
barrier();
asm volatile(
" stsch 0(%2)\n"
" ipm %0\n"
" srl %0,28"
: "=d" (rc)
: "d" (reg1), "a" (addr), "m" (*addr) : "memory", "cc");

s390_reset_pgm_handler = NULL;
if (pgm_check_occured)
return -EIO;
else
Expand Down
4 changes: 1 addition & 3 deletions trunk/include/asm-s390/futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#ifdef __KERNEL__

#include <linux/futex.h>
#include <linux/uaccess.h>
#include <asm/errno.h>
#include <asm/uaccess.h>

static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
{
Expand All @@ -21,9 +21,7 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
return -EFAULT;

pagefault_disable();
ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval);
pagefault_enable();

if (!ret) {
switch (cmp) {
Expand Down

0 comments on commit 0ac8d84

Please sign in to comment.