Discussion:
[Xen-changelog] [xen master] x86: connect guest creation with CONFIG_PV
p***@xen.org
2018-11-04 05:00:09 UTC
Permalink
commit ef72c93df9a8775faa5006516fbcc375dcb14a5d
Author: Wei Liu <***@citrix.com>
AuthorDate: Fri Oct 19 15:28:34 2018 +0100
Commit: Wei Liu <***@citrix.com>
CommitDate: Sat Oct 20 12:31:48 2018 +0100

x86: connect guest creation with CONFIG_PV

This is a bit more complicated than the HVM case because system
domains have PV guest type. Leave them like that.

Signed-off-by: Wei Liu <***@citrix.com>
Reviewed-by: Andrew Cooper <***@citrix.com>
---
xen/common/domain.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 65151e2ac4..b8d4848970 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -322,17 +322,36 @@ struct domain *domain_create(domid_t domid,
}

/* Sort out our idea of is_{pv,hvm}_domain(). */
- if ( config && (config->flags & XEN_DOMCTL_CDF_hvm_guest) )
+ if ( config )
{
+ if ( config->flags & XEN_DOMCTL_CDF_hvm_guest )
+ {
#ifdef CONFIG_HVM
- d->guest_type = guest_type_hvm;
+ d->guest_type = guest_type_hvm;
#else
- err = -EINVAL;
- goto fail;
+ err = -EINVAL;
+ goto fail;
#endif
+ }
+ else
+ {
+#ifdef CONFIG_PV
+ d->guest_type = guest_type_pv;
+#else
+ err = -EINVAL;
+ goto fail;
+#endif
+ }
}
else
+ {
+ /*
+ * At least the idle domain should be treated as PV domain
+ * because it uses PV context switch functions. To err on the
+ * safe side, leave all system domains to be guest_type_pv.
+ */
d->guest_type = guest_type_pv;
+ }

TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id);

--
generated by git-patchbot for /home/xen/git/xen.git#master

Loading...