13 Mar, 2009

1 commit


11 Mar, 2009

1 commit


10 Mar, 2009

1 commit

  • Defining flash partition table in platform code is deprecated, and due to
    recent changes linkstation and storcenter do not compile any more with
    their default configurations because of undefined references to
    physmap_set_partitions(). Instead of fixing them by using the correct
    kernel configuration macro in preprocessor conditional, remove partition
    table definitions altogether. Instead add support for partition definition
    on the command-line and in device tree to the default configurations.

    Signed-off-by: Guennadi Liakhovetski
    Signed-off-by: Kumar Gala

    Guennadi Liakhovetski
     

06 Mar, 2009

1 commit


04 Mar, 2009

2 commits


03 Mar, 2009

1 commit

  • On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
    ljmp, and then use the "syscall" instruction to make a 64-bit system
    call. A 64-bit process make a 32-bit system call with int $0x80.

    In both these cases under CONFIG_SECCOMP=y, secure_computing() will use
    the wrong system call number table. The fix is simple: test TS_COMPAT
    instead of TIF_IA32. Here is an example exploit:

    /* test case for seccomp circumvention on x86-64

    There are two failure modes: compile with -m64 or compile with -m32.

    The -m64 case is the worst one, because it does "chmod 777 ." (could
    be any chmod call). The -m32 case demonstrates it was able to do
    stat(), which can glean information but not harm anything directly.

    A buggy kernel will let the test do something, print, and exit 1; a
    fixed kernel will make it exit with SIGKILL before it does anything.
    */

    #define _GNU_SOURCE
    #include
    #include
    #include
    #include
    #include
    #include
    #include

    int
    main (int argc, char **argv)
    {
    char buf[100];
    static const char dot[] = ".";
    long ret;
    unsigned st[24];

    if (prctl (PR_SET_SECCOMP, 1, 0, 0, 0) != 0)
    perror ("prctl(PR_SET_SECCOMP) -- not compiled into kernel?");

    #ifdef __x86_64__
    assert ((uintptr_t) dot < (1UL << 32));
    asm ("int $0x80 # %0 st_uid=%u\n", st[7]);
    else
    ret = snprintf (buf, sizeof buf, "result %ld\n", ret);
    #else
    # error "not this one"
    #endif

    write (1, buf, ret);

    syscall (__NR_exit, 1);
    return 2;
    }

    Signed-off-by: Roland McGrath
    [ I don't know if anybody actually uses seccomp, but it's enabled in
    at least both Fedora and SuSE kernels, so maybe somebody is. - Linus ]
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

01 Mar, 2009

2 commits


27 Feb, 2009

1 commit

  • The PCI 2.x cells used on some 44x SoCs only let us configure the decode
    for the low 32-bit of the incoming PLB addresses. The top 4 bits (this
    is a 36-bit bus) are hard wired to different values depending on the
    specific SoC in use. Our code used to work "by accident" until I added
    support for the ISA memory holes and while at it added more validity
    checking of the addresses.

    This patch should bring it back to working condition. It still relies
    on the device-tree being correct but that's somewhat a pre-requisite
    for anything to work anyway.

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Geert Uytterhoeven
    Acked-by: Josh Boyer

    Benjamin Herrenschmidt
     

26 Feb, 2009

3 commits

  • This fixes a regression introduced by commit
    a4e22f02f5b6518c1484faea1f88d81802b9feac ("powerpc: Update 64bit
    __copy_tofrom_user() using CPU_FTR_UNALIGNED_LD_STD").

    The same bug that existed in the 64bit memcpy() also exists here so fix
    it here too. The fix is the same as that applied to memcpy() with the
    addition of fixes for the exception handling code required for
    __copy_tofrom_user().

    This stops us reading beyond the end of the source region we were told
    to copy.

    Signed-off-by: Mark Nelson
    Signed-off-by: Benjamin Herrenschmidt

    Mark Nelson
     
  • This fixes a regression introduced by commit
    25d6e2d7c58ddc4a3b614fc5381591c0cfe66556 ("powerpc: Update 64bit memcpy()
    using CPU_FTR_UNALIGNED_LD_STD").

    This commit allowed CPUs that have the CPU_FTR_UNALIGNED_LD_STD CPU
    feature bit present to do the memcpy() with unaligned load doubles. But,
    along with this came a bug where our final load double would read bytes
    beyond a page boundary and into the next (unmapped) page. This was caught
    by enabling CONFIG_DEBUG_PAGEALLOC,

    The fix was to read only the number of bytes that we need to store rather
    than reading a full 8-byte doubleword and storing only a portion of that.

    In order to minimise the amount of existing code touched we use the
    original do_tail for the src_unaligned case.

    Below is an example of the regression, as reported by Sachin Sant:

    Unable to handle kernel paging request for data at address 0xc00000003f380000
    Faulting instruction address: 0xc000000000039574
    cpu 0x1: Vector: 300 (Data Access) at [c00000003baf3020]
    pc: c000000000039574: .memcpy+0x74/0x244
    lr: d00000000244916c: .ext3_xattr_get+0x288/0x2f4 [ext3]
    sp: c00000003baf32a0
    msr: 8000000000009032
    dar: c00000003f380000
    dsisr: 40000000
    current = 0xc00000003e54b010
    paca = 0xc000000000a53680
    pid = 1840, comm = readahead
    enter ? for help
    [link register ] d00000000244916c .ext3_xattr_get+0x288/0x2f4 [ext3]
    [c00000003baf32a0] d000000002449104 .ext3_xattr_get+0x220/0x2f4 [ext3]
    (unreliab
    le)
    [c00000003baf3390] d00000000244a6e8 .ext3_xattr_security_get+0x40/0x5c [ext3]
    [c00000003baf3400] c000000000148154 .generic_getxattr+0x74/0x9c
    [c00000003baf34a0] c000000000333400 .inode_doinit_with_dentry+0x1c4/0x678
    [c00000003baf3560] c00000000032c6b0 .security_d_instantiate+0x50/0x68
    [c00000003baf35e0] c00000000013c818 .d_instantiate+0x78/0x9c
    [c00000003baf3680] c00000000013ced0 .d_splice_alias+0xf0/0x120
    [c00000003baf3720] d00000000243e05c .ext3_lookup+0xec/0x134 [ext3]
    [c00000003baf37c0] c000000000131e74 .do_lookup+0x110/0x260
    [c00000003baf3880] c000000000134ed0 .__link_path_walk+0xa98/0x1010
    [c00000003baf3970] c0000000001354a0 .path_walk+0x58/0xc4
    [c00000003baf3a20] c000000000135720 .do_path_lookup+0x138/0x1e4
    [c00000003baf3ad0] c00000000013645c .path_lookup_open+0x6c/0xc8
    [c00000003baf3b70] c000000000136780 .do_filp_open+0xcc/0x874
    [c00000003baf3d10] c0000000001251e0 .do_sys_open+0x80/0x140
    [c00000003baf3dc0] c00000000016aaec .compat_sys_open+0x24/0x38
    [c00000003baf3e30] c00000000000855c syscall_exit+0x0/0x40

    Signed-off-by: Benjamin Herrenschmidt

    Mark Nelson
     
  • When we introduced VSX, we changed the way FPRs are stored in the
    thread_struct. Unfortunately we missed the load/store float double
    alignment handler code when updating how we access FPRs in the
    thread_struct.

    Below fixes this and merges the little/big endian case.

    Signed-off-by: Michael Neuling
    Signed-off-by: Benjamin Herrenschmidt

    Michael Neuling
     

23 Feb, 2009

1 commit


21 Feb, 2009

1 commit


18 Feb, 2009

1 commit


15 Feb, 2009

1 commit

  • kvm_arch_sync_events is introduced to quiet down all other events may happen
    contemporary with VM destroy process, like IRQ handler and work struct for
    assigned device.

    For kvm_arch_sync_events is called at the very beginning of kvm_destroy_vm(), so
    the state of KVM here is legal and can provide a environment to quiet down other
    events.

    Signed-off-by: Sheng Yang
    Signed-off-by: Avi Kivity

    Sheng Yang
     

14 Feb, 2009

1 commit


13 Feb, 2009

5 commits

  • Conflicts:
    arch/x86/kernel/acpi/boot.c
    arch/x86/mm/fault.c

    Ingo Molnar
     
  • Fix the VSX alignment handler for VSX registers > 32. 32-63 are stored
    in the VMX part of the thread_struct not the FPR part.

    Signed-off-by: Michael Neuling
    CC: stable@kernel.org (2.6.27 & .28 please)
    Signed-off-by: Benjamin Herrenschmidt

    Michael Neuling
     
  • Change the PS3 hotplug memory routine ps3_mm_add_memory() from
    a core_initcall to a device_initcall.

    core_initcall routines run before the powerpc topology_init()
    startup routine, which is a subsys_initcall, resulting in
    failure of ps3_mm_add_memory() when CONFIG_NUMA=y. When
    ps3_mm_add_memory() fails the system will boot with just the
    128 MiB of boot memory

    Signed-off-by: Geoff Levand
    Signed-off-by: Benjamin Herrenschmidt

    Geoff Levand
     
  • Fix the powerpc NUMA reserve bootmem page selection logic.

    commit 8f64e1f2d1e09267ac926e15090fd505c1c0cbcb (powerpc: Reserve
    in bootmem lmb reserved regions that cross NUMA nodes) changed
    the logic for how the powerpc LMB reserved regions were converted
    to bootmen reserved regions. As the folowing discussion reports,
    the new logic was not correct.

    mark_reserved_regions_for_nid() goes through each LMB on the
    system that specifies a reserved area. It searches for
    active regions that intersect with that LMB and are on the
    specified node. It attempts to bootmem-reserve only the area
    where the active region and the reserved LMB intersect. We
    can not reserve things on other nodes as they may not have
    bootmem structures allocated, yet.

    We base the size of the bootmem reservation on two possible
    things. Normally, we just make the reservation start and
    stop exactly at the start and end of the LMB.

    However, the LMB reservations are not aware of NUMA nodes and
    on occasion a single LMB may cross into several adjacent
    active regions. Those may even be on different NUMA nodes
    and will require separate calls to the bootmem reserve
    functions. So, the bootmem reservation must be trimmed to
    fit inside the current active region.

    That's all fine and dandy, but we trim the reservation
    in a page-aligned fashion. That's bad because we start the
    reservation at a non-page-aligned address: physbase.

    The reservation may only span 2 bytes, but that those bytes
    may span two pfns and cause a reserve_size of 2*PAGE_SIZE.

    Take the case where you reserve 0x2 bytes at 0x0fff and
    where the active region ends at 0x1000. You'll jump into
    that if() statment, but node_ar.end_pfn=0x1 and
    start_pfn=0x0. You'll end up with a reserve_size=0x1000,
    and then call

    reserve_bootmem_node(node, physbase=0xfff, size=0x1000);

    0x1000 may not be on the same node as 0xfff. Oops.

    In almost all the vm code, end_ is not inclusive.
    If you have an end_pfn of 0x1234, page 0x1234 is not
    included in the range. Using PFN_UP instead of the
    (>> >> PAGE_SHIFT) will make this consistent with the other VM
    code.

    We also need to do math for the reserved size with physbase
    instead of start_pfn. node_ar.end_pfn << PAGE_SHIFT is
    *precisely* the end of the node. However,
    (start_pfn << PAGE_SHIFT) is *NOT* precisely the beginning
    of the reserved area. That is, of course, physbase.
    If we don't use physbase here, the reserve_size can be
    made too large.

    From: Dave Hansen
    Tested-by: Geoff Levand Tested on PS3.

    Signed-off-by: Benjamin Herrenschmidt

    Dave Hansen
     
  • Fix _PAGE_CHG_MASK so that pte_modify() does not affect the _PAGE_SPECIAL bit.

    Signed-off-by: Philippe Gerum
    Signed-off-by: Benjamin Herrenschmidt

    Philippe Gerum
     

11 Feb, 2009

1 commit

  • The following commit:

    commit 64b3d0e8122b422e879b23d42f9e0e8efbbf9744
    Author: Benjamin Herrenschmidt
    Date: Thu Dec 18 19:13:51 2008 +0000

    powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED

    broke setting of the _PAGE_COHERENT bit in the PPC HW PTE. Since we now
    actually set _PAGE_COHERENT in the Linux PTE we shouldn't be clearing it
    out before we propogate it to the PPC HW PTE.

    Reported-by: Martyn Welch
    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     

10 Feb, 2009

6 commits

  • arch/powerpc/platforms/pseries/hotplug-memory.c uses
    remove_section_mapping() but doesn't include sparsemem.h which defines
    it. This can cause compilation fails for some configs.

    Signed-off-by: Michael Neuling
    Signed-off-by: Benjamin Herrenschmidt

    Michael Neuling
     
  • The new legacy_mem file in sysfs is causing problems with X on machines
    that don't support legacy memory access. The way I initially implemented
    it, we would fail with -ENXIO when trying to mmap it, thus exposing to
    X that we do support the API but there is no legacy memory.

    Unfortunately, X poor error handling is causing it to fail to start when
    it gets this error.

    This implements a workaround hack that instead maps anonymous memory
    instead (using shmem if VM_SHARED is set, just like /dev/zero does).

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • arch/powerpc/oprofile/cell/spu_profiler.c is missing a asm/time.h
    include which is required for ppc_proc_freq. This can cause compile
    failures for some config combinations.

    Signed-off-by: Michael Neuling
    Acked-by: Arnd Bergmann
    Signed-off-by: Benjamin Herrenschmidt

    Michael Neuling
     
  • Impact: fix dynamic ftrace with large modules in PPC64

    The math to calculate the offset into the TOC that is taken from reading
    the trampoline is incorrect. The bottom half of the offset is a signed
    extended short. The current code was using an OR to create the offset
    when it should have been using an addition.

    Signed-off-by: Steven Rostedt
    Acked-by: Geoff Levand
    Signed-off-by: Benjamin Herrenschmidt

    Steven Rostedt
     
  • Currently emulate_step() emulates mr. instructions without updating cr0
    and this can be disastrous. Don't emulate mr.

    This bug has been around for a while, but I am not sure if its a worthy
    -stable candidate. I'll leave it to Ben do decide.

    Signed-off-by: Ananth N Mavinakayanahalli
    Signed-off-by: Benjamin Herrenschmidt

    Ananth N Mavinakayanahalli
     
  • Fixed v_mapped_by_tlbcam() and p_mapped_by_tlbcam() to use phys_addr_t
    instead of unsigned long. In 36-bit physical mode we really need these
    functions to deal with phys_addr_t when trying to match a physical
    address or when returning one.

    Signed-off-by: Kumar Gala

    Kumar Gala
     

07 Feb, 2009

5 commits

  • Taking sizeof the result of sizeof is quite strange and does not seem to be
    what is wanted here.

    This was fixed using the following semantic patch.
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    expression E;
    @@

    - sizeof (
    sizeof (E)
    - )

    @@
    type T;
    @@

    - sizeof (
    sizeof (T)
    - )
    //

    Signed-off-by: Julia Lawall
    Acked-by: Scott Wood
    Signed-off-by: Kumar Gala

    Julia Lawall
     
  • This is a simple change to correct problems when using set_irq_type
    on platforms using CPM2. This code corrects the problem on most platform
    but may have issues on 8272 derived platforms for some interrupts.

    On 8272 PC2 & 3 are missing and PC 23 & 29 are added, which this patch
    does not address.

    Signed-off-by: Paul Bilke
    Reviewed-by: Anton Vorontsov
    Signed-off-by: Kumar Gala

    paulfax
     
  • TSEC0 is connected to Vitesse 7385 5-port switch. The switch
    isn't connected to any mdio bus, the link to the switch is fixed
    to Full-duplex 1000 Mb/s (no pause).

    This patch fixes following failure during bootup:

    mdio@24520:01 not found
    eth0: Could not attach to PHY
    IP-Config: Failed to open eth0

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Kumar Gala

    Anton Vorontsov
     
  • commit b31a1d8b41513b96e9c7ec2f68c5734cef0b26a4 ("gianfar: Convert
    gianfar to an of_platform_driver") introduced a child node for
    the ethernet@25000 controller, but no address and size cells
    specifiers were added, and that makes dtc unhappy:

    DTC: dts->dtb on file "arch/powerpc/boot/dts/mpc8313erdb.dts"
    Warning (reg_format): "reg" property in /soc8313@e0000000/ethernet@25000/mdio@25520 has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
    Warning (avoid_default_addr_size): Relying on default #address-cells value for /soc8313@e0000000/ethernet@25000/mdio@25520
    Warning (avoid_default_addr_size): Relying on default #size-cells value for /soc8313@e0000000/ethernet@25000/mdio@25520

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Kumar Gala

    Anton Vorontsov
     
  • I noticed this doing some randconfig testing (.config below). I have
    CONFIG_PM but no CONFIG_SUSPEND. Bug is against mainline.

    arch/powerpc/sysdev/built-in.o: In function `ipic_suspend':
    ipic.c:(.text+0x6b34): undefined reference to `fsl_deep_sleep'
    make[1]: *** [.tmp_vmlinux1] Error 1
    make: *** [sub-make] Error 2

    Looks like #ifdef CONFIG_PM in arch/powerpc/sysdev/ipic.c should be
    CONFIG_SUSPEND. d49747bdfb2ddebea24d1580da55b79d093d48a9 introduced
    this.

    Fix build when we have CONFIG_PM but no CONFIG_SUSPEND.

    Signed-off-by: Michael Neuling
    Acked-by: Scott Wood
    Signed-off-by: Kumar Gala

    Michael Neuling
     

06 Feb, 2009

1 commit


02 Feb, 2009

1 commit


01 Feb, 2009

3 commits