<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/reboot.c, 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/mm: Add callbacks to prepare encrypted memory for kexec</title>
<updated>2024-10-04T14:33:44Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2024-06-14T09:58:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b026890012d0811a613134da1dbda6f99b65fdf'/>
<id>urn:sha1:5b026890012d0811a613134da1dbda6f99b65fdf</id>
<content type='text'>
[ Upstream commit 22daa42294b419a0d8060a3870285e7a72aa63e4 ]

AMD SEV and Intel TDX guests allocate shared buffers for performing I/O.
This is done by allocating pages normally from the buddy allocator and
then converting them to shared using set_memory_decrypted().

On kexec, the second kernel is unaware of which memory has been
converted in this manner. It only sees E820_TYPE_RAM. Accessing shared
memory as private is fatal.

Therefore, the memory state must be reset to its original state before
starting the new kernel with kexec.

The process of converting shared memory back to private occurs in two
steps:

- enc_kexec_begin() stops new conversions.

- enc_kexec_finish() unshares all existing shared memory, reverting it
  back to private.

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: Nikolay Borisov &lt;nik.borisov@suse.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-11-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, crash: wrap crash dumping code into crash related ifdefs</title>
<updated>2024-02-24T01:48:23Z</updated>
<author>
<name>Baoquan He</name>
</author>
<published>2024-01-24T05:12:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a4eeb2176d89fdf2785851521577b94b31690a60'/>
<id>urn:sha1:a4eeb2176d89fdf2785851521577b94b31690a60</id>
<content type='text'>
Now crash codes under kernel/ folder has been split out from kexec
code, crash dumping can be separated from kexec reboot in config
items on x86 with some adjustments.

Here, also change some ifdefs or IS_ENABLED() check to more appropriate
ones, e,g
 - #ifdef CONFIG_KEXEC_CORE -&gt; #ifdef CONFIG_CRASH_DUMP
 - (!IS_ENABLED(CONFIG_KEXEC_CORE)) - &gt; (!IS_ENABLED(CONFIG_CRASH_RESERVE))

[bhe@redhat.com: don't nest CONFIG_CRASH_DUMP ifdef inside CONFIG_KEXEC_CODE ifdef scope]
  Link: https://lore.kernel.org/all/SN6PR02MB4157931105FA68D72E3D3DB8D47B2@SN6PR02MB4157.namprd02.prod.outlook.com/T/#u
Link: https://lkml.kernel.org/r/20240124051254.67105-7-bhe@redhat.com
Signed-off-by: Baoquan He &lt;bhe@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Hari Bathini &lt;hbathini@linux.ibm.com&gt;
Cc: Pingfan Liu &lt;piliu@redhat.com&gt;
Cc: Klara Modin &lt;klarasmodin@gmail.com&gt;
Cc: Michael Kelley &lt;mhklinux@outlook.com&gt;
Cc: Nathan Chancellor &lt;nathan@kernel.org&gt;
Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86/reboot: Expose VMCS crash hooks if and only if KVM_{INTEL,AMD} is enabled</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=261cd5ed934e6923187cf1c9eaa6cb63f2b81212'/>
<id>urn:sha1:261cd5ed934e6923187cf1c9eaa6cb63f2b81212</id>
<content type='text'>
Expose the crash/reboot hooks used by KVM to disable virtualization in
hardware and unblock INIT only if there's a potential in-tree user,
i.e. either KVM_INTEL or KVM_AMD is enabled.

Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-9-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>x86/reboot: Disable virtualization during reboot iff callback is registered</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59765db5fc82726b32876b794667e2c6936a98ab'/>
<id>urn:sha1:59765db5fc82726b32876b794667e2c6936a98ab</id>
<content type='text'>
Attempt to disable virtualization during an emergency reboot if and only
if there is a registered virt callback, i.e. iff a hypervisor (KVM) is
active.  If there's no active hypervisor, then the CPU can't be operating
with VMX or SVM enabled (barring an egregious bug).

Checking for a valid callback instead of simply for SVM or VMX support
can also eliminates spurious NMIs by avoiding the unecessary call to
nmi_shootdown_cpus_on_restart().

Note, IRQs are disabled, which prevents KVM from coming along and
enabling virtualization after the fact.

Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-8-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>x86/reboot: Hoist "disable virt" helpers above "emergency reboot" path</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=edc8deb087d884bac2f7013f0c23af73042b23a7'/>
<id>urn:sha1:edc8deb087d884bac2f7013f0c23af73042b23a7</id>
<content type='text'>
Move the various "disable virtualization" helpers above the emergency
reboot path so that emergency_reboot_disable_virtualization() can be
stubbed out in a future patch if neither KVM_INTEL nor KVM_AMD is enabled,
i.e. if there is no in-tree user of CPU virtualization.

No functional change intended.

Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-7-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>x86/reboot: Assert that IRQs are disabled when turning off virtualization</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ad93c1a7c0102c93e92bf0c06412a1f588e015ab'/>
<id>urn:sha1:ad93c1a7c0102c93e92bf0c06412a1f588e015ab</id>
<content type='text'>
Assert that IRQs are disabled when turning off virtualization in an
emergency.  KVM enables hardware via on_each_cpu(), i.e. could re-enable
hardware if a pending IPI were delivered after disabling virtualization.

Remove a misleading comment from emergency_reboot_disable_virtualization()
about "just" needing to guarantee the CPU is stable (see above).

Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-6-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>x86/reboot: KVM: Disable SVM during reboot via virt/KVM reboot callback</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=baeb4de7ad12b700a91f2a7be8e1c0389a5c8fd4'/>
<id>urn:sha1:baeb4de7ad12b700a91f2a7be8e1c0389a5c8fd4</id>
<content type='text'>
Use the virt callback to disable SVM (and set GIF=1) during an emergency
instead of blindly attempting to disable SVM.  Like the VMX case, if a
hypervisor, i.e. KVM, isn't loaded/active, SVM can't be in use.

Acked-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-5-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>x86/reboot: KVM: Handle VMXOFF in KVM's reboot callback</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=119b5cb4ffd0166f3e98e9ee042f5046f7744f28'/>
<id>urn:sha1:119b5cb4ffd0166f3e98e9ee042f5046f7744f28</id>
<content type='text'>
Use KVM VMX's reboot/crash callback to do VMXOFF in an emergency instead
of manually and blindly doing VMXOFF.  There's no need to attempt VMXOFF
if a hypervisor, i.e. KVM, isn't loaded/active, i.e. if the CPU can't
possibly be post-VMXON.

Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-4-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>x86/reboot: Harden virtualization hooks for emergency reboot</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e408396c60cd0f0b53a43713016b6d6af8d69e0'/>
<id>urn:sha1:5e408396c60cd0f0b53a43713016b6d6af8d69e0</id>
<content type='text'>
Provide dedicated helpers to (un)register virt hooks used during an
emergency crash/reboot, and WARN if there is an attempt to overwrite
the registered callback, or an attempt to do an unpaired unregister.

Opportunsitically use rcu_assign_pointer() instead of RCU_INIT_POINTER(),
mainly so that the set/unset paths are more symmetrical, but also because
any performance gains from using RCU_INIT_POINTER() are meaningless for
this code.

Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-3-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>x86/reboot: VMCLEAR active VMCSes before emergency reboot</title>
<updated>2023-08-03T22:37:14Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2023-07-21T20:18:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b23c83ad2c638420ec0608a9de354507c41bec29'/>
<id>urn:sha1:b23c83ad2c638420ec0608a9de354507c41bec29</id>
<content type='text'>
VMCLEAR active VMCSes before any emergency reboot, not just if the kernel
may kexec into a new kernel after a crash.  Per Intel's SDM, the VMX
architecture doesn't require the CPU to flush the VMCS cache on INIT.  If
an emergency reboot doesn't RESET CPUs, cached VMCSes could theoretically
be kept and only be written back to memory after the new kernel is booted,
i.e. could effectively corrupt memory after reboot.

Opportunistically remove the setting of the global pointer to NULL to make
checkpatch happy.

Cc: Andrew Cooper &lt;Andrew.Cooper3@citrix.com&gt;
Link: https://lore.kernel.org/r/20230721201859.2307736-2-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
</feed>
