1. 13 Jun, 2013 1 commit
    • H. Peter Anvin's avatar
      Merge tag 'efi-urgent' into x86/urgent · 45df901c
      H. Peter Anvin authored
       * More tweaking to the EFI variable anti-bricking algorithm. Quite a
         few users were reporting boot regressions in v3.9. This has now been
         fixed with a more accurate "minimum storage requirement to avoid
         bricking" value from Samsung (5K instead of 50%) and code to trigger
         garbage collection when we near our limit - Matthew Garrett.
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      45df901c
  2. 12 Jun, 2013 2 commits
  3. 10 Jun, 2013 1 commit
    • Matthew Garrett's avatar
      Modify UEFI anti-bricking code · f8b84043
      Matthew Garrett authored
      This patch reworks the UEFI anti-bricking code, including an effective
      reversion of cc5a080c and 31ff2f20. It turns out that calling
      QueryVariableInfo() from boot services results in some firmware
      implementations jumping to physical addresses even after entering virtual
      mode, so until we have 1:1 mappings for UEFI runtime space this isn't
      going to work so well.
      
      Reverting these gets us back to the situation where we'd refuse to create
      variables on some systems because they classify deleted variables as "used"
      until the firmware triggers a garbage collection run, which they won't do
      until they reach a lower threshold. This results in it being impossible to
      install a bootloader, which is unhelpful.
      
      Feedback from Samsung indicates that the firmware doesn't need more than
      5KB of storage space for its own purposes, so that seems like a reasonable
      threshold. However, there's still no guarantee that a platform will attempt
      garbage collection merely because it drops below this threshold. It seems
      that this is often only triggered if an attempt to write generates a
      genuine EFI_OUT_OF_RESOURCES error. We can force that by attempting to
      create a variable larger than the remaining space. This should fail, but if
      it somehow succeeds we can then immediately delete it.
      
      I've tested this on the UEFI machines I have available, but I don't have
      a Samsung and so can't verify that it avoids the bricking problem.
      Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
      Signed-off-by: Lee, Chun-Y <jlee@suse.com> [ dummy variable cleanup ]
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      f8b84043
  4. 31 May, 2013 5 commits
    • Yinghai Lu's avatar
      x86: Fix adjust_range_size_mask calling position · 7de3d66b
      Yinghai Lu authored
      Commit
      
          8d57470d x86, mm: setup page table in top-down
      
      causes a kernel panic while setting mem=2G.
      
           [mem 0x00000000-0x000fffff] page 4k
           [mem 0x7fe00000-0x7fffffff] page 1G
           [mem 0x7c000000-0x7fdfffff] page 1G
           [mem 0x00100000-0x001fffff] page 4k
           [mem 0x00200000-0x7bffffff] page 2M
      
      for last entry is not what we want, we should have
           [mem 0x00200000-0x3fffffff] page 2M
           [mem 0x40000000-0x7bffffff] page 1G
      
      Actually we merge the continuous ranges with same page size too early.
      in this case, before merging we have
           [mem 0x00200000-0x3fffffff] page 2M
           [mem 0x40000000-0x7bffffff] page 2M
      after merging them, will get
           [mem 0x00200000-0x7bffffff] page 2M
      even we can use 1G page to map
           [mem 0x40000000-0x7bffffff]
      
      that will cause problem, because we already map
           [mem 0x7fe00000-0x7fffffff] page 1G
           [mem 0x7c000000-0x7fdfffff] page 1G
      with 1G page, aka [0x40000000-0x7fffffff] is mapped with 1G page already.
      During phys_pud_init() for [0x40000000-0x7bffffff], it will not
      reuse existing that pud page, and allocate new one then try to use
      2M page to map it instead, as page_size_mask does not include
      PG_LEVEL_1G. At end will have [7c000000-0x7fffffff] not mapped, loop
      in phys_pmd_init stop mapping at 0x7bffffff.
      
      That is right behavoir, it maps exact range with exact page size that
      we ask, and we should explicitly call it to map [7c000000-0x7fffffff]
      before or after mapping 0x40000000-0x7bffffff.
      Anyway we need to make sure ranges' page_size_mask correct and consistent
      after split_mem_range for each range.
      
      Fix that by calling adjust_range_size_mask before merging range
      with same page size.
      
      -v2: update change log.
      -v3: add more explanation why [7c000000-0x7fffffff] is not mapped, and
          it causes panic.
      Bisected-by: default avatar"Xie, ChanglongX" <changlongx.xie@intel.com>
      Bisected-by: default avatarYuanhan Liu <yuanhan.liu@linux.intel.com>
      Reported-and-tested-by: default avatarYuanhan Liu <yuanhan.liu@linux.intel.com>
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Link: http://lkml.kernel.org/r/1370015587-20835-1-git-send-email-yinghai@kernel.org
      Cc: <stable@vger.kernel.org> v3.9
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      7de3d66b
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · a93cb29a
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "One qxl 32-bit warning fix, the rest is a bunch of radeon fixes from
        Alex for some issues we've been seeing."
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/qxl: fix build warnings on 32-bit
        radeon: use max_bus_speed to activate gen2 speeds
        drm/radeon: narrow scope of Apple re-POST hack
        drm/radeon: don't check crtcs in card_posted() on cards without DCE
        drm/radeon: fix card_posted check for newer asics
        drm/radeon: fix typo in cu_per_sh on verde
        drm/radeon: UVD block on SUMO2 is the same as on SUMO
      a93cb29a
    • Dave Airlie's avatar
      drm/qxl: fix build warnings on 32-bit · 970fa986
      Dave Airlie authored
      Just the usual printk related warnings.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      970fa986
    • Linus Torvalds's avatar
      Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux · 4203afc3
      Linus Torvalds authored
      Pull nfsd fixes from Bruce Fields:
       "A couple minor fixes for the (new to 3.10) gss-proxy code.
      
        And one regression from user-namespace changes.  (XBMC clients were
        doing something admittedly weird--sending -1 gid's--but something that
        we used to allow.)"
      
      * 'for-3.10' of git://linux-nfs.org/~bfields/linux:
        svcrpc: fix failures to handle -1 uid's and gid's
        svcrpc: implement O_NONBLOCK behavior for use-gss-proxy
        svcauth_gss: fix error code in use_gss_proxy()
      4203afc3
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 484b002e
      Linus Torvalds authored
      Pull x86 fixes from Peter Anvin:
      
       - Three EFI-related fixes
      
       - Two early memory initialization fixes
      
       - build fix for older binutils
      
       - fix for an eager FPU performance regression -- currently we don't
         allow the use of the FPU at interrupt time *at all* in eager mode,
         which is clearly wrong.
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86: Allow FPU to be used at interrupt time even with eagerfpu
        x86, crc32-pclmul: Fix build with older binutils
        x86-64, init: Fix a possible wraparound bug in switchover in head_64.S
        x86, range: fix missing merge during add range
        x86, efi: initial the local variable of DataSize to zero
        efivar: fix oops in efivar_update_sysfs_entries() caused by memory reuse
        efivarfs: Never return ENOENT from firmware again
      484b002e
  5. 30 May, 2013 10 commits
    • Pekka Riikonen's avatar
      x86: Allow FPU to be used at interrupt time even with eagerfpu · 5187b28f
      Pekka Riikonen authored
      With the addition of eagerfpu the irq_fpu_usable() now returns false
      negatives especially in the case of ksoftirqd and interrupted idle task,
      two common cases for FPU use for example in networking/crypto.  With
      eagerfpu=off FPU use is possible in those contexts.  This is because of
      the eagerfpu check in interrupted_kernel_fpu_idle():
      
      ...
        * For now, with eagerfpu we will return interrupted kernel FPU
        * state as not-idle. TBD: Ideally we can change the return value
        * to something like __thread_has_fpu(current). But we need to
        * be careful of doing __thread_clear_has_fpu() before saving
        * the FPU etc for supporting nested uses etc. For now, take
        * the simple route!
      ...
       	if (use_eager_fpu())
       		return 0;
      
      As eagerfpu is automatically "on" on those CPUs that also have the
      features like AES-NI this patch changes the eagerfpu check to return 1 in
      case the kernel_fpu_begin() has not been said yet.  Once it has been the
      __thread_has_fpu() will start returning 0.
      
      Notice that with eagerfpu the __thread_has_fpu is always true initially.
      FPU use is thus always possible no matter what task is under us, unless
      the state has already been saved with kernel_fpu_begin().
      
      [ hpa: this is a performance regression, not a correctness regression,
        but since it can be quite serious on CPUs which need encryption at
        interrupt time I am marking this for urgent/stable. ]
      Signed-off-by: default avatarPekka Riikonen <priikone@iki.fi>
      Link: http://lkml.kernel.org/r/alpine.GSO.2.00.1305131356320.18@git.silcnet.org
      Cc: <stable@vger.kernel.org> v3.7+
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      5187b28f
    • Jan Beulich's avatar
      x86, crc32-pclmul: Fix build with older binutils · 2baad612
      Jan Beulich authored
      binutils prior to 2.18 (e.g. the ones found on SLE10) don't support
      assembling PEXTRD, so a macro based approach like the one for PCLMULQDQ
      in the same file should be used.
      
      This requires making the helper macros capable of recognizing 32-bit
      general purpose register operands.
      
      [ hpa: tagging for stable as it is a low risk build fix ]
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Link: http://lkml.kernel.org/r/51A6142A02000078000D99D8@nat28.tlf.novell.com
      Cc: Alexander Boyko <alexander_boyko@xyratex.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: <stable@vger.kernel.org> v3.9
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      2baad612
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.10-rc3-tag' of... · 3655b22d
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.10-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull Xen fixes from Konrad Rzeszutek Wilk:
       - Use proper error paths
       - Clean up APIC IPI usage (incorrect arguments)
       - Delay XenBus frontend resume is backend (xenstored) is not running
       - Fix build error with various combinations of CONFIG_
      
      * tag 'stable/for-linus-3.10-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xenbus_client.c: correct exit path for xenbus_map_ring_valloc_hvm
        xen-pciback: more uses of cached MSI-X capability offset
        xen: Clean up apic ipi interface
        xenbus: save xenstore local status for later use
        xenbus: delay xenbus frontend resume if xenstored is not running
        xmem/tmem: fix 'undefined variable' build error.
      3655b22d
    • Jean-Christophe PLAGNIOL-VILLARD's avatar
      MAINTAINERS: Framebuffer Layer maintainers update · 5489e948
      Jean-Christophe PLAGNIOL-VILLARD authored
      Tomi and I will now take care of the Framebuffer Layer
      
      The git tree is now on kernel.org
      Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5489e948
    • Linus Torvalds's avatar
      Merge tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 5c1dfc82
      Linus Torvalds authored
      Pull sound updates from Takashi Iwai:
       "Again very calm updates at this time.
      
        All small fixes for individual drivers, mostly ASoC codecs, in
        addition to soc-compress fix for capture streams which is safe to
        apply as there is no in-tree users yet."
      
      * tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ASoC: cs42l52: fix default value for MASTERA_VOL.
        ASoC: wm8994: check for array index returned
        ASoC: wm8994: Fix reporting of accessory removal on WM8958
        ASoC: wm8994: use the correct pointer to get the control value
        ASoC: wm5110: Correct DSP4R Mixer control name
        ALSA: usb-6fire: Modify firmware version check
        ASoC: cs42l52: fix master playback mute mask.
        ASoC: cs42l52: fix bogus shifts in "Speaker Volume" and "PCM Mixer Volume" controls.
        ASoC: cs42l52: microphone bias is controlled by IFACE_CTL2 register.
        ASoC: davinci: fix sample rotation
        ASoC: wm5110: Add missing speaker initialisation
        ASoC: soc-compress: Send correct stream event for capture start
        ASoC: max98090: request IRQF_ONESHOT interrupt
      5c1dfc82
    • Linus Torvalds's avatar
      Merge branch 'mn10300' (mn10300 fixes from David Howells) · dcdbe33a
      Linus Torvalds authored
      Merge mn10300 fixes from David Howells.
      
      * emailed patches from David Howells <dhowells@redhat.com>:
        MN10300: Need pci_iomap() and __pci_ioport_map() defining
        MN10300: ASB2305's PCI code needs the definition of XIRQ1
        MN10300: Enable IRQs more in system call exit work path
        MN10300: Fix ret_from_kernel_thread
      dcdbe33a
    • David Howells's avatar
      MN10300: Need pci_iomap() and __pci_ioport_map() defining · 1aeeac7a
      David Howells authored
      Include the generic definitions of pci_iomap() and __pci_ioport_map()
      otherwise we can get errors like:
      
        lib/pci_iomap.c: In function 'pci_iomap':
        lib/pci_iomap.c:37: error: implicit declaration of function '__pci_ioport_map'
        lib/pci_iomap.c:37: warning: return makes pointer from integer without a cast
      
      and:
      
        drivers/pci/quirks.c: In function 'disable_igfx_irq':
        drivers/pci/quirks.c:2893: error: implicit declaration of function 'pci_iomap'
        drivers/pci/quirks.c:2893: warning: initialization makes pointer from integer without a cast
        drivers/pci/quirks.c: In function 'reset_ivb_igd':
        drivers/pci/quirks.c:3133: warning: assignment makes pointer from integer without a cast
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarKen Cox <jkc@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1aeeac7a
    • David Howells's avatar
      MN10300: ASB2305's PCI code needs the definition of XIRQ1 · b8bc9b02
      David Howells authored
      The code for PCI in the ASB2305 needs the definition of XIRQ1 from proc/irq.h
      otherwise the following error appears:
      
        arch/mn10300/unit-asb2305/pci.c: In function 'unit_pci_init':
        arch/mn10300/unit-asb2305/pci.c:481: error: 'XIRQ1' undeclared (first use in this function)
        arch/mn10300/unit-asb2305/pci.c:481: error: (Each undeclared identifier is reported only once
        arch/mn10300/unit-asb2305/pci.c:481: error: for each function it appears in.)
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarKen Cox <jkc@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b8bc9b02
    • David Howells's avatar
      MN10300: Enable IRQs more in system call exit work path · d17fc238
      David Howells authored
      Enable IRQs when calling schedule() for TIF_NEED_RESCHED and
      do_notify_resume().  If interrupts are enabled during do_notify_resume(), a
      warning can be seen (see lower down).
      
      Whilst we're at it, resume_userspace can be made local to entry.S as it is not
      called outside of there and it can be merged with the part of work_resched that
      occurs after schedule() is called.
      
        WARNING: at kernel/softirq.c:160 local_bh_enable+0x42/0xa0()
        Call Trace:
          local_bh_enable+0x42/0xa0
          unix_release_sock+0x86/0x23c
          unix_release+0x20/0x28
          sock_release+0x17/0x88
          sock_close+0x20/0x28
          __fput+0xc9/0x1fc
          ____fput+0xb/0x10
          task_work_run+0x64/0x78
          do_notify_resume+0x53d/0x544
          work_notifysig+0xa/0xc
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarKen Cox <jkc@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d17fc238
    • David Howells's avatar
      MN10300: Fix ret_from_kernel_thread · 1e00227d
      David Howells authored
      ret_from_kernel_thread needs to set A2 to the thread_info pointer before
      jumping to syscall_exit.
      
      Without this, we never correctly start userspace.
      
      This was caused by the rejuggling of the fork/exec paths in commit
      ddf23e87 ("mn10300: switch to saner kernel_execve() semantics")
      Reported-by: default avatarKen Cox <jkc@redhat.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarKen Cox <jkc@redhat.com>
      Acked-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1e00227d
  6. 29 May, 2013 17 commits
  7. 28 May, 2013 4 commits
    • Zhang Yanfei's avatar
      x86-64, init: Fix a possible wraparound bug in switchover in head_64.S · e9d0626e
      Zhang Yanfei authored
      In head_64.S, a switchover has been used to handle kernel crossing
      1G, 512G boundaries.
      
      And commit 8170e6be
          x86, 64bit: Use a #PF handler to materialize early mappings on demand
      said:
          During the switchover in head_64.S, before #PF handler is available,
          we use three pages to handle kernel crossing 1G, 512G boundaries with
          sharing page by playing games with page aliasing: the same page is
          mapped twice in the higher-level tables with appropriate wraparound.
      
      But from the switchover code, when we set up the PUD table:
      114         addq    $4096, %rdx
      115         movq    %rdi, %rax
      116         shrq    $PUD_SHIFT, %rax
      117         andl    $(PTRS_PER_PUD-1), %eax
      118         movq    %rdx, (4096+0)(%rbx,%rax,8)
      119         movq    %rdx, (4096+8)(%rbx,%rax,8)
      
      It seems line 119 has a potential bug there. For example,
      if the kernel is loaded at physical address 511G+1008M, that is
          000000000 111111111 111111000 000000000000000000000
      and the kernel _end is 512G+2M, that is
          000000001 000000000 000000001 000000000000000000000
      So in this example, when using the 2nd page to setup PUD (line 114~119),
      rax is 511.
      In line 118, we put rdx which is the address of the PMD page (the 3rd page)
      into entry 511 of the PUD table. But in line 119, the entry we calculate from
      (4096+8)(%rbx,%rax,8) has exceeded the PUD page. IMO, the entry in line
      119 should be wraparound into entry 0 of the PUD table.
      
      The patch fixes the bug.
      Signed-off-by: default avatarZhang Yanfei <zhangyanfei@cn.fujitsu.com>
      Link: http://lkml.kernel.org/r/5191DE5A.3020302@cn.fujitsu.comSigned-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Cc: <stable@vger.kernel.org> v3.9
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      e9d0626e
    • J. Bruce Fields's avatar
      svcrpc: implement O_NONBLOCK behavior for use-gss-proxy · b161c144
      J. Bruce Fields authored
      Somebody noticed LTP was complaining about O_NONBLOCK opens of
      /proc/net/rpc/use-gss-proxy succeeding and then a following read
      hanging.
      
      I'm not convinced LTP really has any business opening random proc files
      and expecting them to behave a certain way.  Maybe this isn't really a
      bug.
      
      But in any case the O_NONBLOCK behavior could be useful for someone that
      wants to test whether gss-proxy is up without waiting.
      Reported-by: default avatarJan Stancek <jstancek@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      b161c144
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 58f8bbd2
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This is mostly exynos and intel fixes, along with some vblank patches
        I lost from Rob a few months ago that make wayland work better on lots
        of GPUs, also a qxl kconfig fix."
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (22 commits)
        qxl: fix Kconfig deps - select FB_DEFERRED_IO
        drm/exynos: replace request_threaded_irq with devm function
        drm/exynos: remove unnecessary devm_kfree
        drm/exynos: fix build warnings from ipp fimc
        drm/exynos: cleanup device pointer usages
        drm/exynos: wait for the completion of pending page flip
        drm/exynos: use drm_send_vblank_event() helper
        drm/i915: avoid premature DP AUX timeouts
        drm/i915: avoid premature timeouts in __wait_seqno()
        drm/i915: use msecs_to_jiffies_timeout instead of open coding the same
        drm/i915: add msecs_to_jiffies_timeout to guarantee minimum duration
        drm/i915: force full modeset if the connector is in DPMS OFF mode
        drm/exynos: page flip fixes
        drm/exynos: exynos_hdmi: Pass correct pointer to free_irq()
        drm/exynos: exynos_drm_ipp: Fix incorrect usage of IS_ERR_OR_NULL
        drm/exynos: exynos_drm_fbdev: Fix incorrect usage of IS_ERR_OR_NULL
        drm/imx: use drm_send_vblank_event() helper
        drm/shmob: use drm_send_vblank_event() helper
        drm/radeon: use drm_send_vblank_event() helper
        drm/nouveau: use drm_send_vblank_event() helper
        ...
      58f8bbd2
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 30a9e501
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "This push fixes a crash in the new sha256_ssse3 driver as well as a
        DMA setup/teardown bug in caam"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: sha256_ssse3 - fix stack corruption with SSSE3 and AVX implementations
        crypto: caam - fix inconsistent assoc dma mapping direction
      30a9e501