All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]Add an mmio decoder for 0F BA /4
@ 2006-08-31  7:20 Xin, Xiaohui
  2006-08-31 17:39 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Xin, Xiaohui @ 2006-08-31  7:20 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 126 bytes --]

 

This patch adds a mmio decoder for 0F BA /4 for HVM guest.

 

Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>


[-- Attachment #1.2: Type: text/html, Size: 2207 bytes --]

[-- Attachment #2: bt_1.diff --]
[-- Type: application/octet-stream, Size: 2803 bytes --]

diff -r 5148cb3eb496 xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c	Tue Aug 29 15:48:30 2006 +0800
+++ b/xen/arch/x86/hvm/io.c	Tue Aug 29 16:30:36 2006 +0800
@@ -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 5148cb3eb496 xen/arch/x86/hvm/platform.c
--- a/xen/arch/x86/hvm/platform.c	Tue Aug 29 15:48:30 2006 +0800
+++ b/xen/arch/x86/hvm/platform.c	Tue Aug 29 16:30:36 2006 +0800
@@ -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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

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

* Re: [PATCH]Add an mmio decoder for 0F BA /4
  2006-08-31  7:20 [PATCH]Add an mmio decoder for 0F BA /4 Xin, Xiaohui
@ 2006-08-31 17:39 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2006-08-31 17:39 UTC (permalink / raw)
  To: Xin, Xiaohui, xen-devel

On 31/8/06 8:20 am, "Xin, Xiaohui" <xiaohui.xin@intel.com> wrote:

> This patch adds a mmio decoder for 0F BA /4 for HVM guest.

At this rate it should be a full decoder by 2020. ;-)

 -- Keir

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

end of thread, other threads:[~2006-08-31 17:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-31  7:20 [PATCH]Add an mmio decoder for 0F BA /4 Xin, Xiaohui
2006-08-31 17:39 ` Keir Fraser

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.