Re: [Xen-devel] [PATCH v2 10/30] xen/x86: allow the emulated APICs to be enbled for the hardware domain

2016-09-30 Thread Roger Pau Monne
On Thu, Sep 29, 2016 at 08:26:04AM -0600, Jan Beulich wrote:
> >>> On 27.09.16 at 17:57,  wrote:
> > +static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
> > +{
> > +
> > +if ( is_hvm_domain(d) )
> > +{
> > +if ( is_hardware_domain(d) &&
> > + emflags != 
> > (XEN_X86_EMU_PIT|XEN_X86_EMU_LAPIC|XEN_X86_EMU_IOAPIC))
> > +return false;
> > +if ( !is_hardware_domain(d) &&
> > + emflags != XEN_X86_EMU_ALL && emflags != 0 )
> > +return false;
> > +}
> > +else
> > +{
> > +/* PV or classic PVH. */
> > +if ( is_hardware_domain(d) && emflags != XEN_X86_EMU_PIT )
> > +return false;
> > +if ( !is_hardware_domain(d) && emflags != 0 )
> > +return false;
> 
> Previous code permitted XEN_X86_EMU_PIT also for the non-hardware
> domains afaict. You shouldn't change behavior without saying so and
> explaining why.

Done. I'm not really sure if the emulated PIT makes much sense for a PV 
domain, also because I don't think libxl ever enabled the PIT for a PV 
domain, but alas this should be discussed in a separate patch and not 
batched in this commit.

Roger.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2 10/30] xen/x86: allow the emulated APICs to be enbled for the hardware domain

2016-09-29 Thread Jan Beulich
>>> On 27.09.16 at 17:57,  wrote:
> +static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
> +{
> +
> +if ( is_hvm_domain(d) )
> +{
> +if ( is_hardware_domain(d) &&
> + emflags != 
> (XEN_X86_EMU_PIT|XEN_X86_EMU_LAPIC|XEN_X86_EMU_IOAPIC))
> +return false;
> +if ( !is_hardware_domain(d) &&
> + emflags != XEN_X86_EMU_ALL && emflags != 0 )
> +return false;
> +}
> +else
> +{
> +/* PV or classic PVH. */
> +if ( is_hardware_domain(d) && emflags != XEN_X86_EMU_PIT )
> +return false;
> +if ( !is_hardware_domain(d) && emflags != 0 )
> +return false;

Previous code permitted XEN_X86_EMU_PIT also for the non-hardware
domains afaict. You shouldn't change behavior without saying so and
explaining why.

Jan


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel