38 #define PIB_LOW_HALF(ofst) !(ofst & (1 << 20))
39 #define PIB_OFST_INTA 0x1E0000
40 #define PIB_OFST_XTP 0x1E0008
45 static void vlsapic_write_ipi(
struct kvm_vcpu *vcpu,
69 panic_vm(v,
"Undefined write on PIB INTA\n");
73 vlsapic_write_xtp(v, val);
75 panic_vm(v,
"Undefined write on PIB XTP\n");
82 panic_vm(v,
"Can't LHF write with size %ld!\n",
85 vlsapic_write_ipi(v, addr, val);
87 panic_vm(v,
"IPI-UHF write %lx\n", addr);
105 panic_vm(v,
"Undefined read on PIB INTA\n");
112 panic_vm(v,
"Undefined read on PIB XTP\n");
116 panic_vm(v,
"Undefined addr access for lsapic!\n");
123 u16 s,
int ma,
int dir)
153 *dest = p->
u.
ioreq.data & (~0
UL >> (64-(s*8)));
155 panic_vm(vcpu,
"Unhandled mmio access returned!\n");
166 #define SL_FLOATING 1
179 regs = vcpu_regs(vcpu);
188 else if (slot == 1) {
191 inst.
inst = slot1a + (slot1b << 18);
192 }
else if (slot == 2)
196 if (inst.
M1.
major == 4 && inst.
M1.
m == 0 && inst.
M1.
x == 0) {
198 size = (inst.
M1.
x6 & 0x3);
199 if ((inst.
M1.
x6 >> 2) > 0xb) {
203 }
else if ((inst.
M1.
x6 >> 2) < 0
xb) {
207 }
else if (inst.
M2.
major == 4 && inst.
M2.
m == 1 && inst.
M2.
x == 0) {
211 size = (inst.
M2.
x6 & 0x3);
216 }
else if (inst.
M3.
major == 5) {
219 size = (inst.
M3.
x6&0x3);
220 if ((inst.
M5.
x6 >> 2) > 0xb) {
225 imm = (inst.
M5.
s << 31) | (inst.
M5.
i << 30) |
230 }
else if ((inst.
M3.
x6 >> 2) < 0
xb) {
234 imm = (inst.
M3.
s << 31) | (inst.
M3.
i << 30) |
240 }
else if (inst.
M9.
major == 6 && inst.
M9.
x6 == 0x3B
241 && inst.
M9.
m == 0 && inst.
M9.
x == 0) {
249 v.
u.
bits[1] &= 0x3ffff;
250 mmio_access(vcpu, padr + 8, (
u64 *)&v.
u.
bits[1], 8,
262 imm = (inst.
M10.
s << 31) | (inst.
M10.
i << 30) |
268 v.
u.
bits[1] &= 0x3ffff;
269 mmio_access(vcpu, padr + 8, (
u64 *)&v.
u.
bits[1],
282 imm = (inst.
M10.
s << 31) | (inst.
M10.
i << 30) |
287 && inst.
M15.
x6 <= 0x2f) {
289 imm = (inst.
M15.
s << 31) | (inst.
M15.
i << 30) |
297 && inst.
M12.
x == 1 && inst.
M12.
x6 == 1) {
304 mmio_access(vcpu, padr, &data, size, ma, dir);
306 v.
u.
bits[1] = 0x1003E;
309 mmio_access(vcpu, padr, &data, size, ma, dir);
311 v.
u.
bits[1] = 0x1003E;
319 panic_vm(vcpu,
"Unsupported MMIO access instruction! "
320 "Bunld[0]=0x%lx, Bundle[1]=0x%lx\n",
321 bundle.
i64[0], bundle.
i64[1]);
326 mmio_access(vcpu, padr, &data, size, ma, dir);
328 mmio_access(vcpu, padr, &data, size, ma, dir);
332 panic_vm(vcpu,
"Unsupported instruction type!\n");