All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pvh bug fixes
@ 2014-02-22  2:23 Mukesh Rathor
  2014-02-22  2:23 ` Mukesh Rathor
  2014-02-24 23:10 ` Mukesh Rathor
  0 siblings, 2 replies; 3+ messages in thread
From: Mukesh Rathor @ 2014-02-22  2:23 UTC (permalink / raw)
  To: xen-devel

Some rearrangement in linux code causes it to go thru certain hypercalls 
that will cause corruption in xen and crash. I like having a white list for a 
big feature while it goes thru it's adolescence to catch such bugs, but 
whatever. Since, it affects pvh dom0 paths only, I didnt' think it was 
necessary for 4.4.  

Attached patch adds check for it, and also certain paths (iirc it was
from xentrace) causes panic in hvm_hap_nested_page_fault. add a check
in there too.

thanks
Mukesh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] pvh bug fixes
  2014-02-22  2:23 [PATCH] pvh bug fixes Mukesh Rathor
@ 2014-02-22  2:23 ` Mukesh Rathor
  2014-02-24 23:10 ` Mukesh Rathor
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Rathor @ 2014-02-22  2:23 UTC (permalink / raw)
  To: xen-devel

Nested hvm is presently not supported for pvh. Calling
hvm_hap_nested_page_fault in certain paths will crash.

The rearrange in linux code causes it to go thru paths that will
corrupt hvm_domain structs and xen to panic for dom0 pvh.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/arch/x86/hvm/hvm.c | 3 +++
 xen/arch/x86/irq.c     | 4 ++--
 xen/arch/x86/physdev.c | 4 ++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 69f7e74..a4a3dcf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1416,6 +1416,9 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
     int sharing_enomem = 0;
     mem_event_request_t *req_ptr = NULL;
 
+    if ( is_pvh_vcpu(v) )
+        return 0;
+
     /* On Nested Virtualization, walk the guest page table.
      * If this succeeds, all is fine.
      * If this fails, inject a nested page fault into the guest.
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index db70077..88444be 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1068,13 +1068,13 @@ bool_t cpu_has_pending_apic_eoi(void)
 
 static inline void set_pirq_eoi(struct domain *d, unsigned int irq)
 {
-    if ( !is_hvm_domain(d) && d->arch.pv_domain.pirq_eoi_map )
+    if ( is_pv_domain(d) && d->arch.pv_domain.pirq_eoi_map )
         set_bit(irq, d->arch.pv_domain.pirq_eoi_map);
 }
 
 static inline void clear_pirq_eoi(struct domain *d, unsigned int irq)
 {
-    if ( !is_hvm_domain(d) && d->arch.pv_domain.pirq_eoi_map )
+    if ( is_pv_domain(d) && d->arch.pv_domain.pirq_eoi_map )
         clear_bit(irq, d->arch.pv_domain.pirq_eoi_map);
 }
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index bc0634c..9f85857 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -339,6 +339,10 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         unsigned long mfn;
         struct page_info *page;
 
+        ret = -ENOSYS;
+        if ( is_pvh_vcpu(current) )
+            break;
+
         ret = -EFAULT;
         if ( copy_from_guest(&info, arg, 1) != 0 )
             break;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pvh bug fixes
  2014-02-22  2:23 [PATCH] pvh bug fixes Mukesh Rathor
  2014-02-22  2:23 ` Mukesh Rathor
@ 2014-02-24 23:10 ` Mukesh Rathor
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Rathor @ 2014-02-24 23:10 UTC (permalink / raw)
  To: Mukesh Rathor; +Cc: xen-devel

On Fri, 21 Feb 2014 18:23:22 -0800
Mukesh Rathor <mukesh.rathor@oracle.com> wrote:

> Some rearrangement in linux code causes it to go thru certain
> hypercalls that will cause corruption in xen and crash. I like having
> a white list for a big feature while it goes thru it's adolescence to
> catch such bugs, but whatever. Since, it affects pvh dom0 paths only,
> I didnt' think it was necessary for 4.4.  
> 
> Attached patch adds check for it, and also certain paths (iirc it was
> from xentrace) causes panic in hvm_hap_nested_page_fault. add a check
> in there too.
> 
> thanks
> Mukesh
> 

Please ignore this. Resending with separate patches instead of one.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-24 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-22  2:23 [PATCH] pvh bug fixes Mukesh Rathor
2014-02-22  2:23 ` Mukesh Rathor
2014-02-24 23:10 ` Mukesh Rathor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.