1. 18 11月, 2020 1 次提交
  2. 03 11月, 2020 3 次提交
  3. 02 11月, 2020 1 次提交
  4. 19 10月, 2020 1 次提交
  5. 07 10月, 2020 1 次提交
  6. 06 10月, 2020 2 次提交
  7. 01 10月, 2020 3 次提交
  8. 25 9月, 2020 1 次提交
    • C
      dma-mapping: add a new dma_alloc_pages API · efa70f2f
      Christoph Hellwig 提交于
      This API is the equivalent of alloc_pages, except that the returned memory
      is guaranteed to be DMA addressable by the passed in device.  The
      implementation will also be used to provide a more sensible replacement
      for DMA_ATTR_NON_CONSISTENT flag.
      
      Additionally dma_alloc_noncoherent is switched over to use dma_alloc_pages
      as its backend.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> (MIPS part)
      efa70f2f
  9. 24 9月, 2020 2 次提交
  10. 18 9月, 2020 3 次提交
  11. 16 9月, 2020 9 次提交
  12. 11 9月, 2020 1 次提交
  13. 04 9月, 2020 4 次提交
    • C
      iommu/vt-d: Handle 36bit addressing for x86-32 · 29aaebbc
      Chris Wilson 提交于
      Beware that the address size for x86-32 may exceed unsigned long.
      
      [    0.368971] UBSAN: shift-out-of-bounds in drivers/iommu/intel/iommu.c:128:14
      [    0.369055] shift exponent 36 is too large for 32-bit type 'long unsigned int'
      
      If we don't handle the wide addresses, the pages are mismapped and the
      device read/writes go astray, detected as DMAR faults and leading to
      device failure. The behaviour changed (from working to broken) in commit
      fa954e68 ("iommu/vt-d: Delegate the dma domain to upper layer"), but
      the error looks older.
      
      Fixes: fa954e68 ("iommu/vt-d: Delegate the dma domain to upper layer")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NLu Baolu <baolu.lu@linux.intel.com>
      Cc: James Sewart <jamessewart@arista.com>
      Cc: Lu Baolu <baolu.lu@linux.intel.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: <stable@vger.kernel.org> # v5.3+
      Link: https://lore.kernel.org/r/20200822160209.28512-1-chris@chris-wilson.co.ukSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      29aaebbc
    • L
      iommu/vt-d: Fix NULL pointer dereference in dev_iommu_priv_set() · 2d33b7d6
      Lu Baolu 提交于
      The dev_iommu_priv_set() must be called after probe_device(). This fixes
      a NULL pointer deference bug when booting a system with kernel cmdline
      "intel_iommu=on,igfx_off", where the dev_iommu_priv_set() is abused.
      
      The following stacktrace was produced:
      
       Command line: BOOT_IMAGE=/isolinux/bzImage console=tty1 intel_iommu=on,igfx_off
       ...
       DMAR: Host address width 39
       DMAR: DRHD base: 0x000000fed90000 flags: 0x0
       DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
       DMAR: DRHD base: 0x000000fed91000 flags: 0x1
       DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
       DMAR: RMRR base: 0x0000009aa9f000 end: 0x0000009aabefff
       DMAR: RMRR base: 0x0000009d000000 end: 0x0000009f7fffff
       DMAR: No ATSR found
       BUG: kernel NULL pointer dereference, address: 0000000000000038
       #PF: supervisor write access in kernel mode
       #PF: error_code(0x0002) - not-present page
       PGD 0 P4D 0
       Oops: 0002 [#1] SMP PTI
       CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.9.0-devel+ #2
       Hardware name: LENOVO 20HGS0TW00/20HGS0TW00, BIOS N1WET46S (1.25s ) 03/30/2018
       RIP: 0010:intel_iommu_init+0xed0/0x1136
       Code: fe e9 61 02 00 00 bb f4 ff ff ff e9 57 02 00 00 48 63 d1 48 c1 e2 04 48
             03 50 20 48 8b 12 48 85 d2 74 0b 48 8b 92 d0 02 00 00 48 89 7a 38 ff c1
             e9 15 f5 ff ff 48 c7 c7 60 99 ac a7 49 c7 c7 a0
       RSP: 0000:ffff96d180073dd0 EFLAGS: 00010282
       RAX: ffff8c91037a7d20 RBX: 0000000000000000 RCX: 0000000000000000
       RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffffffffffff
       RBP: ffff96d180073e90 R08: 0000000000000001 R09: ffff8c91039fe3c0
       R10: 0000000000000226 R11: 0000000000000226 R12: 000000000000000b
       R13: ffff8c910367c650 R14: ffffffffa8426d60 R15: 0000000000000000
       FS:  0000000000000000(0000) GS:ffff8c9107480000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000038 CR3: 00000004b100a001 CR4: 00000000003706e0
       Call Trace:
        ? _raw_spin_unlock_irqrestore+0x1f/0x30
        ? call_rcu+0x10e/0x320
        ? trace_hardirqs_on+0x2c/0xd0
        ? rdinit_setup+0x2c/0x2c
        ? e820__memblock_setup+0x8b/0x8b
        pci_iommu_init+0x16/0x3f
        do_one_initcall+0x46/0x1e4
        kernel_init_freeable+0x169/0x1b2
        ? rest_init+0x9f/0x9f
        kernel_init+0xa/0x101
        ret_from_fork+0x22/0x30
       Modules linked in:
       CR2: 0000000000000038
       ---[ end trace 3653722a6f936f18 ]---
      
      Fixes: 01b9d4e2 ("iommu/vt-d: Use dev_iommu_priv_get/set()")
      Reported-by: NTorsten Hilbrich <torsten.hilbrich@secunet.com>
      Reported-by: NWendy Wang <wendy.wang@intel.com>
      Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com>
      Tested-by: NTorsten Hilbrich <torsten.hilbrich@secunet.com>
      Link: https://lore.kernel.org/linux-iommu/96717683-70be-7388-3d2f-61131070a96a@secunet.com/
      Link: https://lore.kernel.org/r/20200903065132.16879-1-baolu.lu@linux.intel.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      2d33b7d6
    • L
      iommu/vt-d: Serialize IOMMU GCMD register modifications · 6e4e9ec6
      Lu Baolu 提交于
      The VT-d spec requires (10.4.4 Global Command Register, GCMD_REG General
      Description) that:
      
      If multiple control fields in this register need to be modified, software
      must serialize the modifications through multiple writes to this register.
      
      However, in irq_remapping.c, modifications of IRE and CFI are done in one
      write. We need to do two separate writes with STS checking after each. It
      also checks the status register before writing command register to avoid
      unnecessary register write.
      
      Fixes: af8d102f ("x86/intel/irq_remapping: Clean up x2apic opt-out security warning mess")
      Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com>
      Reviewed-by: NKevin Tian <kevin.tian@intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
      Cc: Kevin Tian <kevin.tian@intel.com>
      Cc: Ashok Raj <ashok.raj@intel.com>
      Link: https://lore.kernel.org/r/20200828000615.8281-1-baolu.lu@linux.intel.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      6e4e9ec6
    • K
      iommu/vt-d: Drop kerneldoc marker from regular comment · 3207fa32
      Krzysztof Kozlowski 提交于
      Fix W=1 compile warnings (invalid kerneldoc):
      
          drivers/iommu/intel/dmar.c:389: warning: Function parameter or member 'header' not described in 'dmar_parse_one_drhd'
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Link: https://lore.kernel.org/r/20200728170859.28143-2-krzk@kernel.orgSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      3207fa32
  14. 24 8月, 2020 1 次提交
  15. 13 8月, 2020 1 次提交
    • P
      mm: do page fault accounting in handle_mm_fault · bce617ed
      Peter Xu 提交于
      Patch series "mm: Page fault accounting cleanups", v5.
      
      This is v5 of the pf accounting cleanup series.  It originates from Gerald
      Schaefer's report on an issue a week ago regarding to incorrect page fault
      accountings for retried page fault after commit 4064b982 ("mm: allow
      VM_FAULT_RETRY for multiple times"):
      
        https://lore.kernel.org/lkml/20200610174811.44b94525@thinkpad/
      
      What this series did:
      
        - Correct page fault accounting: we do accounting for a page fault
          (no matter whether it's from #PF handling, or gup, or anything else)
          only with the one that completed the fault.  For example, page fault
          retries should not be counted in page fault counters.  Same to the
          perf events.
      
        - Unify definition of PERF_COUNT_SW_PAGE_FAULTS: currently this perf
          event is used in an adhoc way across different archs.
      
          Case (1): for many archs it's done at the entry of a page fault
          handler, so that it will also cover e.g.  errornous faults.
      
          Case (2): for some other archs, it is only accounted when the page
          fault is resolved successfully.
      
          Case (3): there're still quite some archs that have not enabled
          this perf event.
      
          Since this series will touch merely all the archs, we unify this
          perf event to always follow case (1), which is the one that makes most
          sense.  And since we moved the accounting into handle_mm_fault, the
          other two MAJ/MIN perf events are well taken care of naturally.
      
        - Unify definition of "major faults": the definition of "major
          fault" is slightly changed when used in accounting (not
          VM_FAULT_MAJOR).  More information in patch 1.
      
        - Always account the page fault onto the one that triggered the page
          fault.  This does not matter much for #PF handlings, but mostly for
          gup.  More information on this in patch 25.
      
      Patchset layout:
      
      Patch 1:     Introduced the accounting in handle_mm_fault(), not enabled.
      Patch 2-23:  Enable the new accounting for arch #PF handlers one by one.
      Patch 24:    Enable the new accounting for the rest outliers (gup, iommu, etc.)
      Patch 25:    Cleanup GUP task_struct pointer since it's not needed any more
      
      This patch (of 25):
      
      This is a preparation patch to move page fault accountings into the
      general code in handle_mm_fault().  This includes both the per task
      flt_maj/flt_min counters, and the major/minor page fault perf events.  To
      do this, the pt_regs pointer is passed into handle_mm_fault().
      
      PERF_COUNT_SW_PAGE_FAULTS should still be kept in per-arch page fault
      handlers.
      
      So far, all the pt_regs pointer that passed into handle_mm_fault() is
      NULL, which means this patch should have no intented functional change.
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Alexander Gordeev <agordeev@linux.ibm.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: John Hubbard <jhubbard@nvidia.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200707225021.200906-1-peterx@redhat.com
      Link: http://lkml.kernel.org/r/20200707225021.200906-2-peterx@redhat.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bce617ed
  16. 06 8月, 2020 1 次提交
  17. 29 7月, 2020 1 次提交
  18. 24 7月, 2020 4 次提交