Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp45622imm; Tue, 12 Jun 2018 18:10:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK+regFX5zLe7iAWIzwzL4ob0Nzupd+jwQFjaMfFJwp7vcKMQPZo8BVybu/rLBCzLhR4zzB X-Received: by 2002:a17:902:bd95:: with SMTP id q21-v6mr2780419pls.237.1528852211415; Tue, 12 Jun 2018 18:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528852211; cv=none; d=google.com; s=arc-20160816; b=rFOmlx55WFjM3CJ9ijoUrvPJWr3dGCAc7z8DUbmcOwc8YFz5vkA4OSCsw8rShWVQyL Ka9bSTc0va937ZrJaP07LNq17CU+E6zB52Rc3O7HbxgPXBeJXH4Ot8mM00/fjGKzvHBw lWrTpbIrMB8sd1qiOKe6LTIyRjRCEJhoMAjeGIiGTc9V0QKqITSgrMqejjjvRsZbGCSm syoZJZp1R+T44oJ9vwy0wDONYWnTrS8JsMCddoB9jGXwRfWdBsksvVd+2quFkL3S9FeI stzStj3erFfVmzeYrbjN8vApghTir3YgSEXD5hK16y87UObcIESOitiqeNl4kO3nDzYw Kxcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=O5iB7Aprjifud8uNCkKZxA7YdMfp8ogwznxDszLTQYA=; b=lcHFqtCmD12YmnvhSbqF4RgFh1WlT5oFrMOEfUJUoi4Z94Bo0rWTdT0XdTESN064bM B9fXiL6acHYe+jjRvMk6Q4lVmnCBj+vLjwilQuZnpw7Ei3vrEP1NVloKre1ZcvHG9Y+X u5yaVC71d3Y4/AwuXiEHMipimAemTm95Mu5jeopy56FCU9R8fCLuZLrw95o6N3q/Y33h yIHglVQ5IrMzJdkHtcy1dv9w9QDc81p6Z3T97QgmJgKVRnsofd9BaLfvXBzbzE4CrOfQ UGPtofzreZNhgal0mnyAImwjyDXRWi7xquUbXGlu3ES836uFCVtbKBHPQilyMkTjFHK8 eHcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=JdGKYrwd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v73-v6si1430496pfi.22.2018.06.12.18.09.56; Tue, 12 Jun 2018 18:10:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=JdGKYrwd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935085AbeFMBIP (ORCPT + 99 others); Tue, 12 Jun 2018 21:08:15 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:39698 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933390AbeFMBIN (ORCPT ); Tue, 12 Jun 2018 21:08:13 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5D16cJW098452; Wed, 13 Jun 2018 01:08:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=O5iB7Aprjifud8uNCkKZxA7YdMfp8ogwznxDszLTQYA=; b=JdGKYrwdj7ypewBJIuPc+3U54JExZfCZ9Px1pOA4htOrQMsMLP9wLXrYT0nTfWGG2PEB RR8Td0POCifZ+uTaEVuN+F7cjho9nRO8DI0CVaTVfONt7cex344Pg9eGa6MIlnZJu2Zp vmbNsBvV2mM0VMNXYlqvlXfs0zafX9Hqn4EPAulU2R3yFIMOEB0uSpB+d686gqM3YFuS j+hOq45i716+QMT1kLvJ2wyoa5XGlTIt0TkMlOFPxLPoyxK1r0DRYHMDbB+N5pjw5ZPq 4z2RHQ5GppKJt9h54BFSE0rC8kgisvqvqj3hmdFBVhtsKnojpJ5qeMoO+FaJOT+VzYgy mA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2jjp6c8bq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 01:08:02 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w5D1820S013927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 01:08:02 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5D181V5005320; Wed, 13 Jun 2018 01:08:01 GMT Received: from [10.154.144.7] (/10.154.144.7) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 12 Jun 2018 18:08:01 -0700 Subject: Re: [PATCH v3 3/9] xen/balloon: Share common memory reservation routines To: Oleksandr Andrushchenko , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, jgross@suse.com, konrad.wilk@oracle.com Cc: daniel.vetter@intel.com, dongwon.kim@intel.com, matthew.d.roper@intel.com, Oleksandr Andrushchenko References: <20180612134200.17456-1-andr2000@gmail.com> <20180612134200.17456-4-andr2000@gmail.com> From: Boris Ostrovsky Message-ID: <124f3832-63b4-021d-0c6f-470229c7a056@oracle.com> Date: Tue, 12 Jun 2018 21:07:59 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180612134200.17456-4-andr2000@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8922 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=525 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806130011 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: One more thing: please add a comment here saying that frames array is array of PFNs (in Xen granularity), which is what XENMEM_populate_physmap requires. And remove (or update to name the actual call you are making) the corresponding comment in increase_reservation(). > + > +int xenmem_reservation_increase(int count, xen_pfn_t *frames) > +{ > + struct xen_memory_reservation reservation = { > + .address_bits = 0, > + .extent_order = EXTENT_ORDER, > + .domid = DOMID_SELF > + }; > + > + set_xen_guest_handle(reservation.extent_start, frames); > + reservation.nr_extents = count; > + return HYPERVISOR_memory_op(XENMEM_populate_physmap, &reservation); > +} > +EXPORT_SYMBOL_GPL(xenmem_reservation_increase); And similarly, here we are requesting GFNs, and update decrease_reservation(). -boris > + > +int xenmem_reservation_decrease(int count, xen_pfn_t *frames) > +{ > + struct xen_memory_reservation reservation = { > + .address_bits = 0, > + .extent_order = EXTENT_ORDER, > + .domid = DOMID_SELF > + }; > + > + set_xen_guest_handle(reservation.extent_start, frames); > + reservation.nr_extents = count; > + return HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);