Re: [PATCH v5 1/7] x86/kexec: Consolidate relocate_kernel() function parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2025-08-06 at 08:00 -0500, Tom Lendacky wrote:
> On 8/6/25 01:53, Huang, Kai wrote:
> > On Tue, 2025-07-29 at 00:28 +1200, Kai Huang wrote:
> > > During kexec, the kernel jumps to the new kernel in relocate_kernel(),
> > > which is implemented in assembly and both 32-bit and 64-bit have their
> > > own version.
> > > 
> > > Currently, for both 32-bit and 64-bit, the last two parameters of the
> > > relocate_kernel() are both 'unsigned int' but actually they only convey
> > > a boolean, i.e., one bit information.  The 'unsigned int' has enough
> > > space to carry two bits information therefore there's no need to pass
> > > the two booleans in two separate 'unsigned int'.
> > > 
> > > Consolidate the last two function parameters of relocate_kernel() into a
> > > single 'unsigned int' and pass flags instead.
> > > 
> > > Only consolidate the 64-bit version albeit the similar optimization can
> > > be done for the 32-bit version too.  Don't bother changing the 32-bit
> > > version while it is working (since assembly code change is required).
> > > 
> > > Signed-off-by: Kai Huang <kai.huang@xxxxxxxxx>
> > > ---
> > > 
> > >  v4 -> v5:
> > >   - RELOC_KERNEL_HOST_MEM_ACTIVE -> RELOC_KERNEL_HOST_MEM_ENC_ACTIVE
> > >     (Tom)
> > >   - Add a comment to explain only RELOC_KERNEL_PRESERVE_CONTEXT is
> > >     restored after jumping back from peer kernel for preserved_context
> > >     kexec (pointed out by Tom).
> > >   - Use testb instead of testq when comparing the flag with R11 to save
> > >     3 bytes (Hpa).
> > > 
> > > 
> > 
> > Hi Tom,
> > 
> > Wondering do you have more comments?  Thanks.
> 
> Sorry for the delay, LGTM.
> 
> Reviewed-by: Tom Lendacky <thomas.lendacky@xxxxxxx>

Thanks Tom!

(It should be me to thank you so don't be sorry. :-))




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux