Re: [PATCH -hyperv 1/3] x86/hyperv: Save segment registers directly to memory in hv_hvcrash_ctxt_save()

From: Wei Liu

Date: Thu Mar 12 2026 - 00:28:22 EST


On Wed, Mar 11, 2026 at 11:25:58AM +0100, Uros Bizjak wrote:
> hv_hvcrash_ctxt_save() in arch/x86/hyperv/hv_crash.c currently saves
> segment registers via a general-purpose register (%eax). Update the
> code to save segment registers (cs, ss, ds, es, fs, gs) directly to
> the crash context memory using movw. This avoids unnecessary use of
> a general-purpose register, making the code simpler and more efficient.
>
> The size of the corresponding object file improves as follows:
>
> text data bss dec hex filename
> 4167 176 200 4543 11bf hv_crash-old.o
> 4151 176 200 4527 11af hv_crash-new.o
>
> No functional change occurs to the saved context contents; this is
> purely a code-quality improvement.
>
> Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
> Cc: "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>
> Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> Cc: Wei Liu <wei.liu@xxxxxxxxxx>
> Cc: Dexuan Cui <decui@xxxxxxxxxxxxx>
> Cc: Long Li <longli@xxxxxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>

Series applied to hyperv-fixes. Thanks.