Re: [Xen-devel] [PATCH 05/15] x86/emul: Remove opencoded exception generation

2016-11-24 Thread Andrew Cooper
On 24/11/16 16:31, Jan Beulich wrote: > >>> With you having added my S-o-b (not really sure why), I'm not sure >>> it makes a whole lot of sense to give my R-b as well (but feel free >>> to add it). >> Your code was originally the few bits replacing opencoded "goto >> raise_exception" with generate

Re: [Xen-devel] [PATCH 05/15] x86/emul: Remove opencoded exception generation

2016-11-24 Thread Jan Beulich
>>> On 24.11.16 at 17:24, wrote: > On 24/11/16 14:31, Jan Beulich wrote: > On 23.11.16 at 16:38, wrote: >>> +#define generate_exception_if(p, e, ec...)\ >>> ({ if ( (p) ) { \ >>> fail_if(ops->i

Re: [Xen-devel] [PATCH 05/15] x86/emul: Remove opencoded exception generation

2016-11-24 Thread Andrew Cooper
On 24/11/16 14:31, Jan Beulich wrote: On 23.11.16 at 16:38, wrote: >> +static inline int mkec(uint8_t e, int32_t ec, ...) >> +{ >> +return (e < 32 && (1u << e) & EXC_HAS_EC) ? ec : X86_EVENT_NO_EC; > Please parenthesize the operands of &. Fixed. > >> +} >> + >> +#define generate_excepti

Re: [Xen-devel] [PATCH 05/15] x86/emul: Remove opencoded exception generation

2016-11-24 Thread Jan Beulich
>>> On 23.11.16 at 16:38, wrote: > +static inline int mkec(uint8_t e, int32_t ec, ...) > +{ > +return (e < 32 && (1u << e) & EXC_HAS_EC) ? ec : X86_EVENT_NO_EC; Please parenthesize the operands of &. > +} > + > +#define generate_exception_if(p, e, ec...)\ > (

[Xen-devel] [PATCH 05/15] x86/emul: Remove opencoded exception generation

2016-11-23 Thread Andrew Cooper
Introduce generate_exception() for unconditional exception generation, and replace existing uses. Both generate_exception() and generate_exception_if() are updated to make their error code parameters optional, which removes the use of the -1 sentinal. The ioport_access_check() check loses the pre