Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp28503imm; Tue, 12 Jun 2018 17:49:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ1b7GVtqaOobXE15GexM5MTawe0rQ3FT5v2qErtLdj8jlapmYm0h7suT5+JEpA9ZQTgybV X-Received: by 2002:a63:7d4c:: with SMTP id m12-v6mr2123572pgn.201.1528850943370; Tue, 12 Jun 2018 17:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528850943; cv=none; d=google.com; s=arc-20160816; b=lRTa8X6TVu+NpmT5+NymDc1CDTU4TVoI/YMCja76D3XyckdRE6PX0fasqFTw3bMk5h RUiPldBnSDeCYcECpv1CuQt83LYm7gT7bEQH0HR9ZJ1Oj2kzyr57WD7nlVV3Ye6TLM5t XyQ4MhptpVIdiShHa7qukD2dIuov59eEqoGiYV8DCBp0KIQYf2tVyRw9Z0hHG7Cm8yK8 2CgNBsWgZhS1DCpV/JAGdwrwZmuOMCMuMsOWlWDIIdbZZfcOb91RjkbW/QBoB9A3DJMb so+gWKX6age6lGP5RNATc8BvOonAKOx+6B/plhIbG3lScDoRvFUSdwXFGM5NRSyRUJJc ZQmQ== 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=1o2y63mJoa4ibguG3jofqWmIG73zvUVZORdrK+eyzm8=; b=OcGLM5VRJ8Zmzq5vL2WywFn7Igr1Stsqb8mTaJAtf4sdaHdZrAqFRnRWG9/gyjvq/x kEwkf4rggxyuAm+yKRxFTToSsdeEXljbJmc1y59cYLA68dKmOstVlw5Hz7H7p/4/ALce TavU1INZoVx0xR0sJlnZBUqwK3/1siOG+Xoutc3WH1/XbKqjMQl84gUECk0vfJq/hJi9 JJL0ahzh7BxN6MLdRRAljgPVCskcQIKteLqQOxdgtNkJQdtyrj/hkaXAYSl8SUnaSZpF wyF4fWw9nJZa6ANBmmZa2GsaQ6ZtczDnZmEecflzg96LYoRWeqNki2J5GC7Pgwo9y3jL XbVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=tYh7sMby; 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 n9-v6si1137544pgf.497.2018.06.12.17.48.37; Tue, 12 Jun 2018 17:49:03 -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=tYh7sMby; 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 S934971AbeFMAr5 (ORCPT + 99 others); Tue, 12 Jun 2018 20:47:57 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:58270 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934897AbeFMArz (ORCPT ); Tue, 12 Jun 2018 20:47:55 -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 w5D0kvhZ087588; Wed, 13 Jun 2018 00:47:42 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=1o2y63mJoa4ibguG3jofqWmIG73zvUVZORdrK+eyzm8=; b=tYh7sMbyDynidOQmy5J1+GBmL6OApqMK9rswo6mL6SIeS0YgaQnBZaY4NSWrZuLcVJyL nt67OGGBmuoukrtZqxnJ3k43HY+pDWTAcGUlU+ggEZoJOtItXwMjl0tNjj1FKZJ1X0To v3iDec24bYg6E0Iug5HaY+udMDCw55l2YjTTUFE1XOEafgCuCE98Q/shoGMsDpCBPdyw +s6DiZClcWYKYA2zMoJPlMzG7lvr9fGE85aNKKsyOpcRTICTflzUu4sgnWwYG/nyBFhL gJe/M5EMcSXUIYCRqshUr82q82s9+/9w1KyfGe0WrNYp7wcp/GUdRfy40A/zJAVOhPUv 1A== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2jjp6c8aqa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 00:47:42 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w5D0lf7p030045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 00:47:41 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5D0lduB020813; Wed, 13 Jun 2018 00:47:40 GMT Received: from [10.154.144.7] (/10.154.144.7) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 12 Jun 2018 17:47:39 -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: Date: Tue, 12 Jun 2018 20:47:37 -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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806130007 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: > From: Oleksandr Andrushchenko > diff --git a/include/xen/mem-reservation.h b/include/xen/mem-reservation.h > new file mode 100644 > index 000000000000..e0939387278d > --- /dev/null > +++ b/include/xen/mem-reservation.h > @@ -0,0 +1,64 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > + > +/* > + * Xen memory reservation utilities. > + * > + * Copyright (c) 2003, B Dragovic > + * Copyright (c) 2003-2004, M Williamson, K Fraser > + * Copyright (c) 2005 Dan M. Smith, IBM Corporation > + * Copyright (c) 2010 Daniel Kiper > + * Copyright (c) 2018 Oleksandr Andrushchenko, EPAM Systems Inc. > + */ > + > +#ifndef _XENMEM_RESERVATION_H > +#define _XENMEM_RESERVATION_H > + > +#include > +#include > + > +#include > +#include > + > +#include > +#include I should have noticed this in the previous post but I suspect most of these includes belong in the C file. For example, there is no reason for hypercall.h here. -boris > + > +static inline void xenmem_reservation_scrub_page(struct page *page) > +{ > +#ifdef CONFIG_XEN_SCRUB_PAGES > + clear_highpage(page); > +#endif > +} > + > +#ifdef CONFIG_XEN_HAVE_PVMMU > +void __xenmem_reservation_va_mapping_update(unsigned long count, > + struct page **pages, > + xen_pfn_t *frames); > + > +void __xenmem_reservation_va_mapping_reset(unsigned long count, > + struct page **pages); > +#endif > + > +static inline void xenmem_reservation_va_mapping_update(unsigned long count, > + struct page **pages, > + xen_pfn_t *frames) > +{ > +#ifdef CONFIG_XEN_HAVE_PVMMU > + if (!xen_feature(XENFEAT_auto_translated_physmap)) > + __xenmem_reservation_va_mapping_update(count, pages, frames); > +#endif > +} > + > +static inline void xenmem_reservation_va_mapping_reset(unsigned long count, > + struct page **pages) > +{ > +#ifdef CONFIG_XEN_HAVE_PVMMU > + if (!xen_feature(XENFEAT_auto_translated_physmap)) > + __xenmem_reservation_va_mapping_reset(count, pages); > +#endif > +} > + > +int xenmem_reservation_increase(int count, xen_pfn_t *frames); > + > +int xenmem_reservation_decrease(int count, xen_pfn_t *frames); > + > +#endif >