The final hunk is `(struct vcpu *)v` in disguise, expressed using a runtime
pointer chase through memory and a technicality of the C type system to work
around the fact that get_hvm_registers() strictly requires a mutable pointer.
For anyone interested, this is one reason why C cannot optimise any reads
across sequence points, even for a function purporting to take a const object.
Anyway, have the function correctly state that it needs a mutable vcpu. All
callers have a mutable vCPU to hand, and it removes the runtime pointer chase
in x86.
Make one style adjustment in ARM while adjusting the parameter type.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
} __cacheline_aligned;
-void vcpu_show_registers(const struct vcpu *v);
+void vcpu_show_registers(struct vcpu *v);
void vcpu_switch_to_aarch64_mode(struct vcpu *v);
/*
_show_registers(regs, &ctxt, guest_mode(regs), current);
}
-void vcpu_show_registers(const struct vcpu *v)
+void vcpu_show_registers(struct vcpu *v)
{
struct reg_ctxt ctxt;
+
ctxt.sctlr_el1 = v->arch.sctlr;
ctxt.tcr_el1 = v->arch.ttbcr;
ctxt.ttbr0_el1 = v->arch.ttbr0;
void force_update_secondary_system_time(struct vcpu *v,
struct vcpu_time_info *map);
-void vcpu_show_registers(const struct vcpu *v);
+void vcpu_show_registers(struct vcpu *v);
static inline struct vcpu_guest_context *alloc_vcpu_guest_context(void)
{
}
}
-void vcpu_show_registers(const struct vcpu *v)
+void vcpu_show_registers(struct vcpu *v)
{
const struct cpu_user_regs *regs = &v->arch.user_regs;
struct cpu_user_regs aux_regs;
if ( is_hvm_vcpu(v) )
{
aux_regs = *regs;
- get_hvm_registers(v->domain->vcpu[v->vcpu_id], &aux_regs, crs);
+ get_hvm_registers(v, &aux_regs, crs);
regs = &aux_regs;
context = CTXT_hvm_guest;
}