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

Re: [Xen-devel] [PATCH for-4.9 1/2] x86/pv: Fix the handling of `int $x` for vectors which alias exceptions



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.cooper3@xxxxxxxxxx> 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 <jbeulich@xxxxxxxx>
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.grall@xxxxxxx>

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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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