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=-6.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 2FC83C433E0 for ; Thu, 28 Jan 2021 12:45:49 +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 CE6B164DDF for ; Thu, 28 Jan 2021 12:45:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE6B164DDF 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.76988.139198 (Exim 4.92) (envelope-from ) id 1l56g5-0002Rq-Rt; Thu, 28 Jan 2021 12:45:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76988.139198; Thu, 28 Jan 2021 12:45:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l56g5-0002Rj-P0; Thu, 28 Jan 2021 12:45:37 +0000 Received: by outflank-mailman (input) for mailman id 76988; Thu, 28 Jan 2021 12:45:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l56g4-0002Re-Dx for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 12:45:36 +0000 Received: from mail-wm1-x332.google.com (unknown [2a00:1450:4864:20::332]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1b289c31-15be-418e-a191-cc1cee2c06ef; Thu, 28 Jan 2021 12:45:35 +0000 (UTC) Received: by mail-wm1-x332.google.com with SMTP id m2so4204595wmm.1 for ; Thu, 28 Jan 2021 04:45:35 -0800 (PST) Received: from CBGR90WXYV0 ([2a00:23c5:5785:9a01:ad9a:ab78:5748:a7ec]) by smtp.gmail.com with ESMTPSA id 17sm5604203wmk.48.2021.01.28.04.45.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 04:45:34 -0800 (PST) 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" X-Inumbo-ID: 1b289c31-15be-418e-a191-cc1cee2c06ef DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=5HZmOnhuwAj2v4zjq2s472s3S/ZmtFf7k2VzcL5KLLM=; b=Qms3RaHi+DvRsyyVaA/lNb2x+IrecvIp5CtMyJpm7xAOAi/8NAtORBAhvmx11wzXLv 0ouZxQpC9uYV5vW6X67XvMSkWR/ggSVLhOm27PP7UxfwsAQTGPOmA2yNmcHiDjFfWwss eBEfdEs4UCGEYBj82nVFBnqdavV6VSzc4oYc4xtQ2uMzZWTLO8MOY69WXej1GhK31y0j DPMjvHpFWGo7sMsAzKDn/JiZTGTQq4UF7cddWbIBL8wqCgmfSVmShpz7EyblfUO/9Z6s yPyPVwgNVDTnn4VELCA27skTX4hjgKumiXQG9o1lRxV0QGqfaB6y8ZvtyXntR6ssvRNn 5z0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to :subject:date:message-id:mime-version:content-transfer-encoding :thread-index:content-language; bh=5HZmOnhuwAj2v4zjq2s472s3S/ZmtFf7k2VzcL5KLLM=; b=DYy61i9qn9yEkAbdTYqDr/9/Z9yT9B3dkvP1kmX62hQwbo7UdaKFcBGFQ/AFVOOQQR xAFTb7IEslwK3V5seLZaehtlHXczyBTvnCz+qrY7kOK15fFbj9vB+KzzENGbJJf+Fnba ifwNffTXqxVari4fMP8xdb16DEW97+TDC5/QpME9MP4w5JAZVeV7/als/OOAXYdnGWLI bMWXK85txDqVnfogDQS5QnLog+4QvK4L4XhdstnPRnF0VkTuD2Xg4eocr/AzAmBAw81v +NbzX0B0M8O3j4HqPTWoZ7XJBUOP155jpG9ZRrTlg8IHmWFK38wvyXrgLkY6P50XHQYL i4uA== X-Gm-Message-State: AOAM5312hhb7l+7n6V+XvqkngGG6/pxaNj5VMy9+RwdkK+PE8nmI2ImK vBPvOPq/CxdJJcIZQBpY0GE= X-Google-Smtp-Source: ABdhPJygj28s4pfoQGpSH5eZqlVdE6ngPXXE0+aDXsnRk8MZgUwIBGcqrIXjj28iGOSOXrpaDMpHCQ== X-Received: by 2002:a1c:3882:: with SMTP id f124mr8508548wma.56.1611837934699; Thu, 28 Jan 2021 04:45:34 -0800 (PST) From: Paul Durrant X-Google-Original-From: "Paul Durrant" Reply-To: To: "'Andrew Cooper'" , "'Xen-devel'" Cc: "'Wei Liu'" , =?utf-8?Q?'Roger_Pau_Monn=C3=A9'?= , "'Juergen Gross'" , "'Ian Jackson'" , =?utf-8?Q?'Micha=C5=82_Leszczy=C5=84ski'?= , "'Hubert Jasudowicz'" , "'Tamas K Lengyel'" , "'Manuel Bouyer'" References: <20210128120152.9908-1-andrew.cooper3@citrix.com> In-Reply-To: <20210128120152.9908-1-andrew.cooper3@citrix.com> Subject: RE: [PATCH v4] tools/foreignmem: Support querying the size of a resource Date: Thu, 28 Jan 2021 12:45:33 -0000 Message-ID: <029301d6f573$783c9a10$68b5ce30$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGhwFBtvDP1/NOJjC1fTcVPiTmZCaqnZhkg Content-Language: en-gb > -----Original Message----- > From: Andrew Cooper > Sent: 28 January 2021 12:02 > To: Xen-devel > Cc: Andrew Cooper ; Wei Liu ; = Paul Durrant ; > Roger Pau Monn=C3=A9 ; Juergen Gross = ; Ian Jackson > ; Micha=C5=82 Leszczy=C5=84ski = ; Hubert Jasudowicz > ; Tamas K Lengyel ; = Manuel Bouyer > Subject: [PATCH v4] tools/foreignmem: Support querying the size of a = resource >=20 > With the Xen side of this interface (soon to be) fixed to return real = sizes, > userspace needs to be able to make the query. >=20 > Introduce xenforeignmemory_resource_size() for the purpose, bumping = the > library minor version. >=20 > Update both all osdep_xenforeignmemory_map_resource() implementations = to > understand size requests, skip the mmap() operation, and copy back the > nr_frames field. >=20 > For NetBSD, also fix up the ioctl() error path to issue an unmap(), = which was > overlooked by c/s 4a64e2bb39 "libs/foreignmemory: Implement on = NetBSD". >=20 > Signed-off-by: Andrew Cooper > Reviewed-by: Roger Pau Monn=C3=A9 Reviewed-by: Paul Durrant