1. 11 Sep, 2014 2 commits
    • Stefano Stabellini's avatar
      xen/arm: reimplement xen_dma_unmap_page & friends · 340720be
      Stefano Stabellini authored
      xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
      xen_dma_sync_single_for_device are currently implemented by calling into
      the corresponding generic ARM implementation of these functions. In
      order to do this, firstly the dma_addr_t handle, that on Xen is a
      machine address, needs to be translated into a physical address.  The
      operation is expensive and inaccurate, given that a single machine
      address can correspond to multiple physical addresses in one domain,
      because the same page can be granted multiple times by the frontend.
      
      To avoid this problem, we introduce a Xen specific implementation of
      xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
      xen_dma_sync_single_for_device, that can operate on machine addresses
      directly.
      
      The new implementation relies on the fact that the hypervisor creates a
      second p2m mapping of any grant pages at physical address == machine
      address of the page for dom0. Therefore we can access memory at physical
      address == dma_addr_r handle and perform the cache flushing there. Some
      cache maintenance operations require a virtual address. Instead of using
      ioremap_cache, that is not safe in interrupt context, we allocate a
      per-cpu PAGE_KERNEL scratch page and we manually update the pte for it.
      
      arm64 doesn't need cache maintenance operations on unmap for now.
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: default avatarDenis Schneider <v1ne2go@gmail.com>
      340720be
    • Stefano Stabellini's avatar
      xen/arm: introduce XENFEAT_grant_map_identity · 5ebc77de
      Stefano Stabellini authored
      The flag tells us that the hypervisor maps a grant page to guest
      physical address == machine address of the page in addition to the
      normal grant mapping address. It is needed to properly issue cache
      maintenance operation at the completion of a DMA operation involving a
      foreign grant.
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: default avatarDenis Schneider <v1ne2go@gmail.com>
      5ebc77de
  2. 10 Sep, 2014 1 commit
    • Stefan Bader's avatar
      x86/xen: don't copy bogus duplicate entries into kernel page tables · 0b5a5063
      Stefan Bader authored
      When RANDOMIZE_BASE (KASLR) is enabled; or the sum of all loaded
      modules exceeds 512 MiB, then loading modules fails with a warning
      (and hence a vmalloc allocation failure) because the PTEs for the
      newly-allocated vmalloc address space are not zero.
      
        WARNING: CPU: 0 PID: 494 at linux/mm/vmalloc.c:128
                 vmap_page_range_noflush+0x2a1/0x360()
      
      This is caused by xen_setup_kernel_pagetables() copying
      level2_kernel_pgt into level2_fixmap_pgt, overwriting many non-present
      entries.
      
      Without KASLR, the normal kernel image size only covers the first half
      of level2_kernel_pgt and module space starts after that.
      
      L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[  0..255]->kernel
                                                        [256..511]->module
                                [511]->level2_fixmap_pgt[  0..505]->module
      
      This allows 512 MiB of of module vmalloc space to be used before
      having to use the corrupted level2_fixmap_pgt entries.
      
      With KASLR enabled, the kernel image uses the full PUD range of 1G and
      module space starts in the level2_fixmap_pgt. So basically:
      
      L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[0..511]->kernel
                                [511]->level2_fixmap_pgt[0..505]->module
      
      And now no module vmalloc space can be used without using the corrupt
      level2_fixmap_pgt entries.
      
      Fix this by properly converting the level2_fixmap_pgt entries to MFNs,
      and setting level1_fixmap_pgt as read-only.
      
      A number of comments were also using the the wrong L3 offset for
      level2_kernel_pgt.  These have been corrected.
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: stable@vger.kernel.org
      0b5a5063
  3. 04 Sep, 2014 2 commits
  4. 02 Sep, 2014 2 commits
  5. 11 Aug, 2014 6 commits
  6. 10 Aug, 2014 6 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform · 58d08e3b
      Linus Torvalds authored
      Pull chrome platform updates from Olof Johansson:
       "Updates to the Chromebook/box platform drivers:
      
         - a bugfix to pstore registration that makes it also work on
           non-Google systems
         - addition of new shipped Chromebooks (later models have more probing
           through ACPI so the need for these updates will be less over time).
         - A couple of minor coding style updates"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
        platform/chrome: chromeos_laptop - Add a limit for deferred retries
        platform/chrome: Add support for the acer c720p touchscreen.
        platform/chrome: pstore: fix dmi table to match all chrome systems
        platform/chrome: coding style fixes
        platform/chrome: chromeos_laptop - Add Toshiba CB35 Touch
        platform/chrome: chromeos_laptop - Add Dell Chromebook 11 touch
        platform/chrome: chromeos_laptop - Add HP Chromebook 14
        platform/chrome: chromeos_laptop - Add support for Acer C720
      58d08e3b
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 64e3bbc7
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       - a short branch of OMAP fixes that we didn't merge before the window
         opened.
       - a small cleanup that sorts the rk3288 dts entries properly
       - a build fix due to a reference to a removed DT node on exynos
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: dts: exynos5420: remove disp_pd
        ARM: EXYNOS: Fix suspend/resume sequences
        ARM: dts: Fix the sort ordering of EHCI and HSIC in rk3288.dtsi
        ARM: OMAP3: Fix coding style problems in arch/arm/mach-omap2/control.c
        ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case.
        ARM: OMAP2+: clock: allow omap2_dpll_round_rate() to round to next-lowest rate
      64e3bbc7
    • Linus Torvalds's avatar
      Merge branch 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 · 91384758
      Linus Torvalds authored
      Pull nouveau drm updates from Ben Skeggs:
       "Apologies for not getting this done in time for Dave's drm-next merge
        window.  As he mentioned, a pre-existing bug reared its head a lot
        more obviously after this lot of changes.  It took quite a bit of time
        to track it down.  In any case, Dave suggested I try my luck by
        sending directly to you this time.
      
        Overview:
      
         - more code for Tegra GK20A from NVIDIA - probing, reclockig
         - better fix for Kepler GPUs that have the graphics engine powered
           off on startup, method courtesy of info provided by NVIDIA
         - unhardcoding of a bunch of graphics engine setup on
           Fermi/Kepler/Maxwell, will hopefully solve some issues people have
           noticed on higher-end models
         - support for "Zero Bandwidth Clear" on Fermi/Kepler/Maxwell, needs
           userspace support in general, but some lucky apps will benefit
           automagically
         - reviewed/exposed the full object APIs to userspace (finally), gives
           it access to perfctrs, ZBC controls, various events.  More to come
           in the future.
         - various other fixes"
      Acked-by: default avatarDave Airlie <airlied@redhat.com>
      
      * 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (87 commits)
        drm/nouveau: expose the full object/event interfaces to userspace
        drm/nouveau: fix headless mode
        drm/nouveau: hide sysfs pstate file behind an option again
        drm/nv50/disp: shhh compiler
        drm/gf100-/gr: implement the proper SetShaderExceptions method
        drm/gf100-/gr: remove some broken ltc bashing, for now
        drm/gf100-/gr: unhardcode attribute cb config
        drm/gf100-/gr: fetch tpcs-per-ppc info on startup
        drm/gf100-/gr: unhardcode pagepool config
        drm/gf100-/gr: unhardcode bundle cb config
        drm/gf100-/gr: improve initial context patch list helpers
        drm/gf100-/gr: add support for zero bandwidth clear
        drm/nouveau/ltc: add zbc drivers
        drm/nouveau/ltc: s/ltcg/ltc/ + cleanup
        drm/nouveau: use ram info from nvif_device
        drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers
        drm/nouveau/disp: allow user direct access to channel control registers
        drm/nouveau/disp: audit and version display classes
        drm/nouveau/disp: audit and version SCANOUTPOS method
        drm/nv50-/disp: audit and version PIOR_PWR method
        ...
      91384758
    • Linus Torvalds's avatar
      Merge tag 'trace-ipi-tracepoints' of... · c23190c0
      Linus Torvalds authored
      Merge tag 'trace-ipi-tracepoints' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull IPI tracepoints for ARM from Steven Rostedt:
       "Nicolas Pitre added generic tracepoints for tracing IPIs and updated
        the arm and arm64 architectures.  It required some minor updates to
        the generic tracepoint system, so it had to wait for me to implement
        them"
      
      * tag 'trace-ipi-tracepoints' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ARM64: add IPI tracepoints
        ARM: add IPI tracepoints
        tracepoint: add generic tracepoint definitions for IPI tracing
        tracing: Do not do anything special with tracepoint_string when tracing is disabled
      c23190c0
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · fc335c1b
      Linus Torvalds authored
      Pull trace file read iterator fixes from Steven Rostedt:
       "This contains a fix for two long standing bugs.  Both of which are
        rarely ever hit, and requires the user to do something that users
        rarely do.  It took a few special test cases to even trigger this bug,
        and one of them was just one test in the process of finishing up as
        another one started.
      
        Both bugs have to do with the ring buffer iterator rb_iter_peek(), but
        one is more indirect than the other.
      
        The fist bug fix is simply an increase in the safety net loop counter.
        The counter makes sure that the rb_iter_peek() only iterates the
        number of times we expect it can, and no more.  Well, there was one
        way it could iterate one more than we expected, and that caused the
        ring buffer to shutdown with a nasty warning.  The fix was simply to
        up that counter by one.
      
        The other bug has to be with rb_iter_reset() (called by
        rb_iter_peek()).  This happens when a user reads both the trace_pipe
        and trace files.  The trace_pipe is a consuming read and does not use
        the ring buffer iterator, but the trace file is not a consuming read
        and does use the ring buffer iterator.  When the trace file is being
        read, if it detects that a consuming read occurred, it resets the
        iterator and starts over.  But the reset code that does this
        (rb_iter_reset()), checks if the reader_page is linked to the ring
        buffer or not, and will look into the ring buffer itself if it is not.
        This is wrong, as it should always try to read the reader page first.
        Not to mention, the code that looked into the ring buffer did it
        wrong, and used the header_page "read" offset to start reading on that
        page.  That offset is bogus for pages in the writable ring buffer, and
        was corrupting the iterator, and it would start returning bogus
        events"
      
      * tag 'trace-fixes-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ring-buffer: Always reset iterator to reader page
        ring-buffer: Up rb_iter_peek() loop count to 3
      fc335c1b
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · 77e40aae
      Linus Torvalds authored
      Pull namespace updates from Eric Biederman:
       "This is a bunch of small changes built against 3.16-rc6.  The most
        significant change for users is the first patch which makes setns
        drmatically faster by removing unneded rcu handling.
      
        The next chunk of changes are so that "mount -o remount,.." will not
        allow the user namespace root to drop flags on a mount set by the
        system wide root.  Aks this forces read-only mounts to stay read-only,
        no-dev mounts to stay no-dev, no-suid mounts to stay no-suid, no-exec
        mounts to stay no exec and it prevents unprivileged users from messing
        with a mounts atime settings.  I have included my test case as the
        last patch in this series so people performing backports can verify
        this change works correctly.
      
        The next change fixes a bug in NFS that was discovered while auditing
        nsproxy users for the first optimization.  Today you can oops the
        kernel by reading /proc/fs/nfsfs/{servers,volumes} if you are clever
        with pid namespaces.  I rebased and fixed the build of the
        !CONFIG_NFS_FS case yesterday when a build bot caught my typo.  Given
        that no one to my knowledge bases anything on my tree fixing the typo
        in place seems more responsible that requiring a typo-fix to be
        backported as well.
      
        The last change is a small semantic cleanup introducing
        /proc/thread-self and pointing /proc/mounts and /proc/net at it.  This
        prevents several kinds of problemantic corner cases.  It is a
        user-visible change so it has a minute chance of causing regressions
        so the change to /proc/mounts and /proc/net are individual one line
        commits that can be trivially reverted.  Unfortunately I lost and
        could not find the email of the original reporter so he is not
        credited.  From at least one perspective this change to /proc/net is a
        refgression fix to allow pthread /proc/net uses that were broken by
        the introduction of the network namespace"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        proc: Point /proc/mounts at /proc/thread-self/mounts instead of /proc/self/mounts
        proc: Point /proc/net at /proc/thread-self/net instead of /proc/self/net
        proc: Implement /proc/thread-self to point at the directory of the current thread
        proc: Have net show up under /proc/<tgid>/task/<tid>
        NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes
        mnt: Add tests for unprivileged remount cases that have found to be faulty
        mnt: Change the default remount atime from relatime to the existing value
        mnt: Correct permission checks in do_remount
        mnt: Move the test for MNT_LOCK_READONLY from change_mount_flags into do_remount
        mnt: Only change user settable mount flags in remount
        namespaces: Use task_lock and not rcu to protect nsproxy
      77e40aae
  7. 09 Aug, 2014 21 commits