WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] hvm: Remove guest-triggerable assertions

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm: Remove guest-triggerable assertions from vlapic emulation.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Dec 2007 14:00:08 -0800
Delivery-date: Fri, 14 Dec 2007 14:00:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1197629298 0
# Node ID 3ee37b6279b76c58f49a056c44f413bf8cc030a9
# Parent  301507ac350a08335790b99ac845811cfc2b0a55
hvm: Remove guest-triggerable assertions from vlapic emulation.

Currently our VLAPIC will happily deliver interrupts on vectors <
16. This could be emulated better, but probably does not matter.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vlapic.c        |   47 ++++++++++++++-------------------------
 xen/include/asm-x86/hvm/vlapic.h |    2 -
 2 files changed, 17 insertions(+), 32 deletions(-)

diff -r 301507ac350a -r 3ee37b6279b7 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Fri Dec 14 10:34:22 2007 +0000
+++ b/xen/arch/x86/hvm/vlapic.c Fri Dec 14 10:48:18 2007 +0000
@@ -120,14 +120,9 @@ static void vlapic_clear_irr(int vector,
     vlapic_clear_vector(vector, &vlapic->regs->data[APIC_IRR]);
 }
 
-int vlapic_find_highest_irr(struct vlapic *vlapic)
-{
-    int result;
-
-    result = vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
-    ASSERT((result == -1) || (result >= 16));
-
-    return result;
+static int vlapic_find_highest_irr(struct vlapic *vlapic)
+{
+    return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
@@ -142,14 +137,9 @@ int vlapic_set_irq(struct vlapic *vlapic
     return ret;
 }
 
-int vlapic_find_highest_isr(struct vlapic *vlapic)
-{
-    int result;
-
-    result = vlapic_find_highest_vector(&vlapic->regs->data[APIC_ISR]);
-    ASSERT((result == -1) || (result >= 16));
-
-    return result;
+static int vlapic_find_highest_isr(struct vlapic *vlapic)
+{
+    return vlapic_find_highest_vector(&vlapic->regs->data[APIC_ISR]);
 }
 
 uint32_t vlapic_get_ppr(struct vlapic *vlapic)
@@ -454,11 +444,9 @@ static void vlapic_set_tdcr(struct vlapi
                 "timer_divisor: %d", vlapic->hw.timer_divisor);
 }
 
-static void vlapic_read_aligned(struct vlapic *vlapic, unsigned int offset,
-                         unsigned int len, unsigned int *result)
-{
-    ASSERT((len == 4) && (offset >= 0) && (offset <= APIC_TDCR));
-
+static void vlapic_read_aligned(
+    struct vlapic *vlapic, unsigned int offset, unsigned int *result)
+{
     switch ( offset )
     {
     case APIC_PROCPRI:
@@ -487,15 +475,9 @@ static unsigned long vlapic_read(struct 
     if ( offset > APIC_TDCR )
         return 0;
 
-    /* some bugs on kernel cause read this with byte*/
-    if ( len != 4 )
-        HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
-                    "read with len=0x%lx, should be 4 instead",
-                    len);
-
     alignment = offset & 0x3;
 
-    vlapic_read_aligned(vlapic, offset & ~0x3, 4, &tmp);
+    vlapic_read_aligned(vlapic, offset & ~0x3, &tmp);
     switch ( len )
     {
     case 1:
@@ -503,12 +485,14 @@ static unsigned long vlapic_read(struct 
         break;
 
     case 2:
-        ASSERT( alignment != 3 );
+        if ( alignment == 3 )
+            goto unaligned_exit_and_crash;
         result = *(unsigned short *)((unsigned char *)&tmp + alignment);
         break;
 
     case 4:
-        ASSERT( alignment == 0 );
+        if ( alignment != 0 )
+            goto unaligned_exit_and_crash;
         result = *(unsigned int *)((unsigned char *)&tmp + alignment);
         break;
 
@@ -523,6 +507,9 @@ static unsigned long vlapic_read(struct 
 
     return result;
 
+ unaligned_exit_and_crash:
+    gdprintk(XENLOG_ERR, "Unaligned LAPIC read len=0x%lx at offset=0x%x.\n",
+             len, offset);
  exit_and_crash:
     domain_crash(v->domain);
     return 0;
diff -r 301507ac350a -r 3ee37b6279b7 xen/include/asm-x86/hvm/vlapic.h
--- a/xen/include/asm-x86/hvm/vlapic.h  Fri Dec 14 10:34:22 2007 +0000
+++ b/xen/include/asm-x86/hvm/vlapic.h  Fri Dec 14 10:48:18 2007 +0000
@@ -73,8 +73,6 @@ static inline void vlapic_set_reg(
 
 int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig);
 
-int vlapic_find_highest_irr(struct vlapic *vlapic);
-
 int vlapic_has_pending_irq(struct vcpu *v);
 int vlapic_ack_pending_irq(struct vcpu *v, int vector);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] hvm: Remove guest-triggerable assertions from vlapic emulation., Xen patchbot-unstable <=