15 Nov, 2013

40 commits

  • Pull KVM changes from Paolo Bonzini:
    "Here are the 3.13 KVM changes. There was a lot of work on the PPC
    side: the HV and emulation flavors can now coexist in a single kernel
    is probably the most interesting change from a user point of view.

    On the x86 side there are nested virtualization improvements and a few
    bugfixes.

    ARM got transparent huge page support, improved overcommit, and
    support for big endian guests.

    Finally, there is a new interface to connect KVM with VFIO. This
    helps with devices that use NoSnoop PCI transactions, letting the
    driver in the guest execute WBINVD instructions. This includes some
    nVidia cards on Windows, that fail to start without these patches and
    the corresponding userspace changes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (146 commits)
    kvm, vmx: Fix lazy FPU on nested guest
    arm/arm64: KVM: PSCI: propagate caller endianness to the incoming vcpu
    arm/arm64: KVM: MMIO support for BE guest
    kvm, cpuid: Fix sparse warning
    kvm: Delete prototype for non-existent function kvm_check_iopl
    kvm: Delete prototype for non-existent function complete_pio
    hung_task: add method to reset detector
    pvclock: detect watchdog reset at pvclock read
    kvm: optimize out smp_mb after srcu_read_unlock
    srcu: API for barrier after srcu read unlock
    KVM: remove vm mmap method
    KVM: IOMMU: hva align mapping page size
    KVM: x86: trace cpuid emulation when called from emulator
    KVM: emulator: cleanup decode_register_operand() a bit
    KVM: emulator: check rex prefix inside decode_register()
    KVM: x86: fix emulation of "movzbl %bpl, %eax"
    kvm_host: typo fix
    KVM: x86: emulate SAHF instruction
    MAINTAINERS: add tree for kvm.git
    Documentation/kvm: add a 00-INDEX file
    ...

    Linus Torvalds
     
  • Pull Xen updates from Konrad Rzeszutek Wilk:
    "This has tons of fixes and two major features which are concentrated
    around the Xen SWIOTLB library.

    The short is that the tracing facility (just one function) has
    been added to SWIOTLB to make it easier to track I/O progress.
    Additionally under Xen and ARM (32 & 64) the Xen-SWIOTLB driver
    "is used to translate physical to machine and machine to physical
    addresses of foreign[guest] pages for DMA operations" (Stefano) when
    booting under hardware without proper IOMMU.

    There are also bug-fixes, cleanups, compile warning fixes, etc.

    The commit times for some of the commits is a bit fresh - that is b/c
    we wanted to make sure we have the Ack's from the ARM folks - which
    with the string of back-to-back conferences took a bit of time. Rest
    assured - the code has been stewing in #linux-next for some time.

    Features:
    - SWIOTLB has tracing added when doing bounce buffer.
    - Xen ARM/ARM64 can use Xen-SWIOTLB. This work allows Linux to
    safely program real devices for DMA operations when running as a
    guest on Xen on ARM, without IOMMU support. [*1]
    - xen_raw_printk works with PVHVM guests if needed.

    Bug-fixes:
    - Make memory ballooning work under HVM with large MMIO region.
    - Inform hypervisor of MCFG regions found in ACPI DSDT.
    - Remove deprecated IRQF_DISABLED.
    - Remove deprecated __cpuinit.

    [*1]:
    "On arm and arm64 all Xen guests, including dom0, run with second
    stage translation enabled. As a consequence when dom0 programs a
    device for a DMA operation is going to use (pseudo) physical
    addresses instead machine addresses. This work introduces two trees
    to track physical to machine and machine to physical mappings of
    foreign pages. Local pages are assumed mapped 1:1 (physical address
    == machine address). It enables the SWIOTLB-Xen driver on ARM and
    ARM64, so that Linux can translate physical addresses to machine
    addresses for dma operations when necessary. " (Stefano)"

    * tag 'stable/for-linus-3.13-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (32 commits)
    xen/arm: pfn_to_mfn and mfn_to_pfn return the argument if nothing is in the p2m
    arm,arm64/include/asm/io.h: define struct bio_vec
    swiotlb-xen: missing include dma-direction.h
    pci-swiotlb-xen: call pci_request_acs only ifdef CONFIG_PCI
    arm: make SWIOTLB available
    xen: delete new instances of added __cpuinit
    xen/balloon: Set balloon's initial state to number of existing RAM pages
    xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved for MCFG areas.
    xen: remove deprecated IRQF_DISABLED
    x86/xen: remove deprecated IRQF_DISABLED
    swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs
    swiotlb-xen: static inline xen_phys_to_bus, xen_bus_to_phys, xen_virt_to_bus and range_straddles_page_boundary
    grant-table: call set_phys_to_machine after mapping grant refs
    arm,arm64: do not always merge biovec if we are running on Xen
    swiotlb: print a warning when the swiotlb is full
    swiotlb-xen: use xen_dma_map/unmap_page, xen_dma_sync_single_for_cpu/device
    xen: introduce xen_dma_map/unmap_page and xen_dma_sync_single_for_cpu/device
    tracing/events: Fix swiotlb tracepoint creation
    swiotlb-xen: use xen_alloc/free_coherent_pages
    xen: introduce xen_alloc/free_coherent_pages
    ...

    Linus Torvalds
     
  • Pull virtio updates from Rusty Russell:
    "Nothing really exciting: some groundwork for changing virtio endian,
    and some robustness fixes for broken virtio devices, plus minor
    tweaks"

    * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    virtio_scsi: verify if queue is broken after virtqueue_get_buf()
    x86, asmlinkage, lguest: Pass in globals into assembler statement
    virtio: mmio: fix signature checking for BE guests
    virtio_ring: adapt to notify() returning bool
    virtio_net: verify if queue is broken after virtqueue_get_buf()
    virtio_console: verify if queue is broken after virtqueue_get_buf()
    virtio_blk: verify if queue is broken after virtqueue_get_buf()
    virtio_ring: add new function virtqueue_is_broken()
    virtio_test: verify if virtqueue_kick() succeeded
    virtio_net: verify if virtqueue_kick() succeeded
    virtio_ring: let virtqueue_{kick()/notify()} return a bool
    virtio_ring: change host notification API
    virtio_config: remove virtio_config_val
    virtio: use size-based config accessors.
    virtio_config: introduce size-based accessors.
    virtio_ring: plug kmemleak false positive.
    virtio: pm: use CONFIG_PM_SLEEP instead of CONFIG_PM

    Linus Torvalds
     
  • Pull module updates from Rusty Russell:
    "Mainly boring here, too. rmmod --wait finally removed, though"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    modpost: fix bogus 'exported twice' warnings.
    init: fix in-place parameter modification regression
    asmlinkage, module: Make ksymtab and kcrctab symbols and __this_module __visible
    kernel: add support for init_array constructors
    modpost: Optionally ignore secondary errors seen if a single module build fails
    module: remove rmmod --wait option.

    Linus Torvalds
     
  • Merge patches from Andrew Morton:
    - memstick fixes

    - the rest of MM

    - various misc bits that were awaiting merges from linux-next into
    mainline: seq_file, printk, rtc, completions, w1, softirqs, llist,
    kfifo, hfsplus

    * emailed patches from Andrew Morton : (72 commits)
    cmdline-parser: fix build
    hfsplus: Fix undefined __divdi3 in hfsplus_init_header_node()
    kfifo API type safety
    kfifo: kfifo_copy_{to,from}_user: fix copied bytes calculation
    sound/core/memalloc.c: use gen_pool_dma_alloc() to allocate iram buffer
    llists-move-llist_reverse_order-from-raid5-to-llistc-fix
    llists: move llist_reverse_order from raid5 to llist.c
    kernel: fix generic_exec_single indentation
    kernel-provide-a-__smp_call_function_single-stub-for-config_smp-fix
    kernel: provide a __smp_call_function_single stub for !CONFIG_SMP
    kernel: remove CONFIG_USE_GENERIC_SMP_HELPERS
    revert "softirq: Add support for triggering softirq work on softirqs"
    drivers/w1/masters/w1-gpio.c: use dev_get_platdata()
    sched: remove INIT_COMPLETION
    tree-wide: use reinit_completion instead of INIT_COMPLETION
    sched: replace INIT_COMPLETION with reinit_completion
    drivers/rtc/rtc-hid-sensor-time.c: enable HID input processing early
    drivers/rtc/rtc-hid-sensor-time.c: use dev_get_platdata()
    vsprintf: ignore %n again
    seq_file: remove "%n" usage from seq_file users
    ...

    Linus Torvalds
     
  • Fix following errors:

    include/linux/cmdline-parser.h:17:12: error: 'BDEVNAME_SIZE' undeclared here
    block/cmdline-parser.c:17:2: error: implicit declaration of function 'kzalloc'

    Signed-off-by: Alexander Beregalov
    Cc: CaiZhiyong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Beregalov
     
  • ERROR: "__divdi3" [fs/hfsplus/hfsplus.ko] undefined!

    Introduced by commit 099e9245e04d ("hfsplus: implement attributes file's
    header node initialization code").

    i_size_read() returns loff_t, which is long long, i.e. 64-bit. node_size
    is size_t, which is either 32-bit or 64-bit. Hence
    "i_size_read(attr_file) / node_size" is a 64-by-32 or 64-by-64 division,
    causing (some versions of) gcc to emit a call to __divdi3().

    Fortunately node_size is actually 16-bit, as the sole caller of
    hfsplus_init_header_node() passes a u16. Hence change its type from
    size_t to u16, and use do_div() to perform a 64-by-32 division.

    Not seen in m68k/allmodconfig in -next, so it really depends on the
    verion of gcc.

    Signed-off-by: Geert Uytterhoeven
    Cc: Vyacheslav Dubeyko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • This patch enhances the type safety for the kfifo API. It is now safe
    to put const data into a non const FIFO and the API will now generate a
    compiler warning when reading from the fifo where the destination
    address is pointing to a const variable.

    As a side effect the kfifo_put() does now expect the value of an element
    instead a pointer to the element. This was suggested Russell King. It
    make the handling of the kfifo_put easier since there is no need to
    create a helper variable for getting the address of a pointer or to pass
    integers of different sizes.

    IMHO the API break is okay, since there are currently only six users of
    kfifo_put().

    The code is also cleaner by kicking out the "if (0)" expressions.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Stefani Seibold
    Cc: Russell King
    Cc: Hauke Mehrtens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • 'copied' and 'len' are in bytes, while 'ret' is in elements, so we need to
    multiply 'ret' with the size of one element to get the correct result.

    Signed-off-by: Lars-Peter Clausen
    Cc: Stefani Seibold
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lars-Peter Clausen
     
  • Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

    Signed-off-by: Nicolin Chen
    Acked-by: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolin Chen
     
  • fix comment typo, per Jan

    Cc: Christoph Hellwig
    Cc: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Make this useful helper available for other users.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Jan Kara
    Cc: Jens Axboe
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Cc: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • x86_64 allnoconfig:

    kernel/up.c:25: error: redefinition of '__smp_call_function_single'
    include/linux/smp.h:154: note: previous definition of '__smp_call_function_single' was here

    Cc: Christoph Hellwig
    Cc: Christoph Hellwig
    Cc: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Signed-off-by: Christoph Hellwig
    Cc: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • We've switched over every architecture that supports SMP to it, so
    remove the new useless config variable.

    Signed-off-by: Christoph Hellwig
    Cc: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • This commit was incomplete in that code to remove items from the per-cpu
    lists was missing and never acquired a user in the 5 years it has been in
    the tree. We're going to implement what it seems to try to archive in a
    simpler way, and this code is in the way of doing so.

    Signed-off-by: Christoph Hellwig
    Cc: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Use the wrapper function for retrieving the platform data instead of
    accessing dev->platform_data directly. This is a cosmetic change to make
    the code simpler and enhance the readability.

    Signed-off-by: Jingoo Han
    Acked-by: Evgeniy Polyakov
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • All users are converted over to reinit_completion(). Remove the old
    macro now.

    Signed-off-by: Wolfram Sang
    Cc: Linus Walleij
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • Use this new function to make code more comprehensible, since we are
    reinitialzing the completion, not initializing.

    [akpm@linux-foundation.org: linux-next resyncs]
    Signed-off-by: Wolfram Sang
    Acked-by: Linus Walleij (personally at LCE13)
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • For the casual device driver writer, it is hard to remember when to use
    init_completion (to init a completion structure) or INIT_COMPLETION (to
    *reinit* a completion structure). Furthermore, while all other
    completion functions exepct a pointer as a parameter, INIT_COMPLETION
    does not. To make it easier to remember which function to use and to
    make code more readable, introduce a new inline function with the proper
    name and consistent argument type. Update the kernel-doc for
    init_completion while we are here.

    Signed-off-by: Wolfram Sang
    Acked-by: Linus Walleij (personally at LCE13)
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • Enable the processing of HID input records before the RTC will be
    registered, in order to allow the RTC register function to read clock.
    Without doing that the clock can only be read after the probe function
    has finished.

    Signed-off-by: Alexander Holler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Holler
     
  • Use the wrapper function for retrieving the platform data instead of
    accessing dev->platform_data directly. This is a cosmetic change to
    make the code simpler and enhance the readability.

    Signed-off-by: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • This ignores %n in printf again, as was originally documented.
    Implementing %n poses a greater security risk than utility, so it should
    stay ignored. To help anyone attempting to use %n, a warning will be
    emitted if it is encountered.

    Based on an earlier patch by Joe Perches.

    Because %n was designed to write to pointers on the stack, it has been
    frequently used as an attack vector when bugs are found that leak
    user-controlled strings into functions that ultimately process format
    strings. While this class of bug can still be turned into an
    information leak, removing %n eliminates the common method of elevating
    such a bug into an arbitrary kernel memory writing primitive,
    significantly reducing the danger of this class of bug.

    For seq_file users that need to know the length of a written string for
    padding, please see seq_setwidth() and seq_pad() instead.

    Signed-off-by: Kees Cook
    Cc: Joe Perches
    Cc: Tetsuo Handa
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     
  • All seq_printf() users are using "%n" for calculating padding size,
    convert them to use seq_setwidth() / seq_pad() pair.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: Kees Cook
    Cc: Joe Perches
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tetsuo Handa
     
  • There are several users who want to know bytes written by seq_*() for
    alignment purpose. Currently they are using %n format for knowing it
    because seq_*() returns 0 on success.

    This patch introduces seq_setwidth() and seq_pad() for allowing them to
    align without using %n format.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: Kees Cook
    Cc: Joe Perches
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tetsuo Handa
     
  • Avoid the fragile Kconfig construct guestimating spinlock_t sizes; use a
    friendly compile-time test to determine this.

    [kirill.shutemov@linux.intel.com: drop CONFIG_CMPXCHG_LOCKREF]
    Signed-off-by: Peter Zijlstra
    Signed-off-by: Kirill A. Shutemov
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • If DEBUG_SPINLOCK and DEBUG_LOCK_ALLOC are enabled spinlock_t on x86_64
    is 72 bytes. For page->ptl they will be allocated from kmalloc-96 slab,
    so we loose 24 on each. An average system can easily allocate few tens
    thousands of page->ptl and overhead is significant.

    Let's create a separate slab for page->ptl allocation to solve this.

    Signed-off-by: Kirill A. Shutemov
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Use kernel/bounds.c to convert build-time spinlock_t size check into a
    preprocessor symbol and apply that to properly separate the page::ptl
    situation.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Kirill A. Shutemov
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • If split page table lock is in use, we embed the lock into struct page
    of table's page. We have to disable split lock, if spinlock_t is too
    big be to be embedded, like when DEBUG_SPINLOCK or DEBUG_LOCK_ALLOC
    enabled.

    This patch add support for dynamic allocation of split page table lock
    if we can't embed it to struct page.

    page->ptl is unsigned long now and we use it as spinlock_t if
    sizeof(spinlock_t) ptl.

    Signed-off-by: Kirill A. Shutemov
    Reviewed-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • At the moment xtensa uses slab allocator for PTE table. It doesn't work
    with enabled split page table lock: slab uses page->slab_cache and
    page->first_page for its pages. These fields share stroage with
    page->ptl.

    Signed-off-by: Kirill A. Shutemov
    Cc: Chris Zankel
    Acked-by: Max Filippov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Acked-by: Will Deacon
    Cc: Grant Likely
    Cc: Rob Herring
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Cc: Chris Zankel
    Cc: Max Filippov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Cc: Guan Xuetao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Acked-by: Chris Metcalf
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Signed-off-by: Kirill A. Shutemov
    Cc: Chen Liqin
    Acked-by: Lennox Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov