From patchwork Fri Jan 24 15:31:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11350593 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1EE82924 for ; Fri, 24 Jan 2020 15:32:57 +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 EF1CC20838 for ; Fri, 24 Jan 2020 15:32:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="MwhCW9AN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF1CC20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none 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.89) (envelope-from ) id 1iv0wD-00074d-B7; Fri, 24 Jan 2020 15:32:01 +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.89) (envelope-from ) id 1iv0wB-00073l-OA for xen-devel@lists.xenproject.org; Fri, 24 Jan 2020 15:31:59 +0000 X-Inumbo-ID: a5a1f8bb-3ebe-11ea-8032-12813bfff9fa Received: from smtp-fw-33001.amazon.com (unknown [207.171.190.10]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a5a1f8bb-3ebe-11ea-8032-12813bfff9fa; Fri, 24 Jan 2020 15:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1579879915; x=1611415915; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ahbKDvUHG0beABwkwLlarH9Not4uFWdN3xL+SF4P2bA=; b=MwhCW9ANh6wiqHMD/7U2H4t1JY9rXausShm4hiZ442GQWjUiSaUtyl1Q C47LMIS3+USqmRal+X53ADxVzTPO6PDorHmENLPiepgn2PNBmTm3Ib0ZE dVD2I0rKOMuLjGk3jF0oosKbUxVEAutODdfg9LjUzJyOKsWA3I7nEkCJk E=; IronPort-SDR: nkR1m4H4lo/gvQus4d4RLEEkCjsqV+LyHkJy3QouOoHEZZU+yrAa47EZf/q69y/qEc+OpuWEV9 NnnM0UMJFpVA== X-IronPort-AV: E=Sophos;i="5.70,358,1574121600"; d="scan'208";a="22196949" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-baacba05.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 24 Jan 2020 15:31:44 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-baacba05.us-west-2.amazon.com (Postfix) with ESMTPS id 08678A21B6; Fri, 24 Jan 2020 15:31:42 +0000 (UTC) Received: from EX13D32EUB002.ant.amazon.com (10.43.166.114) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 24 Jan 2020 15:31:32 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D32EUB002.ant.amazon.com (10.43.166.114) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 24 Jan 2020 15:31:30 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 24 Jan 2020 15:31:27 +0000 From: Paul Durrant To: Date: Fri, 24 Jan 2020 15:31:03 +0000 Message-ID: <20200124153103.18321-8-pdurrant@amazon.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200124153103.18321-1-pdurrant@amazon.com> References: <20200124153103.18321-1-pdurrant@amazon.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v4 7/7] mm: remove donate_page() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Paul Durrant , Ian Jackson , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This function appears to have no callers. Signed-off-by: Paul Durrant Acked-by: George Dunlap Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Volodymyr Babchuk Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Wei Liu Cc: "Roger Pau Monné" v4: - New in v4 --- xen/arch/arm/mm.c | 6 ------ xen/arch/x86/mm.c | 41 ----------------------------------------- xen/include/xen/mm.h | 2 -- 3 files changed, 49 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 4d6c971f37..727107eefa 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1353,12 +1353,6 @@ void arch_dump_shared_mem_info(void) { } -int donate_page(struct domain *d, struct page_info *page, unsigned int memflags) -{ - ASSERT_UNREACHABLE(); - return -ENOSYS; -} - int steal_page( struct domain *d, struct page_info *page, unsigned int memflags) { diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 2a6d2e8af9..67351798c7 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4174,47 +4174,6 @@ long do_mmu_update( } #endif /* CONFIG_PV */ -int donate_page( - struct domain *d, struct page_info *page, unsigned int memflags) -{ - const struct domain *owner = dom_xen; - - spin_lock(&d->page_alloc_lock); - - if ( is_xen_heap_page(page) || ((owner = page_get_owner(page)) != NULL) ) - goto fail; - - if ( d->is_dying ) - goto fail; - - if ( page->count_info & ~(PGC_allocated | 1) ) - goto fail; - - if ( !(memflags & MEMF_no_refcount) ) - { - if ( d->tot_pages >= d->max_pages ) - goto fail; - if ( unlikely(domain_adjust_tot_pages(d, 1) == 1) ) - get_knownalive_domain(d); - } - - page->count_info = PGC_allocated | 1; - page_set_owner(page, d); - page_list_add_tail(page,&d->page_list); - - spin_unlock(&d->page_alloc_lock); - return 0; - - fail: - spin_unlock(&d->page_alloc_lock); - gdprintk(XENLOG_WARNING, "Bad donate mfn %" PRI_mfn - " to d%d (owner d%d) caf=%08lx taf=%" PRtype_info "\n", - mfn_x(page_to_mfn(page)), d->domain_id, - owner ? owner->domain_id : DOMID_INVALID, - page->count_info, page->u.inuse.type_info); - return -EINVAL; -} - /* * Steal page will attempt to remove `page` from domain `d`. Upon * return, `page` will be in a state similar to the state of a page diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 8d0ddfb60c..d0d095d9c7 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -599,8 +599,6 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp, int __must_check guest_remove_page(struct domain *d, unsigned long gmfn); int __must_check steal_page(struct domain *d, struct page_info *page, unsigned int memflags); -int __must_check donate_page(struct domain *d, struct page_info *page, - unsigned int memflags); #define RAM_TYPE_CONVENTIONAL 0x00000001 #define RAM_TYPE_RESERVED 0x00000002