1. 09 Oct, 2018 19 commits
  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 13 commits