summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYosry Ahmed <yosryahmed@google.com>2024-08-05 20:12:47 +0000
committerWei Liu <wei.liu@kernel.org>2024-08-23 22:26:20 +0000
commit0b5530861eec1cf3f240a6a4a0ceed58f67fbcc5 (patch)
tree40abb1963e34f103e3a144d6f35113d77b4f9571
parent87c9741a38c4fa63ff3525c3191fb8a4a69b4ff6 (diff)
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 <yosryahmed@google.com> Link: https://lore.kernel.org/r/20240805201247.427982-1-yosryahmed@google.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <20240805201247.427982-1-yosryahmed@google.com>
-rw-r--r--arch/x86/hyperv/ivm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c
index b4a851d27c7c..60fc3ed72830 100644
--- a/arch/x86/hyperv/ivm.c
+++ b/arch/x86/hyperv/ivm.c
@@ -321,9 +321,9 @@ int hv_snp_boot_ap(u32 cpu, unsigned long start_ip)
vmsa->efer = native_read_msr(MSR_EFER);
- asm volatile("movq %%cr4, %%rax;" : "=a" (vmsa->cr4));
- asm volatile("movq %%cr3, %%rax;" : "=a" (vmsa->cr3));
- asm volatile("movq %%cr0, %%rax;" : "=a" (vmsa->cr0));
+ vmsa->cr4 = native_read_cr4();
+ vmsa->cr3 = __native_read_cr3();
+ vmsa->cr0 = native_read_cr0();
vmsa->xcr0 = 1;
vmsa->g_pat = HV_AP_INIT_GPAT_DEFAULT;