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

Re: [PATCH] xen/x86: fix PV trap handling on secondary processors

  • To: Juergen Gross <jgross@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Fri, 17 Sep 2021 13:50:54 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8RzBI9rQ7gL3OCEC1uwYXpUxnhWvDlTVcndSDMLtFQo=; b=kCSbPAQHPN8LwOik1/b9WV4ZDn5o2m4m2Ahb7b9coiwD4z8vTsNfyZOzjja21RGsJ8svjleIu5hkvlHfMmBHpOQe0CVLpGITqJ5SeZ8MbfYZr0r3xP4kjTU/wSOR1zRglaWpWPXt0SfZqssnGqUWB+3e1ABxzTpOZua9E6OecxaG97tg6y914h9JPQHWo3Os7rxrH0fnwA/vofPIn5jWp/A2O8mwkfyCCSQqELDUsxdb0j0644xNJe9nzmS2ywPWLAB/Ikggp3nXTNMSVqALYm8ZsvFKQwXdpFqD03Qc1x3ZsozOvOqe0hrBOYHVIoVx00XlCmN1bGb1H+wTz1EMjw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0qFHVYgg0pVljjE4GeYun+vqQW6/uIFrecfatxk2fKczPSad21cqo1EvP2tzWny7D2W6pMagRG/UW5tJZKVVxfaaLIjmrXU/E3vM9i6QTOWCjmUfdrYKTBn6BAUUqHkdfYXlDuZrrQLtE9suwCbQEwPaShpWEL5nnmApXbxS17ehYJOkIVGCpR3d6jI5pcINldPp4uO54R/zH9h6c0mDs0DxFDJDqlVLUGG4FoL6WRjHs7BUB+LLEF6dyZ33cjEAanlA9GqaImAdBGoFbV73akhwa4bX7BPFwHK4gl1xM4faW8/oRRSZa3FYbpmarhG51EbB6e/+JDz3L6nv+IrKA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=oracle.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 17 Sep 2021 17:51:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 9/17/21 3:24 AM, Juergen Gross wrote:
> On 17.09.21 08:50, Jan Beulich wrote:
>> On 17.09.2021 08:47, Juergen Gross wrote:
>>> On 17.09.21 08:40, Jan Beulich wrote:
>>>> On 17.09.2021 03:34, Boris Ostrovsky wrote:
>>>>> On 9/16/21 11:04 AM, Jan Beulich wrote:
>>>>>>    {
>>>>>>        const struct desc_ptr *desc = this_cpu_ptr(&idt_desc);
>>>>>> +    unsigned i, count = (desc->size + 1) / sizeof(gate_desc);
>>>>>>    -    xen_convert_trap_info(desc, traps);
>>>>> Can you instead add a boolean parameter to xen_convert_trap_info() to 
>>>>> indicate whether to skip empty entries? That will avoid (almost) 
>>>>> duplicating the code.
>>>> I can, sure, but I specifically didn't, as the result is going to be less
>>>> readable imo. Instead I was considering to fold xen_convert_trap_info()
>>>> into its only remaining caller. Yet if you're convinced adding the
>>>> parameter is the way to do, I will go that route. But please confirm.

Yes, that would be my preference. No preference on where to set the sentinel.



>>> I don't think the result will be very hard to read. All you need is the
>>> new parameter and extending the if statement in xen_convert_trap_info()
>>> to increment out always if no entry is to be skipped.
>> And skip writing the sentinel.
> Maybe it would be even better then to let xen_convert_trap_info() return
> the number of entries written and to write the sentinel in
> xen_load_idt() instead, as this is the only place where it is needed.
> Juergen



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