From nobody Fri Nov 29 14:40:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1635517368; cv=none; d=zohomail.com; s=zohoarc; b=Akbum/nAuXIrs2wwvSXNZgywLuRoet/vRoz20bYk9z04VnWFduiG9vpXbn/sD+39IK/k4wlscN+yxHdnAZu35I2qFrb+c2PUz2uSQgM79yFPBvmFoYDT4oMVbahUQ1McSudiE8nA7itEY87FwLew5jiNswPxeeO7cjV4K4PfykA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635517368; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=b3hbVsW/qd4JlhNtySvVHNwOWfFRRa/WfskrRS8x0kU=; b=eQ04O/aLPvJkN/KSw3B996gZXKKpepB6ldN93jjNKIZmhDjz3+9fyfn0yxNEWiHlnt4+rw+ITfKu12ASZAof/cz9X8wmEEq+X6BkszMQ/2f0/GacMcsJcKWi+wqA8nJG9bkZTBT2gxgkwseKABjAR0xUt7SGwi8YAeqvHqm+Hlw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1635517368073433.60479500011456; Fri, 29 Oct 2021 07:22:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.218570.379067 (Exim 4.92) (envelope-from ) id 1mgSm2-0003C9-Gs; Fri, 29 Oct 2021 14:22:26 +0000 Received: by outflank-mailman (output) from mailman id 218570.379067; Fri, 29 Oct 2021 14:22:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mgSm2-0003C2-Bu; Fri, 29 Oct 2021 14:22:26 +0000 Received: by outflank-mailman (input) for mailman id 218570; Fri, 29 Oct 2021 14:22:25 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mgSm1-0003Bw-HO for xen-devel@lists.xenproject.org; Fri, 29 Oct 2021 14:22:25 +0000 Received: from smtp-out1.suse.de (unknown [195.135.220.28]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 667d7d82-8cd8-41f8-9aaa-3d3b14c5670c; Fri, 29 Oct 2021 14:22:24 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 669F221968; Fri, 29 Oct 2021 14:22:23 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3C28F13F6F; Fri, 29 Oct 2021 14:22:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id S0YmDZ8DfGECNAAAMHmgww (envelope-from ); Fri, 29 Oct 2021 14:22:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 667d7d82-8cd8-41f8-9aaa-3d3b14c5670c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1635517343; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=b3hbVsW/qd4JlhNtySvVHNwOWfFRRa/WfskrRS8x0kU=; b=Q/TsdwhKvafsw3XIx0DN0WD1Emzd6dtaD7TcSz5Q+GEs1/TZufUMxi4MHAYThNeTCVkEPX LHjHIkWcaSgKoh2hs4j5xohjeUX8Ee1utuCPb6sblhMkolS3iYlk99xfIOR0e6d897yE0x yjsq0I3BMcfLcFPgcASRNhzBGS7HjKI= From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH] xen/balloon: rename alloc/free_xenballooned_pages Date: Fri, 29 Oct 2021 16:22:19 +0200 Message-Id: <20211029142219.25357-1-jgross@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1635517369172100001 Content-Type: text/plain; charset="utf-8" alloc_xenballooned_pages() and free_xenballooned_pages() are used as direct replacements of xen_alloc_unpopulated_pages() and xen_free_unpopulated_pages() in case CONFIG_XEN_UNPOPULATED_ALLOC isn't defined. Guard both functions with !CONFIG_XEN_UNPOPULATED_ALLOC and rename them to the xen_*() variants they are replacing. This allows to remove some ifdeffery from the xen.h header file. Signed-off-by: Juergen Gross Reported-by: kernel test robot --- drivers/xen/balloon.c | 18 ++++++++++-------- include/xen/balloon.h | 3 --- include/xen/xen.h | 6 ------ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 98fae43d4cec..35fac7fb513a 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -575,6 +575,7 @@ void balloon_set_new_target(unsigned long target) } EXPORT_SYMBOL_GPL(balloon_set_new_target); =20 +#ifndef CONFIG_XEN_UNPOPULATED_ALLOC static int add_ballooned_pages(int nr_pages) { enum bp_state st; @@ -603,12 +604,12 @@ static int add_ballooned_pages(int nr_pages) } =20 /** - * alloc_xenballooned_pages - get pages that have been ballooned out + * xen_alloc_unpopulated_pages - get pages that have been ballooned out * @nr_pages: Number of pages to get * @pages: pages returned * @return 0 on success, error otherwise */ -int alloc_xenballooned_pages(int nr_pages, struct page **pages) +int xen_alloc_unpopulated_pages(int nr_pages, struct page **pages) { int pgno =3D 0; struct page *page; @@ -645,7 +646,7 @@ int alloc_xenballooned_pages(int nr_pages, struct page = **pages) return 0; out_undo: mutex_unlock(&balloon_mutex); - free_xenballooned_pages(pgno, pages); + xen_free_unpopulated_pages(pgno, pages); /* * NB: free_xenballooned_pages will only subtract pgno pages, but since * target_unpopulated is incremented with nr_pages at the start we need @@ -654,14 +655,14 @@ int alloc_xenballooned_pages(int nr_pages, struct pag= e **pages) balloon_stats.target_unpopulated -=3D nr_pages - pgno; return ret; } -EXPORT_SYMBOL(alloc_xenballooned_pages); +EXPORT_SYMBOL(xen_alloc_unpopulated_pages); =20 /** - * free_xenballooned_pages - return pages retrieved with get_ballooned_pag= es + * xen_free_unpopulated_pages - return pages retrieved with get_ballooned_= pages * @nr_pages: Number of pages * @pages: pages to return */ -void free_xenballooned_pages(int nr_pages, struct page **pages) +void xen_free_unpopulated_pages(int nr_pages, struct page **pages) { int i; =20 @@ -680,9 +681,9 @@ void free_xenballooned_pages(int nr_pages, struct page = **pages) =20 mutex_unlock(&balloon_mutex); } -EXPORT_SYMBOL(free_xenballooned_pages); +EXPORT_SYMBOL(xen_free_unpopulated_pages); =20 -#if defined(CONFIG_XEN_PV) && !defined(CONFIG_XEN_UNPOPULATED_ALLOC) +#if defined(CONFIG_XEN_PV) static void __init balloon_add_region(unsigned long start_pfn, unsigned long pages) { @@ -705,6 +706,7 @@ static void __init balloon_add_region(unsigned long sta= rt_pfn, balloon_stats.total_pages +=3D extra_pfn_end - start_pfn; } #endif +#endif =20 static int __init balloon_init(void) { diff --git a/include/xen/balloon.h b/include/xen/balloon.h index 95a4187f263b..d6ee920fafa4 100644 --- a/include/xen/balloon.h +++ b/include/xen/balloon.h @@ -27,9 +27,6 @@ extern struct balloon_stats balloon_stats; =20 void balloon_set_new_target(unsigned long target); =20 -int alloc_xenballooned_pages(int nr_pages, struct page **pages); -void free_xenballooned_pages(int nr_pages, struct page **pages); - #ifdef CONFIG_XEN_BALLOON void xen_balloon_init(void); #else diff --git a/include/xen/xen.h b/include/xen/xen.h index 43efba045acc..9f031b5faa54 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -52,13 +52,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec= 1, extern u64 xen_saved_max_mem_size; #endif =20 -#ifdef CONFIG_XEN_UNPOPULATED_ALLOC int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages= ); void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages= ); -#else -#define xen_alloc_unpopulated_pages alloc_xenballooned_pages -#define xen_free_unpopulated_pages free_xenballooned_pages -#include -#endif =20 #endif /* _XEN_XEN_H */ --=20 2.26.2