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

Re: [PATCH v2] x86/pv: Fix assertions in svm_load_segs()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 8 Sep 2020 16:45:44 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 08 Sep 2020 15:45:54 +0000
  • Ironport-sdr: s/G0bzPD39pvjozBwgb4BDpcEeMA5urxzjmG4xdEB8lC5k7lWnpA+EOJI4l8kvW091kN3TINrk imZ9yH7FBqnG8PAfX7qmCzQZ7AKFNljJUdjr+MgRtJSRujcZrT/XOhKlnaCtNAYX+lHUKdUiGZ aniU74wbDsd7vapQx6c6Gh3DDspiTj96/PjWEV/9S3+wnNYVT+udxpFI1U7d/o3ks4iQQrmkNJ M4MNXB54/VZXSAV2RBCkkTW60Gbz6CbzOhlxjG2P1AnXBdwXBrjk+fb1EPPNPIwYN+7yO2XWOH H3E=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08/09/2020 16:36, Jan Beulich wrote:
> On 08.09.2020 17:08, Andrew Cooper wrote:
>> OSSTest has shown an assertion failure:
>> http://logs.test-lab.xenproject.org/osstest/logs/153906/test-xtf-amd64-amd64-1/serial-rimava1.log
>>
>> This is because we pass a non-NUL selector into svm_load_segs(), which is
>> something we must not do, as this path does not load the attributes/limit 
>> from
>> the GDT/LDT.
>>
>> Drop the {gs,gs}_sel parameters from svm_load_segs() and use 0 instead.  This
> Nit: {fs,gs}

Yeah - I noticed and fixed immediately after sending.  Also a plural
issue in the previous paragraph.

>
>> is fine even for non-zero NUL segments, as it is how the IRET instruction
>> behaves in all CPUs.
> To be honest, I'd not call it "fine", but "acceptable".

Ok.

> (And I don't consider IRET's behavior "fine" either.)

Nor me, but I'll happily use it to simplify our logic.

>> Only use the svm_load_segs() path when FS and GS are NUL, which is the common
>> case when scheduling a 64bit vcpu with 64bit userspace in context.
>>
>> Fixes: ad0fd291c5 ("x86/pv: Rewrite segment context switching from scratch")
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks.

~Andrew



 


Rackspace

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