From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 70672C433E8 for ; Tue, 28 Jul 2020 11:38:01 +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 414A62065C for ; Tue, 28 Jul 2020 11:38:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="UcOibjlZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 414A62065C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass 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.92) (envelope-from ) id 1k0NvZ-0006Gx-HM; Tue, 28 Jul 2020 11:37:49 +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.92) (envelope-from ) id 1k0NvY-0006Bw-Pl for xen-devel@lists.xenproject.org; Tue, 28 Jul 2020 11:37:48 +0000 X-Inumbo-ID: bd6816ae-d0c6-11ea-a8af-12813bfff9fa Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id bd6816ae-d0c6-11ea-a8af-12813bfff9fa; Tue, 28 Jul 2020 11:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1595936259; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RkXLHOS6wpf6G4+l7e752XZD9SMg/CfYFIDpBklde9o=; b=UcOibjlZKdsXXmgl2O37fcJAMRgllKBVnkO4kyiP5Ket5e2D8pok7zbg qpYun1NeYIG4176lkYGWebFwQ81vp8RuhT3/3IuLrkQiuY4b/jAXP8bj4 ZhgPOFJ7fa38OyvXrvYfVUKABG5bH+y+F1ezBZ5Nkz6BwGtz01gRZR9n1 8=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: +NVwCWu+BqEKtJP+3sNKXmvYcsDwY3TNoqsX/w6ha0A1PxR8C7sdHpDcaDYy54oGf00KjegAz8 IW5ca5hUNk8RSkFr0dn+7l59ixRfGcfoXDkblqTU/gfTTiiy82fY0uW/MGawNQ1e7ZUMd/9jEc 3Emj+Z+Ltol8BTtjVr8OqF2uDwMwXA8Dl3+qQ6a+y5yZ+pSwKIP/GhMnbAhUP56Zoj5XhSaHER JwBJHoAC93xw00Jgn/T4bsYwWezZncg5UKlZbh6hE8hzUpPZ2G2WkWA0vJliIWwxHo4kYAccEb 3s8= X-SBRS: 2.7 X-MesageID: 24202968 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,406,1589256000"; d="scan'208";a="24202968" From: Andrew Cooper To: Xen-devel Subject: [PATCH 1/5] xen/memory: Introduce CONFIG_ARCH_ACQUIRE_RESOURCE Date: Tue, 28 Jul 2020 12:37:07 +0100 Message-ID: <20200728113712.22966-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200728113712.22966-1-andrew.cooper3@citrix.com> References: <20200728113712.22966-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Paul Durrant , Andrew Cooper , =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= , Jan Beulich , Hubert Jasudowicz , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" New architectures shouldn't be forced to implement no-op stubs for unused functionality. Introduce CONFIG_ARCH_ACQUIRE_RESOURCE which can be opted in to, and provide compatibility logic in xen/mm.h No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Paul Durrant CC: Michał Leszczyński CC: Hubert Jasudowicz --- xen/arch/x86/Kconfig | 1 + xen/common/Kconfig | 3 +++ xen/include/asm-arm/mm.h | 8 -------- xen/include/xen/mm.h | 9 +++++++++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index a636a4bb1e..e7644a0a9d 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -6,6 +6,7 @@ config X86 select ACPI select ACPI_LEGACY_TABLES_LOOKUP select ARCH_SUPPORTS_INT128 + select ARCH_ACQUIRE_RESOURCE select COMPAT select CORE_PARKING select HAS_ALTERNATIVE diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 15e3b79ff5..593459ea6e 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -22,6 +22,9 @@ config GRANT_TABLE If unsure, say Y. +config ARCH_ACQUIRE_RESOURCE + bool + config HAS_ALTERNATIVE bool diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index f8ba49b118..0b7de3102e 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -358,14 +358,6 @@ static inline void put_page_and_type(struct page_info *page) void clear_and_clean_page(struct page_info *page); -static inline -int arch_acquire_resource(struct domain *d, unsigned int type, unsigned int id, - unsigned long frame, unsigned int nr_frames, - xen_pfn_t mfn_list[]) -{ - return -EOPNOTSUPP; -} - unsigned int arch_get_dma_bitsize(void); #endif /* __ARCH_ARM_MM__ */ diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 1061765bcd..1b2c1f6b32 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -685,4 +685,13 @@ static inline void put_page_alloc_ref(struct page_info *page) } } +#ifndef CONFIG_ARCH_ACQUIRE_RESOURCE +static inline int arch_acquire_resource( + struct domain *d, unsigned int type, unsigned int id, unsigned long frame, + unsigned int nr_frames, xen_pfn_t mfn_list[]) +{ + return -EOPNOTSUPP; +} +#endif /* !CONFIG_ARCH_ACQUIRE_RESOURCE */ + #endif /* __XEN_MM_H__ */ -- 2.11.0