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=-9.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 20FFCC433DF for ; Tue, 28 Jul 2020 14:12:14 +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 CFF8D206F5 for ; Tue, 28 Jul 2020 14:12:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="bRXACsoS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFF8D206F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k0QKf-0003k6-PO; Tue, 28 Jul 2020 14:11:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k0QKe-0003k1-MB for xen-devel@lists.xenproject.org; Tue, 28 Jul 2020 14:11:52 +0000 X-Inumbo-ID: 471bd2f6-d0dc-11ea-a8f3-12813bfff9fa Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 471bd2f6-d0dc-11ea-a8f3-12813bfff9fa; Tue, 28 Jul 2020 14:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1595945511; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=OuE3A6MRBokKKxndisn6x3i03m4uvfO/NGVkQ2H3vfQ=; b=bRXACsoSsHzX1CpOYQFb1ktdQ4MKi7BXJFRcxEsX5ALZdPCSI/J2ksGw SqBnX2PG9SzwklqZRhyi+5byw2WNBjP6o7j9nH5naDHYlN5uySc/WhM80 IQDCWF2P/VlNmTucYuer+0lbMU189duo/lO+RflPPqkB0NLOH0I0e+Crp I=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: +hG5mCBM1DMxBIpktzqQNzNiw+hwmS4q2Geb/9+dpT9L5KGCEc0MHMF4is4iSgH08uHAa2wq3l yKki94fH2rcrBhzrMUdwJfqDXJTCZNclEllFdUIqkGdlsUCFyMyZmYIIC0yKb7zzZYNK03YC3k n7huPsPxnBO0B8ZbKtRbAqj+gKpQHMu4Zk/Y451mUu+D4qdA91mg8nSloWj9BLl37qzO/13srY S+Vr1ZKGVArYfyTPdUzullG+ehyUSYAMIVidewPG6K6jOzUy3Eh1kUXFLzOgwZm96J9iemX+AX 6Ek= X-SBRS: 2.7 X-MesageID: 23345124 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,406,1589256000"; d="scan'208";a="23345124" Subject: Re: [PATCH 2/5] xen/gnttab: Rework resource acquisition To: Xen-devel References: <20200728113712.22966-1-andrew.cooper3@citrix.com> <20200728113712.22966-3-andrew.cooper3@citrix.com> From: Andrew Cooper Message-ID: Date: Tue, 28 Jul 2020 15:11:20 +0100 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: <20200728113712.22966-3-andrew.cooper3@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Hubert Jasudowicz , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Paul Durrant , Jan Beulich , =?UTF-8?Q?Micha=c5=82_Leszczy=c5=84ski?= , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 28/07/2020 12:37, Andrew Cooper wrote: > diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c > index 9f0cae52c0..122d1e7596 100644 > --- a/xen/common/grant_table.c > +++ b/xen/common/grant_table.c > @@ -4013,6 +4013,72 @@ static int gnttab_get_shared_frame_mfn(struct domain *d, > return 0; > } > > +int gnttab_acquire_resource( > + struct domain *d, unsigned int id, unsigned long frame, > + unsigned int nr_frames, xen_pfn_t mfn_list[]) > +{ > + struct grant_table *gt = d->grant_table; > + unsigned int i = nr_frames, tot_frames; > + void **vaddrs; I've folded an "= NULL" here to fix the CentOS 6 build. ~Andrew