Skip to contentSkip to conversation

Remove PVHv1 residuals

PATCH In review Wei Liu 5 participants 20 messages Mar 17, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover Remove PVHv1 residuals

Built on top my series to split dom0 builder.

Wei Liu (4):
docs: update dmop.markdown
sched.h: remove stale PVHv1 comment x86/traps: undo the PVHv1 bodge in NMI delivery path
x86: remove stale PVHv1 comment from PV domain builder

 docs/designs/dmop.markdown   | 2 +-
 xen/arch/x86/pv/dom0_build.c | 4 ----
 xen/arch/x86/traps.c         | 2 +-
 xen/include/xen/sched.h      | 4 ----
 4 files changed, 2 insertions(+), 10 deletions(-)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#1 lore raw

PATCH 1/4 docs: update dmop.markdown

... to match the code after the removal of PVHv1.

---
 docs/designs/dmop.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/designs/dmop.markdown +1 -1
index a6cf6eb67b..8e9f95af47 100644
@@ -128,7 +128,7 @@ static int dm_op(domid_t domid,
     if ( rc )
         return rc;
 
-    if ( !has_hvm_container_domain(d) )
+    if ( !is_hvm_domain(d) )
         goto out;
 
     rc = xsm_dm_op(XSM_DM_PRIV, d);
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#17 lore raw

PATCH 4/4 x86: remove stale PVHv1 comment from PV domain builder

In reply to Wei Liu
---
 xen/arch/x86/pv/dom0_build.c | 4 ----
 1 file changed, 4 deletions(-)
xen/arch/x86/pv/dom0_build.c +0 -4
index bb82c33a4c..6872b30209 100644
@@ -872,10 +872,6 @@ int __init dom0_construct_pv(
         paging_update_paging_modes(v);
 #endif
 
-    /*
-     * PVH Fixme: XENFEAT_supervisor_mode_kernel has been reused in PVH with a
-     * different meaning.
-     */
     if ( test_bit(XENFEAT_supervisor_mode_kernel, parms.f_required) )
         panic("Dom0 requires supervisor-mode execution");
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#6 lore raw

PATCH 3/4 x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Wei Liu

A bodge was added in 21c9fce8efb to skip delivering NMI to PVHv1 guest. Now that PVHv1 is gone, undo that bodge and remove the fixme.

---
 xen/arch/x86/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/traps.c +1 -1
index 0d54baf20e..c785b3f353 100644
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] )
         return;
 
     set_bit(reason_idx, nmi_reason(d));
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#5 lore raw

PATCH 2/4 sched.h: remove stale PVHv1 comment

In reply to Wei Liu

With the removal of PVHv1 this comment is wrong. Just remove it.

---
 xen/include/xen/sched.h | 4 ----
 1 file changed, 4 deletions(-)
xen/include/xen/sched.h +0 -4
index 832352a5ce..325733a4b8 100644
@@ -307,10 +307,6 @@ struct vm_event_per_domain
 
 struct evtchn_port_ops;
 
-/*
- * PVH is a PV guest running in an HVM container.  is_hvm_* checks
- * will be false, but has_hvm_container_* checks will be true.
- */
 enum guest_type {
     guest_type_pv, guest_type_hvm
 };
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on the v1 series
#18 lore raw
In reply to Wei Liu
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 17.03.17 at 12:02, <[email protected]> wrote:

Built on top my series to split dom0 builder.

Wei Liu (4):
docs: update dmop.markdown
sched.h: remove stale PVHv1 comment x86/traps: undo the PVHv1 bodge in NMI delivery path
x86: remove stale PVHv1 comment from PV domain builder

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

#7 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Wei Liu
Quoted 4 lines · Wei Liu

A bodge was added in 21c9fce8efb to skip delivering NMI to PVHv1 guest. Now that PVHv1 is gone, undo that bodge and remove the fixme.

This unfortunately needs to stay, although perhaps it wants rewording.

send_guest_trap() just out of context below is PV-specific, making this path unsuitable for any HVM guests.

~Andrew

Quoted 9 lines
---
 xen/arch/x86/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/traps.c +0 -0
index 0d54baf20e..c785b3f353 100644

xen/arch/x86/traps.c static void nmi_hwdom_report(unsigned int reason_idx) · line 3543

Quoted 8 lines
xen/arch/x86/traps.c +1 -1
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] )
         return;
 
     set_bit(reason_idx, nmi_reason(d));

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

Reviewed-by
#19 lore raw
In reply to Jan Beulich
Quoted 11 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 17.03.17 at 12:02, <[email protected]> wrote:

Built on top my series to split dom0 builder.

Wei Liu (4):
docs: update dmop.markdown
sched.h: remove stale PVHv1 comment x86/traps: undo the PVHv1 bodge in NMI delivery path
x86: remove stale PVHv1 comment from PV domain builder

1, 2 and 4

Patch 3 needs further work.

~Andrew

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

author
#8 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Andrew Cooper
Quoted 11 lines · Andrew Cooper
Quoted 4 lines · Wei Liu

A bodge was added in 21c9fce8efb to skip delivering NMI to PVHv1 guest. Now that PVHv1 is gone, undo that bodge and remove the fixme.

This unfortunately needs to stay, although perhaps it wants rewording.

send_guest_trap() just out of context below is PV-specific, making this path unsuitable for any HVM guests.

Just removing the comment should be fine then.

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

#9 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

Quoted 5 lines · Wei Liu
Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Wei Liu

A bodge was added in 21c9fce8efb to skip delivering NMI to PVHv1 guest. Now that PVHv1 is gone, undo that bodge and remove the fixme.

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

This unfortunately needs to stay, although perhaps it wants rewording.

send_guest_trap() just out of context below is PV-specific, making this path unsuitable for any HVM guests.

Just removing the comment should be fine then.

Ok then.

~Andrew

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

author
#10 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Wei Liu
Quoted 5 lines · Andrew Cooper
Quoted 4 lines · Wei Liu

A bodge was added in 21c9fce8efb to skip delivering NMI to PVHv1 guest. Now that PVHv1 is gone, undo that bodge and remove the fixme.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

This unfortunately needs to stay, although perhaps it wants rewording.

send_guest_trap() just out of context below is PV-specific, making this path unsuitable for any HVM guests.

Just removing the comment should be fine then.

Ok then.

From 3f4e56ed1990926ce642317093dd7e24a47f2647 Mon Sep 17 00:00:00 2001
From: Wei Liu <[email protected]>
Date: Thu, 16 Mar 2017 19:11:56 +0000
Subject: [PATCH] x86/traps: remove PVH fixme in NMI delivery path

A bodge was added in 21c9fce8efb to skip delivering NMI to PVHv1 guest. Although PVHv1 is gone, the check for PV domain is still needed as this function is PV specific.

Just remove the PVH fixme comment.

---
 xen/arch/x86/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/traps.c +1 -1
index 0d54baf20e..c51e9cc2cc 100644
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) )
         return;
 
     set_bit(reason_idx, nmi_reason(d));
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#16 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Wei Liu
Quoted 7 lines · Wei Liu
Quoted 6 lines · Andrew Cooper
Quoted 4 lines · Wei Liu

A bodge was added in 21c9fce8efb to skip delivering NMI to PVHv1 guest. Now that PVHv1 is gone, undo that bodge and remove the fixme.

Quoted 7 lines
Quoted 5 lines

This unfortunately needs to stay, although perhaps it wants rewording.

send_guest_trap() just out of context below is PV-specific, making this path unsuitable for any HVM guests.

Just removing the comment should be fine then.

This has reminded me that I should send a patch to prevent using nmi=dom0 with dom0=pvh.

Roger.

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

#11 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Wei Liu

xen/arch/x86/traps.c static void nmi_hwdom_report(unsigned int reason_idx) · line 3541

Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 17.03.17 at 12:14, <[email protected]> wrote:
xen/arch/x86/traps.c +1 -1
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) )
         return;

But why would you remove the comment then? This needs fixing, after all.

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

author
#12 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 17.03.17 at 12:14, <[email protected]> wrote:
xen/arch/x86/traps.c +0 -0
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
Quoted 7 lines

xen/arch/x86/traps.c static void nmi_hwdom_report(unsigned int reason_idx) · line 3541

Quoted 3 lines
xen/arch/x86/traps.c +1 -1
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) )
         return;

But why would you remove the comment then? This needs fixing, after all.

Isn't PVHv2 going to use the native path? Now that there is no PVHv1, what is there to fix?

Wei.

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

Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] docs: update dmop.markdown

In reply to Wei Liu
Quoted 10 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Wei Liu
Sent: 17 March 2017 11:02
To: Xen-devel <[email protected]>
Cc: Andrew Cooper <[email protected]>; Wei Liu <[email protected]>; Jan Beulich <[email protected]>; Roger Pau Monne <[email protected]>
Subject: [Xen-devel] [PATCH 1/4] docs: update dmop.markdown

Quoted 3 lines

... to match the code after the removal of PVHv1.

Quoted 21 lines
---
 docs/designs/dmop.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/designs/dmop.markdown +1 -2
index a6cf6eb67b..8e9f95af47 100644
@@ -128,7 +128,7 @@ static int dm_op(domid_t domid,
     if ( rc )
         return rc;
 
-    if ( !has_hvm_container_domain(d) )
+    if ( !is_hvm_domain(d) )
         goto out;
 
     rc = xsm_dm_op(XSM_DM_PRIV, d);
--

2.11.0

Quoted 4 lines

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

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

#13 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Wei Liu
Quoted 8 lines · Wei Liu
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 17.03.17 at 12:14, <[email protected]> wrote:
xen/arch/x86/traps.c +0 -0
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
Quoted 8 lines
Quoted 6 lines

xen/arch/x86/traps.c static void nmi_hwdom_report(unsigned int reason_idx) · line 3541

Quoted 3 lines
xen/arch/x86/traps.c +1 -1
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) )
         return;

But why would you remove the comment then? This needs fixing, after all.

Isn't PVHv2 going to use the native path? Now that there is no PVHv1, what is there to fix?

The native "inject an NMI" path still needs wiring into this codepath. The reason it wasn't done for PVHv1 was because we don't have a suitable native path yet, iirc.

~Andrew

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

#3 lore raw

Re: [PATCH 1/4] docs: update dmop.markdown

In reply to Paul Durrant
Quoted 10 lines · Paul Durrant
Quoted 10 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Wei Liu
Sent: 17 March 2017 11:02
To: Xen-devel <[email protected]>
Cc: Andrew Cooper <[email protected]>; Wei Liu <[email protected]>; Jan Beulich <[email protected]>; Roger Pau Monne <[email protected]>
Subject: [Xen-devel] [PATCH 1/4] docs: update dmop.markdown

Quoted 4 lines
Quoted 3 lines

... to match the code after the removal of PVHv1.

As an observation, why do we have C in a design doc like this?

~Andrew

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

author
#14 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Andrew Cooper
Quoted 15 lines · Andrew Cooper
Quoted 14 lines · Wei Liu
Quoted 13 lines · Jan Beulich

xen/arch/x86/traps.c static void nmi_hwdom_report(unsigned int reason_idx) · line 3541

Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 17.03.17 at 12:14, <[email protected]> wrote:
xen/arch/x86/traps.c +1 -1
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) )
         return;

But why would you remove the comment then? This needs fixing, after all.

Quoted 7 lines
Quoted 2 lines

Isn't PVHv2 going to use the native path? Now that there is no PVHv1, what is there to fix?

The native "inject an NMI" path still needs wiring into this codepath. The reason it wasn't done for PVHv1 was because we don't have a suitable native path yet, iirc.

OK, in that case dropping this patch is the most appropriate action.

Wei.

Quoted 1 line

~Andrew

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

#15 lore raw

Re: [PATCH 3/4] x86/traps: undo the PVHv1 bodge in NMI delivery path

In reply to Wei Liu
Quoted 16 lines · Wei Liu
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 17.03.17 at 12:14, <[email protected]> wrote:
xen/arch/x86/traps.c +0 -0
@@ -3537,7 +3537,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
Quoted 7 lines

xen/arch/x86/traps.c static void nmi_hwdom_report(unsigned int reason_idx) · line 3541

Quoted 3 lines
xen/arch/x86/traps.c +1 -1
-    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
+    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) )
         return;

But why would you remove the comment then? This needs fixing, after all.

Quoted 2 lines

Isn't PVHv2 going to use the native path? Now that there is no PVHv1, what is there to fix?

The code in nmi_hwdom_report assumes that Dom0 is a PV guest, and injects a PV NMI (or whatever it's called) by setting the reason in the shared info struct. On PVHv2 we sould use the native (HVM) way of injecting NMIs IMHO.

Roger.

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

#4 lore raw

Re: [PATCH 1/4] docs: update dmop.markdown

In reply to Andrew Cooper
Quoted 21 lines

-----Original Message-----
From: Andrew Cooper
Sent: 17 March 2017 11:33
To: Paul Durrant <[email protected]>; Wei Liu <[email protected]>; Xen-devel <[email protected]>
Cc: Jan Beulich <[email protected]>; Roger Pau Monne <[email protected]>
Subject: Re: [Xen-devel] [PATCH 1/4] docs: update dmop.markdown

Quoted 7 lines · Paul Durrant
Quoted 7 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Wei Liu
Sent: 17 March 2017 11:02
To: Xen-devel <[email protected]>
Cc: Andrew Cooper <[email protected]>; Wei Liu <[email protected]>; Jan Beulich <[email protected]>; Roger Pau

Monne

Quoted 3 lines
Quoted 3 lines

<[email protected]>
Subject: [Xen-devel] [PATCH 1/4] docs: update dmop.markdown

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

... to match the code after the removal of PVHv1.

As an observation, why do we have C in a design doc like this?

It is there as an illustration of how the hypercall implementation is supposed to function. If you prefer pseudo code then I'd have no objection to a patch to change this.

Paul

Quoted 1 line

~Andrew

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