On 25.03.2025 18:41, Andrew Cooper wrote: > In hvmemul_read_cr(), make the TRACE()/X86EMUL_OKAY path common in preparation > for adding a %cr8 case. Use a local 'val' variable instead of always > operating on a deferenced pointer. > > In both, calculate curr once. > > No functional change. > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com> with two suggestions: > --- a/xen/arch/x86/hvm/emulate.c > +++ b/xen/arch/x86/hvm/emulate.c > @@ -2273,23 +2273,30 @@ static int cf_check hvmemul_write_io( > > static int cf_check hvmemul_read_cr( > unsigned int reg, > - unsigned long *val, > + unsigned long *_val, Could I talk you into avoiding the leading underscore here, by using e.g. "pval" or "valp"? > struct x86_emulate_ctxt *ctxt) > { > + struct vcpu *curr = current; This can be pointer-to-const? Jan