1. 09 Oct, 2018 1 commit
  2. 06 Oct, 2018 7 commits
    • Ingo Molnar's avatar
      x86/mm/doc: Enhance the x86-64 virtual memory layout descriptions · 32b89760
      Ingo Molnar authored
      After the cleanups from Baoquan He, make it even more readable:
      
       - Remove the 'bits' area size column: it's pretty pointless and was even
         wrong for some of the entries. Given that MB, GB, TB, PT are 10, 20,
         30 and 40 bits, a "8 TB" size description makes it obvious that it's
         43 bits.
      
       - Introduce an "offset" column:
      
          --------------------------------------------------------------------------------
          start addr       | offset     | end addr         |  size   | VM area description
          -----------------|------------|------------------|---------|--------------------
          ...
          ffff880000000000 | -120    TB | ffffc7ffffffffff |   64 TB | direct mapping of all physical memory (page_offset_base),
                                                                       this is what limits max physical memory supported.
      
         The -120 TB notation makes it obvious where this particular virtual memory
         region starts: 120 TB down from the top of the 64-bit virtual memory space.
         Especially the layout of the kernel mappings is a *lot* more obvious when
         written this way, plus it's much easier to compare it with the size column
         and understand/check/validate and modify the kernel's layout in the future.
      
       - Mark the part from where the 47-bit and 56-bit kernel layouts are 100% identical,
         this starts at the -512 GB offset and the EFI region.
      
       - Re-shuffle the size desciptions to be continous blocks of sizes, instead of the
         often mixed size. I.e. write "0.5 TB" instead of "512 GB" if we are still in
         the TB-granular region of the map.
      
       - Make the 47-bit and 56-bit descriptions use the *exact* same layout and wording,
         and only differ where there's a material difference. This makes it easy to compare
         the two tables side by side by switching between two terminal tabs.
      
       - Plus enhance a lot of other stylistic/typographical details: make the tables
         explicitly tabular, add headers, enhance certain entries, etc. etc.
      
      Note that there are some apparent errors in the tables as well, but I'll fix
      them in a separate patch to make it easier to review/validate.
      
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: corbet@lwn.net
      Cc: linux-doc@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: thgarnie@google.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      32b89760
    • Baoquan He's avatar
      x86/mm/doc: Clean up the x86-64 virtual memory layout descriptions · 5b129040
      Baoquan He authored
      In Documentation/x86/x86_64/mm.txt, the description of the x86-64 virtual
      memory layout has become a confusing hodgepodge of inconsistencies:
      
       - there's a hard to read mixture of 'TB' and 'bits' notation
       - the entries sometimes mention a size in the description and sometimes not
       - sometimes they list holes by address, sometimes only as an 'unused hole' line
      
      So make it all a coherent, readable, well organized description.
      Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: corbet@lwn.net
      Cc: linux-doc@vger.kernel.org
      Cc: thgarnie@google.com
      Link: http://lkml.kernel.org/r/20181006084327.27467-3-bhe@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5b129040
    • Baoquan He's avatar
      x86/KASLR: Update KERNEL_IMAGE_SIZE description · 06d4a462
      Baoquan He authored
      Currently CONFIG_RANDOMIZE_BASE=y is set by default, which makes some of the
      old comments above the KERNEL_IMAGE_SIZE definition out of date. Update them
      to the current state of affairs.
      Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: corbet@lwn.net
      Cc: linux-doc@vger.kernel.org
      Cc: thgarnie@google.com
      Link: http://lkml.kernel.org/r/20181006084327.27467-2-bhe@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      06d4a462
    • Lianbo Jiang's avatar
      kdump, proc/vmcore: Enable kdumping encrypted memory with SME enabled · 992b649a
      Lianbo Jiang authored
      In the kdump kernel, the memory of the first kernel needs to be dumped
      into the vmcore file.
      
      If SME is enabled in the first kernel, the old memory has to be remapped
      with the memory encryption mask in order to access it properly.
      
      Split copy_oldmem_page() functionality to handle encrypted memory
      properly.
      
       [ bp: Heavily massage everything. ]
      Signed-off-by: default avatarLianbo Jiang <lijiang@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: kexec@lists.infradead.org
      Cc: tglx@linutronix.de
      Cc: mingo@redhat.com
      Cc: hpa@zytor.com
      Cc: akpm@linux-foundation.org
      Cc: dan.j.williams@intel.com
      Cc: bhelgaas@google.com
      Cc: baiyaowei@cmss.chinamobile.com
      Cc: tiwai@suse.de
      Cc: brijesh.singh@amd.com
      Cc: dyoung@redhat.com
      Cc: bhe@redhat.com
      Cc: jroedel@suse.de
      Link: https://lkml.kernel.org/r/be7b47f9-6be6-e0d1-2c2a-9125bc74b818@redhat.com
      992b649a
    • Lianbo Jiang's avatar
      iommu/amd: Remap the IOMMU device table with the memory encryption mask for kdump · 8780158c
      Lianbo Jiang authored
      The kdump kernel copies the IOMMU device table from the old device table
      which is encrypted when SME is enabled in the first kernel. So remap the
      old device table with the memory encryption mask in the kdump kernel.
      
       [ bp: Massage commit message. ]
      Signed-off-by: default avatarLianbo Jiang <lijiang@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Acked-by: default avatarJoerg Roedel <jroedel@suse.de>
      Cc: kexec@lists.infradead.org
      Cc: tglx@linutronix.de
      Cc: mingo@redhat.com
      Cc: hpa@zytor.com
      Cc: akpm@linux-foundation.org
      Cc: dan.j.williams@intel.com
      Cc: bhelgaas@google.com
      Cc: baiyaowei@cmss.chinamobile.com
      Cc: tiwai@suse.de
      Cc: brijesh.singh@amd.com
      Cc: dyoung@redhat.com
      Cc: bhe@redhat.com
      Link: https://lkml.kernel.org/r/20180930031033.22110-4-lijiang@redhat.com
      8780158c
    • Lianbo Jiang's avatar
      kexec: Allocate decrypted control pages for kdump if SME is enabled · 9cf38d55
      Lianbo Jiang authored
      When SME is enabled in the first kernel, it needs to allocate decrypted
      pages for kdump because when the kdump kernel boots, these pages need to
      be accessed decrypted in the initial boot stage, before SME is enabled.
      
       [ bp: clean up text. ]
      Signed-off-by: default avatarLianbo Jiang <lijiang@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Cc: kexec@lists.infradead.org
      Cc: tglx@linutronix.de
      Cc: mingo@redhat.com
      Cc: hpa@zytor.com
      Cc: akpm@linux-foundation.org
      Cc: dan.j.williams@intel.com
      Cc: bhelgaas@google.com
      Cc: baiyaowei@cmss.chinamobile.com
      Cc: tiwai@suse.de
      Cc: brijesh.singh@amd.com
      Cc: dyoung@redhat.com
      Cc: bhe@redhat.com
      Cc: jroedel@suse.de
      Link: https://lkml.kernel.org/r/20180930031033.22110-3-lijiang@redhat.com
      9cf38d55
    • Lianbo Jiang's avatar
      x86/ioremap: Add an ioremap_encrypted() helper · c3a7a61c
      Lianbo Jiang authored
      When SME is enabled, the memory is encrypted in the first kernel. In
      this case, SME also needs to be enabled in the kdump kernel, and we have
      to remap the old memory with the memory encryption mask.
      
      The case of concern here is if SME is active in the first kernel,
      and it is active too in the kdump kernel. There are four cases to be
      considered:
      
      a. dump vmcore
         It is encrypted in the first kernel, and needs be read out in the
         kdump kernel.
      
      b. crash notes
         When dumping vmcore, the people usually need to read useful
         information from notes, and the notes is also encrypted.
      
      c. iommu device table
         It's encrypted in the first kernel, kdump kernel needs to access its
         content to analyze and get information it needs.
      
      d. mmio of AMD iommu
         not encrypted in both kernels
      
      Add a new bool parameter @encrypted to __ioremap_caller(). If set,
      memory will be remapped with the SME mask.
      
      Add a new function ioremap_encrypted() to explicitly pass in a true
      value for @encrypted. Use ioremap_encrypted() for the above a, b, c
      cases.
      
       [ bp: cleanup commit message, extern defs in io.h and drop forgotten
         include. ]
      Signed-off-by: default avatarLianbo Jiang <lijiang@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Cc: kexec@lists.infradead.org
      Cc: tglx@linutronix.de
      Cc: mingo@redhat.com
      Cc: hpa@zytor.com
      Cc: akpm@linux-foundation.org
      Cc: dan.j.williams@intel.com
      Cc: bhelgaas@google.com
      Cc: baiyaowei@cmss.chinamobile.com
      Cc: tiwai@suse.de
      Cc: brijesh.singh@amd.com
      Cc: dyoung@redhat.com
      Cc: bhe@redhat.com
      Cc: jroedel@suse.de
      Link: https://lkml.kernel.org/r/20180927071954.29615-2-lijiang@redhat.com
      c3a7a61c
  3. 03 Oct, 2018 1 commit
  4. 27 Sep, 2018 19 commits
  5. 23 Sep, 2018 7 commits
  6. 22 Sep, 2018 1 commit
    • Omar Sandoval's avatar
      block: use nanosecond resolution for iostat · b57e99b4
      Omar Sandoval authored
      Klaus Kusche reported that the I/O busy time in /proc/diskstats was not
      updating properly on 4.18. This is because we started using ktime to
      track elapsed time, and we convert nanoseconds to jiffies when we update
      the partition counter. However, this gets rounded down, so any I/Os that
      take less than a jiffy are not accounted for. Previously in this case,
      the value of jiffies would sometimes increment while we were doing I/O,
      so at least some I/Os were accounted for.
      
      Let's convert the stats to use nanoseconds internally. We still report
      milliseconds as before, now more accurately than ever. The value is
      still truncated to 32 bits for backwards compatibility.
      
      Fixes: 522a7775 ("block: consolidate struct request timestamp fields")
      Cc: stable@vger.kernel.org
      Reported-by: default avatarKlaus Kusche <klaus.kusche@computerix.info>
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b57e99b4
  7. 21 Sep, 2018 4 commits
    • Greg Kroah-Hartman's avatar
      Merge tag 'pinctrl-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 10dc890d
      Greg Kroah-Hartman authored
      Linus writes:
        "Pin control fixes for v4.19:
         - Two fixes for the Intel pin controllers than cause
           problems on laptops."
      
      * tag 'pinctrl-v4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: intel: Do pin translation in other GPIO operations as well
        pinctrl: cannonlake: Fix gpio base for GPP-E
      10dc890d
    • Greg Kroah-Hartman's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · a27fb6d9
      Greg Kroah-Hartman authored
      Paolo writes:
        "It's mostly small bugfixes and cleanups, mostly around x86 nested
         virtualization.  One important change, not related to nested
         virtualization, is that the ability for the guest kernel to trap
         CPUID instructions (in Linux that's the ARCH_SET_CPUID arch_prctl) is
         now masked by default.  This is because the feature is detected
         through an MSR; a very bad idea that Intel seems to like more and
         more.  Some applications choke if the other fields of that MSR are
         not initialized as on real hardware, hence we have to disable the
         whole MSR by default, as was the case before Linux 4.12."
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (23 commits)
        KVM: nVMX: Fix bad cleanup on error of get/set nested state IOCTLs
        kvm: selftests: Add platform_info_test
        KVM: x86: Control guest reads of MSR_PLATFORM_INFO
        KVM: x86: Turbo bits in MSR_PLATFORM_INFO
        nVMX x86: Check VPID value on vmentry of L2 guests
        nVMX x86: check posted-interrupt descriptor addresss on vmentry of L2
        KVM: nVMX: Wake blocked vCPU in guest-mode if pending interrupt in virtual APICv
        KVM: VMX: check nested state and CR4.VMXE against SMM
        kvm: x86: make kvm_{load|put}_guest_fpu() static
        x86/hyper-v: rename ipi_arg_{ex,non_ex} structures
        KVM: VMX: use preemption timer to force immediate VMExit
        KVM: VMX: modify preemption timer bit only when arming timer
        KVM: VMX: immediately mark preemption timer expired only for zero value
        KVM: SVM: Switch to bitmap_zalloc()
        KVM/MMU: Fix comment in walk_shadow_page_lockless_end()
        kvm: selftests: use -pthread instead of -lpthread
        KVM: x86: don't reset root in kvm_mmu_setup()
        kvm: mmu: Don't read PDPTEs when paging is not enabled
        x86/kvm/lapic: always disable MMIO interface in x2APIC mode
        KVM: s390: Make huge pages unavailable in ucontrol VMs
        ...
      a27fb6d9
    • Greg Kroah-Hartman's avatar
      Merge tag 'upstream-4.19-rc4' of git://git.infradead.org/linux-ubifs · 0eba8697
      Greg Kroah-Hartman authored
      Richard writes:
        "This pull request contains fixes for UBIFS:
         - A wrong UBIFS assertion in mount code
         - Fix for a NULL pointer deref in mount code
         - Revert of a bad fix for xattrs"
      
      * tag 'upstream-4.19-rc4' of git://git.infradead.org/linux-ubifs:
        Revert "ubifs: xattr: Don't operate on deleted inodes"
        ubifs: drop false positive assertion
        ubifs: Check for name being NULL while mounting
      0eba8697
    • Greg Kroah-Hartman's avatar
      Merge tag 'for-linus-20180920' of git://git.kernel.dk/linux-block · 211b100a
      Greg Kroah-Hartman authored
      Jens writes:
        "Storage fixes for 4.19-rc5
      
        - Fix for leaking kernel pointer in floppy ioctl (Andy Whitcroft)
      
        - NVMe pull request from Christoph, and a single ANA log page fix
          (Hannes)
      
        - Regression fix for libata qd32 support, where we trigger an illegal
          active command transition. This fixes a CD-ROM detection issue that
          was reported, but could also trigger premature completion of the
          internal tag (me)"
      
      * tag 'for-linus-20180920' of git://git.kernel.dk/linux-block:
        floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl
        libata: mask swap internal and hardware tag
        nvme: count all ANA groups for ANA Log page
      211b100a