@@ -750,25 +750,18 @@ static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
BUILD_BUG_ON(X86_EMU_ALL != XEN_X86_EMU_ALL);
#endif
- if ( is_hvm_domain(d) )
- {
- if ( is_hardware_domain(d) &&
- emflags != (X86_EMU_VPCI | X86_EMU_LAPIC | X86_EMU_IOAPIC) )
- return false;
- if ( !is_hardware_domain(d) &&
- /* HVM PIRQ feature is user-selectable. */
- (emflags & ~X86_EMU_USE_PIRQ) !=
- (X86_EMU_ALL & ~(X86_EMU_VPCI | X86_EMU_USE_PIRQ)) &&
- emflags != X86_EMU_LAPIC )
- return false;
- }
- else if ( emflags != 0 && emflags != X86_EMU_PIT )
- {
- /* PV or classic PVH. */
- return false;
- }
+ /* PV or classic PVH */
+ if ( !is_hvm_domain(d) )
+ return emflags == 0 || emflags == XEN_X86_EMU_PIT;
- return true;
+ /* HVM */
+ if ( is_hardware_domain(d) )
+ return emflags == (XEN_X86_EMU_LAPIC |
+ XEN_X86_EMU_IOAPIC |
+ XEN_X86_EMU_VPCI);
+
+ return (emflags & ~XEN_X86_EMU_OPTIONAL) == XEN_X86_EMU_BASELINE ||
+ emflags == XEN_X86_EMU_LAPIC;
}
void __init arch_init_idle_domain(struct domain *d)