Skip to contentSkip to conversation

x86: put x86emul_{read, write}_dr under CONFIG_PV

PATCH In review Wei Liu 2 participants 2 messages Nov 5, 2018

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 x86: put x86emul_{read, write}_dr under CONFIG_PV

A build breakage is discovered by a non-debug build. Debug build worked because the ASSERT made the compiler eliminate the rest of the functions.

Currently they are PV only. There are comments alluding to possible future HVM support but we can cross the bride when we get there.

---
 xen/arch/x86/x86_emulate.c | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/x86/x86_emulate.c +2 -0
index 886bd87e59..b1dfc9f261 100644
@@ -89,6 +89,7 @@ int x86emul_write_xcr(unsigned int reg, uint64_t val,
     return X86EMUL_OKAY;
 }
 
+#ifdef CONFIG_PV
 /* Called with NULL ctxt in hypercall context. */
 int x86emul_read_dr(unsigned int reg, unsigned long *val,
                     struct x86_emulate_ctxt *ctxt)
@@ -155,6 +156,7 @@ int x86emul_write_dr(unsigned int reg, unsigned long val,
         return X86EMUL_EXCEPTION;
     }
 }
+#endif /* CONFIG_PV */
 
 /*
  * Local variables:
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wei Liu

A build breakage is discovered by a non-debug build. Debug build worked because the ASSERT made the compiler eliminate the rest of the functions.

Currently they are PV only. There are comments alluding to possible future HVM support but we can cross the bride when we get there.

Hmm - this is disappointing, but probably the least bad course of action.

Longterm I want to merge the PV and HVM CR's into arch_vcpu which avoids one of the two build breakages, but the dr7 path will always have a PV conditional part.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel