Skip to contentSkip to conversation

tools/libxl: Switch Arm guest type to PVH

RFC PATCH In review Julien Grall 5 participants 12 messages Jun 25, 2018 – Jul 3, 2018

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 tools/libxl: Switch Arm guest type to PVH

Currently, the toolstack is considering Arm guest always PV. However, they are very similar to PVH because HW virtualization extension are used and QEMU is not started. So switch Arm guest type to PVH.

Furthermore, the default type for Arm in xl will now be PVH to allow smooth transition for user.

---

This was discussed at Xen Summit and also in various thread on xen-devel. The latest one was when Andrew sent a patch to deny guest creation on Arm with XEN_DOMCTL_CDF_hap unset.

I suspect we first implemented Arm guest as PV in libxl because PVH was non-existent and the type was easier to avoid spawning QEMU. Note that Linux and Xen are already considering Arm guest as PVH.

This patch is denying the creation of PV guest on Arm. This will have an impact on any toolstack selecting PV for Arm (e.g libvirt) or anyone using 'type="pv"' in libxl configuration file.

I am not entirely sure whether this is the best solution, any opinions?

---
 docs/man/xl.cfg.pod.5.in |  3 ++-
 tools/libxl/libxl_arm.c  | 10 +++++++++-
 tools/xl/xl_parse.c      |  4 ++++
 3 files changed, 15 insertions(+), 2 deletions(-)
docs/man/xl.cfg.pod.5.in +2 -1
index 47d88243b1..2c2af01515 100644
@@ -86,7 +86,8 @@ guest operating systems. This is the default.
 
 Specifies that this is to be an PVH domain. That is a lightweight HVM-like
 guest without a device model and without many of the emulated devices
-available to HVM guests. Note that this mode requires a PVH aware kernel.
+available to HVM guests. Note that this mode requires a PVH aware kernel on
+x86.
 
 =item B<type="hvm">
 
tools/libxl/libxl_arm.c +9 -1
index 8af9f6f992..3acac7fa93 100644
@@ -978,7 +978,15 @@ int libxl__arch_domain_init_hw_description(libxl__gc *gc,
     int rc;
     uint64_t val;
 
-    assert(info->type == LIBXL_DOMAIN_TYPE_PV);
+    if (info->type == LIBXL_DOMAIN_TYPE_PV) {
+        LOG(ERROR, "PV guest not supported. Please use PVH.\n");
+        return ERROR_FEATURE_REMOVED;
+    }
+    else if (info->type != LIBXL_DOMAIN_TYPE_PVH) {
+        LOG(ERROR, "Unsupported Arm guest type %s\n",
+            libxl_domain_type_to_string(info->type));
+        return ERROR_FAIL;
+    }
 
     /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ. */
     val = MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI,
tools/xl/xl_parse.c +4 -0
index e6c54483e0..b705f27277 100644
@@ -937,7 +937,11 @@ void parse_config_data(const char *config_source,
     }
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_INVALID)
+#if defined(__arm__) || defined(__aarch64__)
+        c_info->type = LIBXL_DOMAIN_TYPE_PVH;
+#else
         c_info->type = LIBXL_DOMAIN_TYPE_PV;
+#endif
 
     xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 35 lines · Julien Grall

Currently, the toolstack is considering Arm guest always PV. However, they are very similar to PVH because HW virtualization extension are used and QEMU is not started. So switch Arm guest type to PVH.

Furthermore, the default type for Arm in xl will now be PVH to allow smooth transition for user.

---

This was discussed at Xen Summit and also in various thread on xen-devel. The latest one was when Andrew sent a patch to deny guest creation on Arm with XEN_DOMCTL_CDF_hap unset.

I suspect we first implemented Arm guest as PV in libxl because PVH was non-existent and the type was easier to avoid spawning QEMU. Note that Linux and Xen are already considering Arm guest as PVH.

This patch is denying the creation of PV guest on Arm. This will have an impact on any toolstack selecting PV for Arm (e.g libvirt) or anyone using 'type="pv"' in libxl configuration file.

I am not entirely sure whether this is the best solution, any opinions?

---
 docs/man/xl.cfg.pod.5.in |  3 ++-
 tools/libxl/libxl_arm.c  | 10 +++++++++-
 tools/xl/xl_parse.c      |  4 ++++
 3 files changed, 15 insertions(+), 2 deletions(-)
docs/man/xl.cfg.pod.5.in +0 -0
index 47d88243b1..2c2af01515 100644

docs/man/xl.cfg.pod.5.in guest operating systems. This is the default. · line 90

Quoted 6 lines
docs/man/xl.cfg.pod.5.in +2 -1
@@ -86,7 +86,8 @@ guest operating systems. This is the default.
 
 Specifies that this is to be an PVH domain. That is a lightweight HVM-like
 guest without a device model and without many of the emulated devices
-available to HVM guests. Note that this mode requires a PVH aware kernel.
+available to HVM guests. Note that this mode requires a PVH aware kernel on
+x86.

Have we ever advertised on ARM which guest type users should set? Are they aware of the fact that it is PV in toolstack and HVM in Xen?

If users are oblivious to the underlying implementation, I think we can skip telling them PVH in ARM world.

Wei.

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

#2 lore raw

Hi Wei,

Quoted 37 lines · Wei Liu
Quoted 36 lines · Julien Grall

Currently, the toolstack is considering Arm guest always PV. However, they are very similar to PVH because HW virtualization extension are used and QEMU is not started. So switch Arm guest type to PVH.

Furthermore, the default type for Arm in xl will now be PVH to allow smooth transition for user.

---

This was discussed at Xen Summit and also in various thread on xen-devel. The latest one was when Andrew sent a patch to deny guest creation on Arm with XEN_DOMCTL_CDF_hap unset.

I suspect we first implemented Arm guest as PV in libxl because PVH was non-existent and the type was easier to avoid spawning QEMU. Note that Linux and Xen are already considering Arm guest as PVH.

This patch is denying the creation of PV guest on Arm. This will have an impact on any toolstack selecting PV for Arm (e.g libvirt) or anyone using 'type="pv"' in libxl configuration file.

I am not entirely sure whether this is the best solution, any opinions?

---
  docs/man/xl.cfg.pod.5.in |  3 ++-
  tools/libxl/libxl_arm.c  | 10 +++++++++-
  tools/xl/xl_parse.c      |  4 ++++
  3 files changed, 15 insertions(+), 2 deletions(-)
docs/man/xl.cfg.pod.5.in +0 -0
index 47d88243b1..2c2af01515 100644
@@ -86,7 +86,8 @@ guest operating systems. This is the default.
 
Quoted 8 lines

docs/man/xl.cfg.pod.5.in guest operating systems. This is the default. · line 90

Quoted 5 lines
docs/man/xl.cfg.pod.5.in +2 -1
  Specifies that this is to be an PVH domain. That is a lightweight HVM-like
  guest without a device model and without many of the emulated devices
-available to HVM guests. Note that this mode requires a PVH aware kernel.
+available to HVM guests. Note that this mode requires a PVH aware kernel on
+x86.

Have we ever advertised on ARM which guest type users should set? Are they aware of the fact that it is PV in toolstack and HVM in Xen?

We always advertised "ARM guest" and not a specific type of guest. So most of the users of xl will likely not specified the type of guest.

Quoted 3 lines

If users are oblivious to the underlying implementation, I think we can skip telling them PVH in ARM world.

PVH is quite confusing for Arm. We only used the term to make a comparison with x86. This is the closest to Arm guest but I am not too sure whether they would be the exactly the same.

At the moment, I would rather avoid to say 'PVH' for the end user and just let the different toolstack to set the type to PVH.

Another solution is for libxl to force the guest type to PVH on Arm. I am not sure what would be the impact here.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw
Quoted 58 lines · Julien Grall

Hi Wei,

Quoted 31 lines · Wei Liu
Quoted 30 lines · Julien Grall

Currently, the toolstack is considering Arm guest always PV. However, they are very similar to PVH because HW virtualization extension are used and QEMU is not started. So switch Arm guest type to PVH.

Furthermore, the default type for Arm in xl will now be PVH to allow smooth transition for user.

---

This was discussed at Xen Summit and also in various thread on xen-devel. The latest one was when Andrew sent a patch to deny guest creation on Arm with XEN_DOMCTL_CDF_hap unset.

I suspect we first implemented Arm guest as PV in libxl because PVH was non-existent and the type was easier to avoid spawning QEMU. Note that Linux and Xen are already considering Arm guest as PVH.

This patch is denying the creation of PV guest on Arm. This will have an impact on any toolstack selecting PV for Arm (e.g libvirt) or anyone using 'type="pv"' in libxl configuration file.

I am not entirely sure whether this is the best solution, any opinions?

---
  docs/man/xl.cfg.pod.5.in |  3 ++-
  tools/libxl/libxl_arm.c  | 10 +++++++++-
  tools/xl/xl_parse.c      |  4 ++++
  3 files changed, 15 insertions(+), 2 deletions(-)
Quoted 13 lines

docs/man/xl.cfg.pod.5.in guest operating systems. This is the default. · line 89

Quoted 10 lines
docs/man/xl.cfg.pod.5.in +2 -1
index 47d88243b1..2c2af01515 100644
@@ -86,7 +86,8 @@ guest operating systems. This is the default.
  Specifies that this is to be an PVH domain. That is a lightweight HVM-like
  guest without a device model and without many of the emulated devices
-available to HVM guests. Note that this mode requires a PVH aware kernel.
+available to HVM guests. Note that this mode requires a PVH aware kernel on
+x86.

Have we ever advertised on ARM which guest type users should set? Are they aware of the fact that it is PV in toolstack and HVM in Xen?

We always advertised "ARM guest" and not a specific type of guest. So most of the users of xl will likely not specified the type of guest.

Quoted 3 lines

If users are oblivious to the underlying implementation, I think we can skip telling them PVH in ARM world.

PVH is quite confusing for Arm. We only used the term to make a comparison with x86. This is the closest to Arm guest but I am not too sure whether they would be the exactly the same.

Quoted 5 lines

At the moment, I would rather avoid to say 'PVH' for the end user and just let the different toolstack to set the type to PVH.

Another solution is for libxl to force the guest type to PVH on Arm. I am not sure what would be the impact here.

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

Iff ARM even gains more guest types the option can be added and the guest types can be set to meaningful ARM guest types.

In any case, this requires changes to xl.cfg man page.

Roger.

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

#4 lore raw

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

Ian.

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

#5 lore raw
Quoted 8 lines · Ian Jackson

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

For livbirt (or users of libxl library) we could force the type to pvh, regardless of the value set by the client, but I guess that would make adding types later on quite complicated.

Roger.

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

#6 lore raw
Quoted 6 lines · Roger Pau Monné
Quoted 5 lines · Ian Jackson

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

Quoted 7 lines
Quoted 3 lines

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

For livbirt (or users of libxl library) we could force the type to pvh, regardless of the value set by the client, but I guess that would make adding types later on quite complicated.

I am fairly confident we will never have PV guest on Arm. So one solution would be to alias PV to PVH for Arm. This still give us the liberty to add more guest type in the future.

Any opinions?

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw
Quoted 17 lines · Julien Grall
Quoted 6 lines · Roger Pau Monné
Quoted 5 lines · Ian Jackson

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

Quoted 7 lines
Quoted 3 lines

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

For livbirt (or users of libxl library) we could force the type to pvh, regardless of the value set by the client, but I guess that would make adding types later on quite complicated.

Quoted 5 lines

I am fairly confident we will never have PV guest on Arm. So one solution would be to alias PV to PVH for Arm. This still give us the liberty to add more guest type in the future.

Any opinions?

Yes, we could make PV synonym to PVH (but don't talk about it, since Xen Arm never emphasises it guest type). Whatever new guest type we're going to add can't be called PV or PVH. I don't think that would be a big problem -- if you want a different guest type, you definitely want a different name.

Wei.

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

#8 lore raw
In reply to Julien Grall
Quoted 16 lines · Julien Grall
Quoted 7 lines · Roger Pau Monné
Quoted 6 lines · Ian Jackson

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

Quoted 7 lines
Quoted 3 lines

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

For livbirt (or users of libxl library) we could force the type to pvh, regardless of the value set by the client, but I guess that would make adding types later on quite complicated.

Quoted 5 lines

I am fairly confident we will never have PV guest on Arm. So one solution would be to alias PV to PVH for Arm. This still give us the liberty to add more guest type in the future.

Any opinions?

Roger, what is the plan for x86? Wasn't there an idea to silently and transparently "upgrade" PV guests to PVH when possible (when hardware support is available)?

If that is the case, basically we could do the same for ARM. We could have an hardware features check, that would always return true on ARM because without virtualization extensions Xen cannot even boot, then upgrade PV to PVH. On x86 the upgrade would only happen when the required features are present.

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

#9 lore raw
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Julien Grall
Quoted 7 lines · Roger Pau Monné
Quoted 6 lines · Ian Jackson

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

Quoted 7 lines
Quoted 3 lines

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

For livbirt (or users of libxl library) we could force the type to pvh, regardless of the value set by the client, but I guess that would make adding types later on quite complicated.

I am fairly confident we will never have PV guest on Arm. So one solution would be to alias PV to PVH for Arm. This still give us the liberty to add more guest type in the future.

Quoted 5 lines
Quoted 1 line

Any opinions?

Roger, what is the plan for x86? Wasn't there an idea to silently and transparently "upgrade" PV guests to PVH when possible (when hardware support is available)?

This could only be done for xl config files that don't specify a 'type' option IMO, for libvirt and other users of libxl I don't think this is feasible.

Quoted 5 lines

If that is the case, basically we could do the same for ARM. We could have an hardware features check, that would always return true on ARM because without virtualization extensions Xen cannot even boot, then upgrade PV to PVH. On x86 the upgrade would only happen when the required features are present.

It's slightly more convoluted on x86 because apart from the hardware features you also need to parse the kernel in order to figure out if it has the PVH entry point before setting the type to PVH.

Roger.

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

#10 lore raw
Quoted 38 lines · Roger Pau Monné
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Julien Grall
Quoted 7 lines · Roger Pau Monné
Quoted 6 lines · Ian Jackson

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

Quoted 7 lines
Quoted 3 lines

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

For livbirt (or users of libxl library) we could force the type to pvh, regardless of the value set by the client, but I guess that would make adding types later on quite complicated.

I am fairly confident we will never have PV guest on Arm. So one solution would be to alias PV to PVH for Arm. This still give us the liberty to add more guest type in the future.

Quoted 5 lines
Quoted 1 line

Any opinions?

Roger, what is the plan for x86? Wasn't there an idea to silently and transparently "upgrade" PV guests to PVH when possible (when hardware support is available)?

This could only be done for xl config files that don't specify a 'type' option IMO, for libvirt and other users of libxl I don't think this is feasible.

Quoted 5 lines

If that is the case, basically we could do the same for ARM. We could have an hardware features check, that would always return true on ARM because without virtualization extensions Xen cannot even boot, then upgrade PV to PVH. On x86 the upgrade would only happen when the required features are present.

Quoted 3 lines

It's slightly more convoluted on x86 because apart from the hardware features you also need to parse the kernel in order to figure out if it has the PVH entry point before setting the type to PVH.

I see. Too bad. In that case, if we have to go with an ARM specific solution and nobody has a better suggestion, then I think it is OK to go ahead with aliasing PV to PVH on ARM as Julien mentioned.

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

#11 lore raw
In reply to Ian Jackson
Quoted 8 lines · Ian Jackson

Roger Pau Monné writes ("Re: [PATCH RFC] tools/libxl: Switch Arm guest type to PVH"):

Quoted 3 lines

IMO I would remove the 'type' option from xl.cfg (so that it's basically ignored) in the ARM case and force it internally to PVH (if that's the best route for current ARM guests).

What about libvirt users ? I haven't seen what a libvirt Xen ARM guest config looks like but we need to meak sure that existing guests don't break.

It may set type to pv. The following file is generated by the config converter.

logs.test-lab.xenproject.org/osstest/logs/124566/test-armhf-armhf-libvirt-xsm/arndale-metrocentre---var-log-libvirt-libxl-debian.guest.osstest.log

Wei.

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