[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/emul: Use existing X86_EXC_* constants



On 26.04.2021 14:45, Andrew Cooper wrote:
> ... rather than having separate definitions locally.  EXC_HAS_EC in particular
> is missing #CP, #VC and #SX vs X86_EXC_HAVE_EC.
> 
> Also switch a raw 14 for X86_EXC_PF in x86_emul_pagefault().
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> ---
>  xen/arch/x86/x86_emulate/x86_emulate.c | 739 
> ++++++++++++++++-----------------
>  xen/arch/x86/x86_emulate/x86_emulate.h |   4 +-
>  2 files changed, 361 insertions(+), 382 deletions(-)

This is a lot of code churn (almost all some slight growth) for this
kind of a change. I'm not opposed, but I'd like to explore alternatives
first. I know you often dislike token concatenation in macros, which
would be my first suggestion to get churn down here. The other option,
not reducing churn but reducing rather than increasing code volume (and
hence imo helping readability), would be to have shorthands for at
least some frequently raised exceptions like #UD and #GP - e.g.
generate_ud_if(). Thougths?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.