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

Re: [PATCH] xen: add option to disable GNTTABOP_transfer


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Feb 2022 13:04:29 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RbGtFGAPQdoQUjLHf23UTiEs2aFu9ONuIqPMYyI9F6Y=; b=b6Ia9ajXC0T08YqSXsK5ZVQnuHJSvAHW2znfhUcsWNNTaLXLR2/yYlAskp+XSpkPDoqjfpO4kZq56HjF3sMZ6V6kuicCZwJ/VNv5mOpJ6zzkh8998X0U0xPepPzwwR8gGgeb7Ofg60HT1ObbT2AFD1DRpQU+L4byu52NTMr0RSSdwTC+CPVwWn0u3Xif6aDFl1TJaQBXD98ylgxnUwXV/BZ4KNaZZgIVKtua/IV1x59U/lc33NFzWtVQLexzIIX6tUxp9bvl3FAEaYavJTuVriQmIrK/lEgLWNcP1zC9RI0/dBjShb6rIm0pTCdIqTo3H+lFzOKbbSic0L2OpDF+SQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OthmLkaoqR8xxbs49opU5o5EyH9mwraeOMdKKH0F+pH9XppDp7J8fyWZElRu1tn8UbcGAytSa9jK7sfFcJVL7OFpwjxzIh4YLhcSOKjtVzPaEOtfX1/T2y+fM2yBp3Esacb7t3sf49JrQpf/v+xqFkcjCbQAp9dYlwVz9/qNIcAQOq97C/qYfHhv039vJgM0+EG6cjKK2EsWPWCCGG+PhO9fDIEg8I6Q52M9bEPNro+R5v4ClFQ9r5Zi94CK+yMTs2ScwQ2HARC85NaEs7cST5sPTIRnqSGf6NiuSJnved8Zka5KmMgn41Xx2W6rxBpzr+b4UlbsMkBAeB28q5+16w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 03 Feb 2022 12:04:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.02.2022 11:55, Juergen Gross wrote:
> On 03.02.22 10:10, Jan Beulich wrote:
>> On 01.02.2022 10:02, Juergen Gross wrote:
>>> The grant table operation GNTTABOP_transfer is meant to be used in
>>> PV device backends, and it hasn't been used in Linux since the old
>>> Xen-o-Linux days.
>>
>> Kind of unusual spelling of XenoLinux ;-)
>>
>>> --- a/xen/common/grant_table.c
>>> +++ b/xen/common/grant_table.c
>>> @@ -181,6 +181,7 @@ static int parse_gnttab_max_maptrack_frames(const char 
>>> *arg)
>>>   
>>>   unsigned int __read_mostly opt_gnttab_max_version = GNTTAB_MAX_VERSION;
>>>   static bool __read_mostly opt_transitive_grants = true;
>>> +static bool __read_mostly opt_grant_transfer = true;
>>
>> If this was conditional upon PV (with a #define to false in the
>> opposite case), it could be __ro_after_init right away, while at
>> the same time allowing the compiler to eliminate gnttab_transfer().
> 
> Nice idea. The other option would be to put all (or most) of
> gnttab_transfer() in a "#ifdef CONFIG_PV" section, allowing to
> remove the "#ifdef CONFIG_X86" parts in it, too.

Yes, sure. The downside being that then this code won't be compile-
tested anymore in !PV builds. Yet keeping code visible to compilers
is what we aim for elsewhere by preferring if(IS_ENABLED(...)) over
#ifdef where possible.

Jan




 


Rackspace

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