static int linearize(struct x86_emulate_ctxt *ctxt,
struct segmented_address addr,
+ unsigned size, bool write,
ulong *linear)
{
struct decode_cache *c = &ctxt->decode;
int rc;
ulong linear;
- rc = linearize(ctxt, addr, &linear);
+ rc = linearize(ctxt, addr, size, false, &linear);
if (rc != X86EMUL_CONTINUE)
return rc;
return ctxt->ops->read_std(linear, data, size, ctxt->vcpu,
int rc;
ulong linear;
- rc = linearize(ctxt, addr, &linear);
+ rc = linearize(ctxt, addr, size, false, &linear);
if (rc != X86EMUL_CONTINUE)
return rc;
return read_emulated(ctxt, ctxt->ops, linear, data, size);
int rc;
ulong linear;
- rc = linearize(ctxt, addr, &linear);
+ rc = linearize(ctxt, addr, size, true, &linear);
if (rc != X86EMUL_CONTINUE)
return rc;
return ctxt->ops->write_emulated(linear, data, size,
int rc;
ulong linear;
- rc = linearize(ctxt, addr, &linear);
+ rc = linearize(ctxt, addr, size, true, &linear);
if (rc != X86EMUL_CONTINUE)
return rc;
return ctxt->ops->cmpxchg_emulated(linear, orig_data, data,
int rc;
ulong linear;
- rc = linearize(ctxt, c->src.addr.mem, &linear);
+ rc = linearize(ctxt, c->src.addr.mem, 1, false, &linear);
if (rc == X86EMUL_CONTINUE)
emulate_invlpg(ctxt->vcpu, linear);
/* Disable writeback. */