From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26984C55ABD for ; Fri, 13 Nov 2020 15:00:50 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C750321D79 for ; Fri, 13 Nov 2020 15:00:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Gyby1GHr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C750321D79 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.26606.55089 (Exim 4.92) (envelope-from ) id 1kdaYr-0005Y9-6u; Fri, 13 Nov 2020 15:00:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 26606.55089; Fri, 13 Nov 2020 15:00:25 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kdaYr-0005Y2-3r; Fri, 13 Nov 2020 15:00:25 +0000 Received: by outflank-mailman (input) for mailman id 26606; Fri, 13 Nov 2020 15:00:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kdaYp-0005Xw-7x for xen-devel@lists.xenproject.org; Fri, 13 Nov 2020 15:00:23 +0000 Received: from mail-lj1-x241.google.com (unknown [2a00:1450:4864:20::241]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4f096ea6-2334-43cb-830f-2ed39f2b7599; Fri, 13 Nov 2020 15:00:22 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id w15so5801773lji.10 for ; Fri, 13 Nov 2020 07:00:22 -0800 (PST) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id 14sm1246833lff.100.2020.11.13.07.00.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Nov 2020 07:00:20 -0800 (PST) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kdaYp-0005Xw-7x for xen-devel@lists.xenproject.org; Fri, 13 Nov 2020 15:00:23 +0000 X-Inumbo-ID: 4f096ea6-2334-43cb-830f-2ed39f2b7599 Received: from mail-lj1-x241.google.com (unknown [2a00:1450:4864:20::241]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4f096ea6-2334-43cb-830f-2ed39f2b7599; Fri, 13 Nov 2020 15:00:22 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id w15so5801773lji.10 for ; Fri, 13 Nov 2020 07:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=loEGtmzCg7gfnYlPzkZrXi5KoXBJgTXmL7oE5EG4OW0=; b=Gyby1GHrg4L7BUCH09x71JpNR4Mx1lTa9CXoNROpQGUkUzw6Xdntx+2Bbc8YboQsS5 7X4w48hhghH+5tz5l/k5F2Qt47A8eaeZeS82o93XzXHVvraxFuIILbYFSh+0Q9+s4r8z HmD3eNeTGs+LDGHldJkgUdIvKZJARSqXI6l9QOqVpuVcrLxE9KrR/6RHzVlNzkmfTKm0 X1ceTGe1RU82+mSd9es3qRNHNBs/3TP3WvitTSQ93MiRY3YES66SRbVr34QPD2R6e32z 7YnLHzdm/qT+M5q/0r5L/PVSr4Br6n1ms58D+OIbhhVOb38ea8q+2iHb6QF1lnOSBqgQ 8J8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=loEGtmzCg7gfnYlPzkZrXi5KoXBJgTXmL7oE5EG4OW0=; b=sD20Fr/iCR5rUTzVoF7y0zDjYBMY4WHmBZIPRWXgFWWJVKR4JgILQDyd+E7cRcEbzC 16DRq2VElzBjMCOiFhx3c/YuJFRqNLIJqcrTiuEj8ddl/yL3vkXAytOSHDo8rrPHDKyK 87l8cPONh9gjyAYworeafJxhWL0B/p8CWD0nV2+0e/hT4gFMiFsyPKI/vUM1UHkN3xT+ 3Flawi77HmbXr4fWvlxhBj7OF4p4npY3qXfbN+idkVgr3C6TbBzg1q5XOHw0Lg+4CoZ3 sESpKMW0BAYdvqoR6kAj3oGxRMfAGNg9yX8BbdEfZar7e8JQehlY4U5LiKJg5xCnuL29 f/Hw== X-Gm-Message-State: AOAM531ueFwy1fpRmdufhDJQ3mbbcqorpPKHenDYbmKMMvOk+20YZWTc CXj3wBr4aabjHt/VpOPPK57fY7NIAOPmNQ== X-Google-Smtp-Source: ABdhPJwQGesHAq9CUQY/Gpht6f6saslE5JXR9mjEPZDITFp7JDlfyGQ4n9SXNm9t0oPuJmN9/DOtuQ== X-Received: by 2002:a2e:7a0a:: with SMTP id v10mr1304331ljc.5.1605279620956; Fri, 13 Nov 2020 07:00:20 -0800 (PST) Received: from [192.168.1.7] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id 14sm1246833lff.100.2020.11.13.07.00.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Nov 2020 07:00:20 -0800 (PST) Subject: Re: [PATCH V2 10/23] xen/mm: Make x86's XENMEM_resource_ioreq_server handling common To: Jan Beulich Cc: Julien Grall , Andrew Cooper , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Wei Liu , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Volodymyr Babchuk , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org References: <1602780274-29141-1-git-send-email-olekstysh@gmail.com> <1602780274-29141-11-git-send-email-olekstysh@gmail.com> <1c9bc1aa-b622-fb8e-e5d5-3e27567354c0@suse.com> From: Oleksandr Message-ID: <2be2f73e-dfcd-f856-cfe1-85e41538bd15@gmail.com> Date: Fri, 13 Nov 2020 17:00:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1c9bc1aa-b622-fb8e-e5d5-3e27567354c0@suse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US On 12.11.20 13:40, Jan Beulich wrote: Hi Jan > On 15.10.2020 18:44, Oleksandr Tyshchenko wrote: >> --- a/xen/common/memory.c >> +++ b/xen/common/memory.c >> @@ -30,6 +30,10 @@ >> #include >> #include >> >> +#ifdef CONFIG_IOREQ_SERVER >> +#include >> +#endif > Preferably #ifdef-s would not be needed here. If any, they'd better > live in xen/ioreq.h itself then. ok > >> @@ -1045,6 +1049,38 @@ static int acquire_grant_table(struct domain *d, unsigned int id, >> return 0; >> } >> >> +#ifdef CONFIG_IOREQ_SERVER > To limit the number of #ifdef-s, could this be moved ... > >> +static int acquire_ioreq_server(struct domain *d, >> + unsigned int id, >> + unsigned long frame, >> + unsigned int nr_frames, >> + xen_pfn_t mfn_list[]) >> +{ > ... here such that ... > >> @@ -1103,9 +1139,14 @@ static int acquire_resource( >> mfn_list); >> break; >> >> +#ifdef CONFIG_IOREQ_SERVER >> + case XENMEM_resource_ioreq_server: >> + rc = acquire_ioreq_server(d, xmar.id, xmar.frame, xmar.nr_frames, >> + mfn_list); >> + break; >> +#endif > ... the ones here then can be dropped? I think yes, that would be better. > >> default: > Also you'll want to a blank line between the new case statement and > the "default:". ok -- Regards, Oleksandr Tyshchenko