[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] hvm: Support PUSH from mmio area (opcode 0xFF/6).
# HG changeset patch # User Keir Fraser <keir@xxxxxxxxxxxxx> # Date 1171812580 0 # Node ID b5fc88aad1b0eb35d12e503982c70fdc27f0544a # Parent c5ff7671b9f29d7862f00ef6e6bdb464d96c2c10 hvm: Support PUSH from mmio area (opcode 0xFF/6). Also fix a bogus assertion in vlapic device model. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- xen/arch/x86/hvm/io.c | 5 +++++ xen/arch/x86/hvm/platform.c | 20 ++++++++++++++++++++ xen/arch/x86/hvm/vlapic.c | 2 +- xen/include/asm-x86/hvm/io.h | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) diff -r c5ff7671b9f2 -r b5fc88aad1b0 xen/arch/x86/hvm/io.c --- a/xen/arch/x86/hvm/io.c Sat Feb 17 13:26:33 2007 +0000 +++ b/xen/arch/x86/hvm/io.c Sun Feb 18 15:29:40 2007 +0000 @@ -686,6 +686,11 @@ static void hvm_mmio_assist(struct cpu_u set_reg_value(size, index, 0, regs, p->data); } break; + + case INSTR_PUSH: + mmio_opp->addr += hvm_get_segment_base(current, x86_seg_ss); + hvm_copy_to_guest_virt(mmio_opp->addr, &p->data, size); + break; } } diff -r c5ff7671b9f2 -r b5fc88aad1b0 xen/arch/x86/hvm/platform.c --- a/xen/arch/x86/hvm/platform.c Sat Feb 17 13:26:33 2007 +0000 +++ b/xen/arch/x86/hvm/platform.c Sun Feb 18 15:29:40 2007 +0000 @@ -716,6 +716,11 @@ static int mmio_decode(int address_bytes mmio_op->instr = INSTR_SUB; return DECODE_success; + case 6: /* push */ + mmio_op->instr = INSTR_PUSH; + mmio_op->operand[0] = mmio_op->operand[1]; + return DECODE_success; + default: printk("%x/%x, This opcode isn't handled yet!\n", *opcode, ins_subtype); @@ -1129,6 +1134,21 @@ void handle_mmio(unsigned long gpa) case INSTR_XOR: mmio_operands(IOREQ_TYPE_XOR, gpa, mmio_op, op_size); + break; + + case INSTR_PUSH: + if ( ad_size == WORD ) + { + mmio_op->addr = (uint16_t)(regs->esp - op_size); + regs->esp = mmio_op->addr | (regs->esp & ~0xffff); + } + else + { + regs->esp -= op_size; + mmio_op->addr = regs->esp; + } + /* send the request and wait for the value */ + send_mmio_req(IOREQ_TYPE_COPY, gpa, 1, op_size, 0, IOREQ_READ, df, 0); break; case INSTR_CMP: /* Pass through */ diff -r c5ff7671b9f2 -r b5fc88aad1b0 xen/arch/x86/hvm/vlapic.c --- a/xen/arch/x86/hvm/vlapic.c Sat Feb 17 13:26:33 2007 +0000 +++ b/xen/arch/x86/hvm/vlapic.c Sun Feb 18 15:29:40 2007 +0000 @@ -459,7 +459,7 @@ static void vlapic_read_aligned(struct v 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)); + ASSERT((len == 4) && (offset >= 0) && (offset <= APIC_TDCR)); switch ( offset ) { diff -r c5ff7671b9f2 -r b5fc88aad1b0 xen/include/asm-x86/hvm/io.h --- a/xen/include/asm-x86/hvm/io.h Sat Feb 17 13:26:33 2007 +0000 +++ b/xen/include/asm-x86/hvm/io.h Sun Feb 18 15:29:40 2007 +0000 @@ -65,6 +65,7 @@ #define INSTR_XCHG 14 #define INSTR_SUB 15 #define INSTR_ADD 16 +#define INSTR_PUSH 17 #define MAX_INST_LEN 15 /* Maximum instruction length = 15 bytes */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |