struct sh_emulate_ctxt emul_ctxt;
const struct x86_emulate_ops *emul_ops;
int r;
- fetch_type_t ft = 0;
p2m_type_t p2mt;
uint32_t rc;
int version;
- struct npfec access = {
+ const struct npfec access = {
.read_access = 1,
+ .write_access = !!(regs->error_code & PFEC_write_access),
.gla_valid = 1,
.kind = npfec_kind_with_gla
};
+ const fetch_type_t ft =
+ access.write_access ? ft_demand_write : ft_demand_read;
#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
int fast_emul = 0;
#endif
perfc_incr(shadow_fault);
- if ( regs->error_code & PFEC_write_access )
- access.write_access = 1;
-
#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
/* If faulting frame is successfully emulated in last shadow fault
* it's highly likely to reach same emulation action for this frame.
goto propagate;
}
- /* What kind of access are we dealing with? */
- ft = ((regs->error_code & PFEC_write_access)
- ? ft_demand_write : ft_demand_read);
-
/* What mfn is the guest trying to access? */
gfn = guest_l1e_get_gfn(gw.l1e);
gmfn = get_gfn(d, gfn, &p2mt);