HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
+HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/hvm/*.h)
+HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/hvm/svm/*.h)
+HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/hvm/vmx/*.h)
# Do not depend on auto-generated header files.
HDRS := $(subst $(BASEDIR)/include/asm-$(TARGET_ARCH)/asm-offsets.h,,$(HDRS))
HDRS := $(subst $(BASEDIR)/include/xen/banner.h,,$(HDRS))
req->u.data = tmp1;
break;
+ case IOREQ_TYPE_XCHG:
+ /*
+ * Note that we don't need to be atomic here since VCPU is accessing
+ * its own local APIC.
+ */
+ tmp1 = read_handler(v, req->addr, req->size);
+ write_handler(v, req->addr, req->size, (unsigned long) req->u.data);
+ req->u.data = tmp1;
+ break;
+
default:
printk("error ioreq type for local APIC %x\n", req->type);
domain_crash_synchronous();
if ( hvm_mmio_handlers[i]->check_handler(v, p->addr) ) {
hvm_mmio_access(v, p,
hvm_mmio_handlers[i]->read_handler,
- hvm_mmio_handlers[i]->write_handler);
+ hvm_mmio_handlers[i]->write_handler);
return 1;
}
}
GET_OP_SIZE_FOR_BYTE(size_reg);
return mem_reg(size_reg, opcode, instr, rex);
+ case 0x87: /* xchg {r/m16|r/m32}, {m/r16|m/r32} */
+ instr->instr = INSTR_XCHG;
+ GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
+ if (((*(opcode+1)) & 0xc7) == 5)
+ return reg_mem(instr->op_size, opcode, instr, rex);
+ else
+ return mem_reg(instr->op_size, opcode, instr, rex);
+
case 0x88: /* mov r8, m8 */
instr->instr = INSTR_MOV;
instr->op_size = BYTE;
break;
}
+ case INSTR_XCHG:
+ mmio_opp->flags = mmio_inst.flags;
+ 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);
+ break;
+
default:
printf("Unhandled MMIO instruction\n");
domain_crash_synchronous();