Hi Andrew,

On 05/15/2017 04:40 PM, Andrew Cooper wrote:
On 15/05/17 16:31, Jan Beulich wrote:
On 15.05.17 at 14:50, <andrew.coop...@citrix.com> wrote:
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -633,9 +633,12 @@ void pv_inject_event(const struct x86_event *event)
     const struct trap_info *ti;
     const uint8_t vector = event->vector;
     const bool use_error_code =
+        (event->type == X86_EVENTTYPE_HW_EXCEPTION) &&
         ((vector < 32) && (TRAP_HAVE_EC & (1u << vector)));
     unsigned int error_code = event->error_code;

+    ASSERT(event->type == X86_EVENTTYPE_HW_EXCEPTION ||
+           event->type == X86_EVENTTYPE_SW_INTERRUPT);
Wouldn't it be better to tighten this even further:

    if ( event->type == X86_EVENTTYPE_HW_EXCEPTION )
    {
        ASSERT(vector < 32);
        use_error_code = TRAP_HAVE_EC & (1u << vector);
    }
    else
    {
        ASSERT(event->type == X86_EVENTTYPE_SW_INTERRUPT);
        use_error_code = false;
    }

? If you agree
Reviewed-by: Jan Beulich <jbeul...@suse.com>
with this or a substantially identical change.

Yeah.  I'm happy with this, and it will have a small knock-on to the
following patch.

For this patch:

Release-acked-by: Julien Grall <julien.gr...@arm.com>

Regarding the second one, we are going to release in a couple of weeks. So I would prefer to defer non bug fixes patch to Xen 4.10.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to