<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include/asm/set_memory.h, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-10-04T14:33:44Z</updated>
<entry>
<title>x86/tdx: Convert shared memory back to private on kexec</title>
<updated>2024-10-04T14:33:44Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2024-06-14T09:58:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37263b5d4c18fba46fcfb8e5e2c6ead96ae779a3'/>
<id>urn:sha1:37263b5d4c18fba46fcfb8e5e2c6ead96ae779a3</id>
<content type='text'>
[ Upstream commit 859e63b789d6b17b3c64e51a0aabdc58752a0254 ]

TDX guests allocate shared buffers to perform I/O. It is done by allocating
pages normally from the buddy allocator and converting them to shared with
set_memory_decrypted().

The second, kexec-ed kernel has no idea what memory is converted this way. It
only sees E820_TYPE_RAM.

Accessing shared memory via private mapping is fatal. It leads to unrecoverable
TD exit.

On kexec, walk direct mapping and convert all shared memory back to private. It
makes all RAM private again and second kernel may use it normally.

The conversion occurs in two steps: stopping new conversions and unsharing all
memory. In the case of normal kexec, the stopping of conversions takes place
while scheduling is still functioning. This allows for waiting until any ongoing
conversions are finished. The second step is carried out when all CPUs except one
are inactive and interrupts are disabled. This prevents any conflicts with code
that may access shared memory.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Rick Edgecombe &lt;rick.p.edgecombe@intel.com&gt;
Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Tested-by: Tao Liu &lt;ltao@redhat.com&gt;
Link: https://lore.kernel.org/r/20240614095904.1345461-12-kirill.shutemov@linux.intel.com
Stable-dep-of: d4fc4d014715 ("x86/tdx: Fix "in-kernel MMIO" check")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/mm: Regularize set_memory_p() parameters and make non-static</title>
<updated>2024-03-01T08:31:41Z</updated>
<author>
<name>Michael Kelley</name>
</author>
<published>2024-01-16T02:20:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=030ad7af94371f1faeecfc12dda296d8b5a17ef8'/>
<id>urn:sha1:030ad7af94371f1faeecfc12dda296d8b5a17ef8</id>
<content type='text'>
set_memory_p() is currently static.  It has parameters that don't
match set_memory_p() under arch/powerpc and that aren't congruent
with the other set_memory_* functions. There's no good reason for
the difference.

Fix this by making the parameters consistent, and update the one
existing call site.  Make the function non-static and add it to
include/asm/set_memory.h so that it is completely parallel to
set_memory_np() and is usable in other modules.

No functional change.

Signed-off-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Rick Edgecombe &lt;rick.p.edgecombe@intel.com&gt;
Acked-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20240116022008.1023398-3-mhklinux@outlook.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
Message-ID: &lt;20240116022008.1023398-3-mhklinux@outlook.com&gt;
</content>
</entry>
<entry>
<title>x86/mm: Implement native set_memory_rox()</title>
<updated>2022-12-15T18:37:27Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2022-10-29T11:19:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60463628c9e0a8060ac6bef0457b0505c7532c7c'/>
<id>urn:sha1:60463628c9e0a8060ac6bef0457b0505c7532c7c</id>
<content type='text'>
Provide a native implementation of set_memory_rox(), avoiding the
double set_memory_ro();set_memory_x(); calls.

Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>x86/mce: relocate set{clear}_mce_nospec() functions</title>
<updated>2022-05-16T18:46:44Z</updated>
<author>
<name>Jane Chu</name>
</author>
<published>2022-05-16T18:21:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3fdf9398a16f01dc013967a4ab25e99c3f4fc12'/>
<id>urn:sha1:b3fdf9398a16f01dc013967a4ab25e99c3f4fc12</id>
<content type='text'>
Relocate the twin mce functions to arch/x86/mm/pat/set_memory.c
file where they belong.

While at it, fixup a function name in a comment.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Jane Chu &lt;jane.chu@oracle.com&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
[sfr: gate {set,clear}_mce_nospec() by CONFIG_X86_64]
Link: https://lore.kernel.org/r/165272527328.90175.8336008202048685278.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'x86_cleanups_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2022-03-21T18:49:16Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2022-03-21T18:49:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eaa54b1458ca84092e513d554dd6d234245e6bef'/>
<id>urn:sha1:eaa54b1458ca84092e513d554dd6d234245e6bef</id>
<content type='text'>
Pull x86 cleanups from Borislav Petkov:

 - Remove a misleading message and an unused function

* tag 'x86_cleanups_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/nmi: Remove the 'strange power saving mode' hint from unknown NMI handler
  x86/pat: Remove the unused set_pages_array_wt() function
</content>
</entry>
<entry>
<title>x86/mm/cpa: Generalize __set_memory_enc_pgtable()</title>
<updated>2022-02-23T18:14:29Z</updated>
<author>
<name>Brijesh Singh</name>
</author>
<published>2022-02-23T04:35:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1e8c5971c249893ac33ca983c32bafcf5d50c727'/>
<id>urn:sha1:1e8c5971c249893ac33ca983c32bafcf5d50c727</id>
<content type='text'>
The kernel provides infrastructure to set or clear the encryption mask
from the pages for AMD SEV, but TDX requires few tweaks.

- TDX and SEV have different requirements to the cache and TLB
  flushing.

- TDX has own routine to notify VMM about page encryption status change.

Modify __set_memory_enc_pgtable() and make it flexible enough to cover
both AMD SEV and Intel TDX. The AMD-specific behavior is isolated in the
callbacks under x86_platform.guest. TDX will provide own version of said
callbacks.

  [ bp: Beat into submission. ]

Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220223043528.2093214-1-brijesh.singh@amd.com
</content>
</entry>
<entry>
<title>x86/pat: Remove the unused set_pages_array_wt() function</title>
<updated>2022-02-23T12:34:08Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2022-02-23T07:28:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4509d950a6764d18a99776614513d280cca422d8'/>
<id>urn:sha1:4509d950a6764d18a99776614513d280cca422d8</id>
<content type='text'>
Commit

  623dffb2a2e0 ("x86/mm/pat: Add set_memory_wt() for Write-Through type")

added it but there were no users.

  [ bp: Add a commit message. ]

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20220223072852.616143-1-hch@lst.de
</content>
</entry>
<entry>
<title>x86/sgx: Hook arch_memory_failure() into mainline code</title>
<updated>2021-11-15T19:13:16Z</updated>
<author>
<name>Tony Luck</name>
</author>
<published>2021-10-26T22:00:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03b122da74b22fbe7cd98184fa5657a9ce13970c'/>
<id>urn:sha1:03b122da74b22fbe7cd98184fa5657a9ce13970c</id>
<content type='text'>
Add a call inside memory_failure() to call the arch specific code
to check if the address is an SGX EPC page and handle it.

Note the SGX EPC pages do not have a "struct page" entry, so the hook
goes in at the same point as the device mapping hook.

Pull the call to acquire the mutex earlier so the SGX errors are also
protected.

Make set_mce_nospec() skip SGX pages when trying to adjust
the 1:1 map.

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Reviewed-by: Naoya Horiguchi &lt;naoya.horiguchi@nec.com&gt;
Tested-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Link: https://lkml.kernel.org/r/20211026220050.697075-6-tony.luck@intel.com
</content>
</entry>
<entry>
<title>mm: x86: Invoke hypercall when page encryption status is changed</title>
<updated>2021-11-11T12:37:24Z</updated>
<author>
<name>Brijesh Singh</name>
</author>
<published>2021-08-24T11:05:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=064ce6c550a0630789978bfec7a13ab2bd1bdcdf'/>
<id>urn:sha1:064ce6c550a0630789978bfec7a13ab2bd1bdcdf</id>
<content type='text'>
Invoke a hypercall when a memory region is changed from encrypted -&gt;
decrypted and vice versa. Hypervisor needs to know the page encryption
status during the guest migration.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Joerg Roedel &lt;joro@8bytes.org&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: x86@kernel.org
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Steve Rutherford &lt;srutherford@google.com&gt;
Reviewed-by: Venu Busireddy &lt;venu.busireddy@oracle.com&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Signed-off-by: Ashish Kalra &lt;ashish.kalra@amd.com&gt;
Reviewed-by: Borislav Petkov &lt;bp@suse.de&gt;
Message-Id: &lt;0a237d5bb08793916c7790a3e653a2cbe7485761.1629726117.git.ashish.kalra@amd.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>x86: Fix various typos in comments, take #2</title>
<updated>2021-03-21T22:50:28Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2021-03-21T21:28:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=163b099146b85d1b05bd2eaa045acbeee25c29e4'/>
<id>urn:sha1:163b099146b85d1b05bd2eaa045acbeee25c29e4</id>
<content type='text'>
Fix another ~42 single-word typos in arch/x86/ code comments,
missed a few in the first pass, in particular in .S files.

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Cc: linux-kernel@vger.kernel.org
</content>
</entry>
</feed>
