diff mbox

[v3,4/5] x86/PV: allow PV guests to have an emulated PIT

Message ID 1453291044-83976-5-git-send-email-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné Jan. 20, 2016, 11:57 a.m. UTC
This fixes the fallout from the HVMlite series, that removed the emulated
PIT from PV(H) guests. Also, this patch forces the hardware domain to
always have an emulated PIT, regardless of whether the toolstack specified
one or not.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes since v2:
 - Force the emulated PIT to always be enabled for the hardware domain.
 - Change indentation of the valid set of emulation bitmaps check.
---
 xen/arch/x86/domain.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jan Beulich Jan. 20, 2016, 12:11 p.m. UTC | #1
>>> On 20.01.16 at 12:57, <roger.pau@citrix.com> wrote:
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -542,8 +542,11 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
>                     d->domain_id, config->emulation_flags);
>              return -EINVAL;
>          }
> -        if ( config->emulation_flags != 0 &&
> -             (!is_hvm_domain(d) || config->emulation_flags != XEN_X86_EMU_ALL) )
> +        if ( is_hardware_domain(d) )
> +            config->emulation_flags |= XEN_X86_EMU_PIT;
> +        if ( !is_hvm_domain(d) ? (config->emulation_flags != XEN_X86_EMU_PIT) :
> +                                 (config->emulation_flags != XEN_X86_EMU_ALL &&
> +                                  config->emulation_flags != 0))
>          {
>              printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
>                     "with the current selection of emulators: %#x\n",

While you mentioned in the cover letter that this needs to be
committed together with patch 5, having them as separate
commits would still break bisectabaility afaict. Would it really
be so unreasonable to allow PV(H) DomU-s to not have an
emulated PIT, depending on (a future) tool stack gathered
per-domain setting? Converting the check above accordingly
would - afaict - at once break that dependency on patch 5.

Jan
diff mbox

Patch

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index e70c125..78df5ae 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -542,8 +542,11 @@  int arch_domain_create(struct domain *d, unsigned int domcr_flags,
                    d->domain_id, config->emulation_flags);
             return -EINVAL;
         }
-        if ( config->emulation_flags != 0 &&
-             (!is_hvm_domain(d) || config->emulation_flags != XEN_X86_EMU_ALL) )
+        if ( is_hardware_domain(d) )
+            config->emulation_flags |= XEN_X86_EMU_PIT;
+        if ( !is_hvm_domain(d) ? (config->emulation_flags != XEN_X86_EMU_PIT) :
+                                 (config->emulation_flags != XEN_X86_EMU_ALL &&
+                                  config->emulation_flags != 0))
         {
             printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
                    "with the current selection of emulators: %#x\n",