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] Add a mmio decode for 0F BA /4 for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM] Add a mmio decode for 0F BA /4 for HVM guest.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 01 Sep 2006 01:30:16 +0000
Delivery-date: Thu, 31 Aug 2006 18:31:08 -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 e83368c8d5e24c074002b10d8fad6a2a50d96a95
# Parent  37e5dfad8425bf92c40d47152b305a73d77b6653
[HVM] Add a mmio decode for 0F BA /4 for HVM guest.
Signed-off-by: Xiaohui Xin <xiaohui.xin@xxxxxxxxx>
---
 xen/arch/x86/hvm/io.c       |   10 +++++++---
 xen/arch/x86/hvm/platform.c |   32 ++++++++++++++++++++++++++++----
 2 files changed, 35 insertions(+), 7 deletions(-)

diff -r 37e5dfad8425 -r e83368c8d5e2 xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c     Thu Aug 31 23:58:23 2006 +0100
+++ b/xen/arch/x86/hvm/io.c     Thu Aug 31 23:59:11 2006 +0100
@@ -646,9 +646,13 @@ static void hvm_mmio_assist(struct cpu_u
         break;
 
     case INSTR_BT:
-        index = operand_index(src);
-        value = get_reg_value(size, index, 0, regs);
-
+        if ( src & REGISTER )
+        {
+            index = operand_index(src);
+            value = get_reg_value(size, index, 0, regs);
+        }
+        else if ( src & IMMEDIATE )
+            value = mmio_opp->immediate;
         if (p->u.data & (1 << (value & ((1 << 5) - 1))))
             regs->eflags |= X86_EFLAGS_CF;
         else
diff -r 37e5dfad8425 -r e83368c8d5e2 xen/arch/x86/hvm/platform.c
--- a/xen/arch/x86/hvm/platform.c       Thu Aug 31 23:58:23 2006 +0100
+++ b/xen/arch/x86/hvm/platform.c       Thu Aug 31 23:59:11 2006 +0100
@@ -652,6 +652,23 @@ static int hvm_decode(int realmode, unsi
         instr->operand[1] = mk_operand(instr->op_size, 0, 0, MEMORY);
         return DECODE_success;
 
+    case 0xBA:
+        if (((opcode[1] >> 3) & 7) == 4) /* BT $imm8, m16/32/64 */
+        {
+            instr->instr = INSTR_BT;
+            GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
+            instr->immediate =
+                    (signed char)get_immediate(realmode, opcode+1, BYTE);
+            instr->operand[0] = mk_operand(BYTE, 0, 0, IMMEDIATE);
+            instr->operand[1] = mk_operand(instr->op_size, 0, 0, MEMORY);
+            return DECODE_success;
+        }
+        else
+        {
+            printf("0f %x, This opcode subtype isn't handled yet\n", *opcode);
+            return DECODE_failure;
+        }
+
     default:
         printf("0f %x, This opcode isn't handled yet\n", *opcode);
         return DECODE_failure;
@@ -1002,10 +1019,17 @@ void handle_mmio(unsigned long va, unsig
             mmio_opp->operand[0] = mmio_inst.operand[0]; /* bit offset */
             mmio_opp->operand[1] = mmio_inst.operand[1]; /* bit base */
 
-            index = operand_index(mmio_inst.operand[0]);
-            size = operand_size(mmio_inst.operand[0]);
-            value = get_reg_value(size, index, 0, regs);
-
+            if ( mmio_inst.operand[0] & REGISTER )
+            { 
+                index = operand_index(mmio_inst.operand[0]);
+                size = operand_size(mmio_inst.operand[0]);
+                value = get_reg_value(size, index, 0, regs);
+            }
+            else if ( mmio_inst.operand[0] & IMMEDIATE )
+            {
+                mmio_opp->immediate = mmio_inst.immediate;
+                value = mmio_inst.immediate;
+            } 
             send_mmio_req(IOREQ_TYPE_COPY, gpa + (value >> 5), 1,
                           mmio_inst.op_size, 0, IOREQ_READ, 0);
             break;

_______________________________________________
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] Add a mmio decode for 0F BA /4 for HVM guest., Xen patchbot-unstable <=