1. 18 2月, 2019 1 次提交
    • E
      ACPICA: Remove legacy module-level code support · aa342261
      Erik Schmauss 提交于
      ACPICA commit 47f5607c204719d9239a12b889df725225098c8f
      
      Module-level code refers to executable ASL code that runs during
      table load. This is typically used in ASL to declare named objects
      based on a condition evaluated during table load like so:
      
      definition_block(...)
      {
        opreation_region (OPR1, system_memory, ...)
        Field (OPR1)
        {
          FLD1, 8 /* Assume that FLD1's value is 0x1 */
        }
      
        /* The if statement below is referred to as module-level code */
      
        If (FLD1)
        {
          /* Declare DEV1 conditionally */
          Device (DEV1) {...}
        }
      
        Device (DEV2)
        {
          ...
        }
      }
      
      In legacy module-level code, the execution of the If statement
      was deferred after other modules were loaded. The order of
      code execution for the table above is the following:
      
      1.) Load OPR1 to the ACPI Namespace
      2.) Load FLD1 to the ACPI Namespace (not intended for drivers)
      3.) Load DEV2 to the ACPI Namespace
      4.) Execute If (FLD1) and load DEV1 if the condition is true
      
      This legacy approach can be problematic for tables that look like the
      following:
      
      definition_block(...)
      {
        opreation_region (OPR1, system_memory, ...)
        Field (OPR1)
        {
          FLD1, 8 /* Assume that FLD1's value is 0x1 */
        }
      
        /* The if statement below is referred to as module-level code */
      
        If (FLD1)
        {
          /* Declare DEV1 conditionally */
          Device (DEV1) {...}
        }
      
        Scope (DEV1)
        {
          /* Add objects DEV1's scope */
          Name (OBJ1, 0x1234)
        }
      }
      
      When loading this in the legacy approach, Scope DEV1 gets evaluated
      before the If statement. The following is the order of execution:
      
      1.) Load OPR1 to the ACPI Namespace
      2.) Load FLD1 to the ACPI Namespace (not intended for drivers)
      3.) Add OBJ1 under DEV1's scope -- ERROR. DEV1 does not exist
      4.) Execute If (FLD1) and load DEV1 if the condition is true
      
      The legacy approach can never succeed for tables like this due to the
      deferral of the module-level code. Due to this limitation, a new
      module-level code was developed. This new approach exeutes if
      statements in the order that they appear in the definition block.
      With this approach, the order of execution for the above defintion
      block is as follows:
      
      1.) Load OPR1 to the ACPI Namespace
      2.) Load FLD1 to the ACPI Namespace (not intended for drivers)
      3.) Execute If (FLD1) and load DEV1 because the condition is true
      4.) Add OBJ1 under DEV1's scope.
      
      Since DEV1 is loaded in the namespace in step 3, step 4 executes
      successfully.
      
      This change removes support for the legacy module-level code
      execution. From this point onward, the new module-level code
      execution will be the official approach.
      
      Link: https://github.com/acpica/acpica/commit/47f5607cSigned-off-by: NErik Schmauss <erik.schmauss@intel.com>
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      aa342261
  2. 07 2月, 2019 1 次提交
  3. 16 1月, 2019 3 次提交
  4. 13 1月, 2019 1 次提交
  5. 11 1月, 2019 1 次提交
  6. 10 1月, 2019 2 次提交
  7. 09 1月, 2019 4 次提交
    • W
      x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE · e4f35891
      WANG Chao 提交于
      Commit
      
        4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      
      replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the
      remaining pieces.
      
       [ bp: Massage commit message. ]
      
      Fixes: 4cd24de3 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
      Signed-off-by: NWANG Chao <chao.wang@ucloud.cn>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NZhenzhong Duan <zhenzhong.duan@oracle.com>
      Reviewed-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Woodhouse <dwmw@amazon.co.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: linux-kbuild@vger.kernel.org
      Cc: srinivas.eeda@oracle.com
      Cc: stable <stable@vger.kernel.org>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn
      e4f35891
    • B
      x86/cache: Rename config option to CONFIG_X86_RESCTRL · 90802938
      Borislav Petkov 提交于
      CONFIG_RESCTRL is too generic. The final goal is to have a generic
      option called like this which is selected by the arch-specific ones
      CONFIG_X86_RESCTRL and CONFIG_ARM64_RESCTRL. The generic one will
      cover the resctrl filesystem and other generic and shared bits of
      functionality.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Suggested-by: NIngo Molnar <mingo@kernel.org>
      Requested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Babu Moger <babu.moger@amd.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: James Morse <james.morse@arm.com>
      Cc: Reinette Chatre <reinette.chatre@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: x86@kernel.org
      Link: http://lkml.kernel.org/r/20190108171401.GC12235@zn.tnic
      90802938
    • M
      mm, page_alloc: do not wake kswapd with zone lock held · 73444bc4
      Mel Gorman 提交于
      syzbot reported the following regression in the latest merge window and
      it was confirmed by Qian Cai that a similar bug was visible from a
      different context.
      
        ======================================================
        WARNING: possible circular locking dependency detected
        4.20.0+ #297 Not tainted
        ------------------------------------------------------
        syz-executor0/8529 is trying to acquire lock:
        000000005e7fb829 (&pgdat->kswapd_wait){....}, at:
        __wake_up_common_lock+0x19e/0x330 kernel/sched/wait.c:120
      
        but task is already holding lock:
        000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: spin_lock
        include/linux/spinlock.h:329 [inline]
        000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: rmqueue_bulk
        mm/page_alloc.c:2548 [inline]
        000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: __rmqueue_pcplist
        mm/page_alloc.c:3021 [inline]
        000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: rmqueue_pcplist
        mm/page_alloc.c:3050 [inline]
        000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: rmqueue
        mm/page_alloc.c:3072 [inline]
        000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at:
        get_page_from_freelist+0x1bae/0x52a0 mm/page_alloc.c:3491
      
      It appears to be a false positive in that the only way the lock ordering
      should be inverted is if kswapd is waking itself and the wakeup
      allocates debugging objects which should already be allocated if it's
      kswapd doing the waking.  Nevertheless, the possibility exists and so
      it's best to avoid the problem.
      
      This patch flags a zone as needing a kswapd using the, surprisingly,
      unused zone flag field.  The flag is read without the lock held to do
      the wakeup.  It's possible that the flag setting context is not the same
      as the flag clearing context or for small races to occur.  However, each
      race possibility is harmless and there is no visible degredation in
      fragmentation treatment.
      
      While zone->flag could have continued to be unused, there is potential
      for moving some existing fields into the flags field instead.
      Particularly read-mostly ones like zone->initialized and
      zone->contiguous.
      
      Link: http://lkml.kernel.org/r/20190103225712.GJ31517@techsingularity.net
      Fixes: 1c30844d ("mm: reclaim small amounts of memory when an external fragmentation event occurs")
      Reported-by: syzbot+93d94a001cfbce9e60e1@syzkaller.appspotmail.com
      Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Tested-by: NQian Cai <cai@lca.pw>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@suse.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      73444bc4
    • L
      drm/dp_mst: Add __must_check to drm_dp_mst_topology_mgr_resume() · c235316d
      Lyude Paul 提交于
      Since I've had to fix two cases of drivers not checking the return code
      from this function, let's make the compiler complain so this doesn't
      come up again in the future.
      
      Changes since v1:
      * Remove unneeded __must_check in function declaration - danvet
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Reviewed-by: NDaniel Vetter <daniel@ffwll.ch>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190108211133.32564-4-lyude@redhat.com
      c235316d
  8. 08 1月, 2019 4 次提交
  9. 07 1月, 2019 2 次提交
  10. 06 1月, 2019 3 次提交
    • E
      fscrypt: add Adiantum support · 8094c3ce
      Eric Biggers 提交于
      Add support for the Adiantum encryption mode to fscrypt.  Adiantum is a
      tweakable, length-preserving encryption mode with security provably
      reducible to that of XChaCha12 and AES-256, subject to a security bound.
      It's also a true wide-block mode, unlike XTS.  See the paper
      "Adiantum: length-preserving encryption for entry-level processors"
      (https://eprint.iacr.org/2018/720.pdf) for more details.  Also see
      commit 059c2a4d ("crypto: adiantum - add Adiantum support").
      
      On sufficiently long messages, Adiantum's bottlenecks are XChaCha12 and
      the NH hash function.  These algorithms are fast even on processors
      without dedicated crypto instructions.  Adiantum makes it feasible to
      enable storage encryption on low-end mobile devices that lack AES
      instructions; currently such devices are unencrypted.  On ARM Cortex-A7,
      on 4096-byte messages Adiantum encryption is about 4 times faster than
      AES-256-XTS encryption; decryption is about 5 times faster.
      
      In fscrypt, Adiantum is suitable for encrypting both file contents and
      names.  With filenames, it fixes a known weakness: when two filenames in
      a directory share a common prefix of >= 16 bytes, with CTS-CBC their
      encrypted filenames share a common prefix too, leaking information.
      Adiantum does not have this problem.
      
      Since Adiantum also accepts long tweaks (IVs), it's also safe to use the
      master key directly for Adiantum encryption rather than deriving
      per-file keys, provided that the per-file nonce is included in the IVs
      and the master key isn't used for any other encryption mode.  This
      configuration saves memory and improves performance.  A new fscrypt
      policy flag is added to allow users to opt-in to this configuration.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      8094c3ce
    • M
      arch: remove stale comments "UAPI Header export list" · d4ce5458
      Masahiro Yamada 提交于
      These comments are leftovers of commit fcc8487d ("uapi: export all
      headers under uapi directories").
      
      Prior to that commit, exported headers must be explicitly added to
      header-y. Now, all headers under the uapi/ directories are exported.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      d4ce5458
    • M
      jump_label: move 'asm goto' support test to Kconfig · e9666d10
      Masahiro Yamada 提交于
      Currently, CONFIG_JUMP_LABEL just means "I _want_ to use jump label".
      
      The jump label is controlled by HAVE_JUMP_LABEL, which is defined
      like this:
      
        #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
        # define HAVE_JUMP_LABEL
        #endif
      
      We can improve this by testing 'asm goto' support in Kconfig, then
      make JUMP_LABEL depend on CC_HAS_ASM_GOTO.
      
      Ugly #ifdef HAVE_JUMP_LABEL will go away, and CONFIG_JUMP_LABEL will
      match to the real kernel capability.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Tested-by: NSedat Dilek <sedat.dilek@gmail.com>
      e9666d10
  11. 05 1月, 2019 16 次提交
  12. 04 1月, 2019 2 次提交