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-3.0-testing] [HVM] Fix a bug in the emulation of th

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0-testing] [HVM] Fix a bug in the emulation of the xchg instruction.
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 03 Jun 2006 00:01:22 +0000
Delivery-date: Fri, 02 Jun 2006 17:03:06 -0700
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID d316d7faf64e7240c748acb598eb0cf83d86c536
# Parent  b6a04d27b6e16cf16a3bdbad61a00719df62b8d3
[HVM] Fix a bug in the emulation of the xchg instruction.

This bug has prevented us from booting fully virtualized SMP guests
that write to the APIC using the xchg instruction (when
CONFIG_X86_GOOD_APIC is not set). On 32 bit platforms, sles 10 kernels
are built without CONFIG_x86_GOOD_APIC not set and hence we have had
problems booting fully virtualized SMP sles 10 guests.

Signed-off-by: K. Y. Srinivasan <ksrinivasan@xxxxxxxxxx>
xen-unstable changeset:   10179:5be9e927533d94ed1389f8926d51c65849133556
xen-unstable date:        Tue May 30 12:30:47 2006 +0100
---
 xen/arch/x86/hvm/io.c       |   10 ++++++++++
 xen/arch/x86/hvm/platform.c |   24 ++++++++++++++++++++----
 2 files changed, 30 insertions(+), 4 deletions(-)

diff -r b6a04d27b6e1 -r d316d7faf64e xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c     Wed May 31 07:32:04 2006 +0100
+++ b/xen/arch/x86/hvm/io.c     Wed May 31 07:32:55 2006 +0100
@@ -646,6 +646,16 @@ static void hvm_mmio_assist(struct vcpu 
             regs->eflags &= ~X86_EFLAGS_CF;
 
         break;
+
+    case INSTR_XCHG:
+       if (src & REGISTER) {
+               index = operand_index(src);
+               set_reg_value(size, index, 0, regs, p->u.data);
+       } else {
+               index = operand_index(dst);
+               set_reg_value(size, index, 0, regs, p->u.data);
+       }
+       break;
     }
 
     hvm_load_cpu_guest_regs(v, regs);
diff -r b6a04d27b6e1 -r d316d7faf64e xen/arch/x86/hvm/platform.c
--- a/xen/arch/x86/hvm/platform.c       Wed May 31 07:32:04 2006 +0100
+++ b/xen/arch/x86/hvm/platform.c       Wed May 31 07:32:55 2006 +0100
@@ -954,10 +954,26 @@ void handle_mmio(unsigned long va, unsig
         mmio_opp->instr = mmio_inst.instr;
         mmio_opp->operand[0] = mmio_inst.operand[0]; /* source */
         mmio_opp->operand[1] = mmio_inst.operand[1]; /* destination */
-
-        /* send the request and wait for the value */
-        send_mmio_req(IOREQ_TYPE_XCHG, gpa, 1,
-                      mmio_inst.op_size, 0, IOREQ_WRITE, 0);
+       if (mmio_inst.operand[0] & REGISTER) {
+               long value;
+               unsigned long operand = mmio_inst.operand[0];
+               value = get_reg_value(operand_size(operand), 
+                                     operand_index(operand), 0,
+                                     mmio_opp->inst_decoder_regs);
+               /* send the request and wait for the value */
+               send_mmio_req(IOREQ_TYPE_XCHG, gpa, 1,
+                      mmio_inst.op_size, value, IOREQ_WRITE, 0);
+       } else {
+               /* the destination is a register */
+               long value;
+               unsigned long operand = mmio_inst.operand[1];
+               value = get_reg_value(operand_size(operand), 
+                                     operand_index(operand), 0,
+                                     mmio_opp->inst_decoder_regs);
+               /* send the request and wait for the value */
+               send_mmio_req(IOREQ_TYPE_XCHG, gpa, 1,
+                      mmio_inst.op_size, value, IOREQ_WRITE, 0);
+       }
         break;
 
     default:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0-testing] [HVM] Fix a bug in the emulation of the xchg instruction., Xen patchbot-3 . 0-testing <=