Skip to content

Commit 0b55308

Browse files
yosrym93liuw
authored andcommitted
x86/hyperv: use helpers to read control registers in hv_snp_boot_ap()
Use native_read_cr*() helpers to read control registers into vmsa->cr* instead of open-coded assembly. No functional change intended, unless there was a purpose to specifying rax. Signed-off-by: Yosry Ahmed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]> Message-ID: <[email protected]>
1 parent 87c9741 commit 0b55308

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/hyperv/ivm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ int hv_snp_boot_ap(u32 cpu, unsigned long start_ip)
321321

322322
vmsa->efer = native_read_msr(MSR_EFER);
323323

324-
asm volatile("movq %%cr4, %%rax;" : "=a" (vmsa->cr4));
325-
asm volatile("movq %%cr3, %%rax;" : "=a" (vmsa->cr3));
326-
asm volatile("movq %%cr0, %%rax;" : "=a" (vmsa->cr0));
324+
vmsa->cr4 = native_read_cr4();
325+
vmsa->cr3 = __native_read_cr3();
326+
vmsa->cr0 = native_read_cr0();
327327

328328
vmsa->xcr0 = 1;
329329
vmsa->g_pat = HV_AP_INIT_GPAT_DEFAULT;

0 commit comments

Comments
 (0)