From nobody Sat Nov 30 01:45:44 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=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1620850723; cv=none; d=zohomail.com; s=zohoarc; b=MrsA2KJ0BnsyD7dODyzAIG40k8TGH6v1T5v/vM9rwP2I68YeYT9kdh65VoPIZ74WOxwi92AxPzDHEO/5tbdvFI9fgkIFliUSiW1g9pOP+d8RLI1U/xvxAP0WH+YV4u3KECD1pKuezOgBHRAMVp0lVBQGy3DVeT+sUJUL/5oAbiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620850723; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Mvcnm7Vef+91LwvVcLxcVKWU1nvRo8R6MDnr90HJD/U=; b=lVlTke8jP6QCHvVHXQdA4tDnW1S2sXXAZa5l8GAO50QVzPJC6qlTZExe58rtWkBiT7ju6Hr+VwlzYf9rNnCw8+P8OGNuKcPTMNtN8uDVaFLFqqGBUriZh0/WS6QOOpK3YBy9qT+DwTamF2Atg4spydX33HuYuQ1SVlD+Wjb1c7Y= 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=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1620850723270851.9638145394717; Wed, 12 May 2021 13:18:43 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.126371.237907 (Exim 4.92) (envelope-from ) id 1lgvJO-00054U-SL; Wed, 12 May 2021 20:18:30 +0000 Received: by outflank-mailman (output) from mailman id 126371.237907; Wed, 12 May 2021 20:18:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lgvJO-00054N-PL; Wed, 12 May 2021 20:18:30 +0000 Received: by outflank-mailman (input) for mailman id 126371; Wed, 12 May 2021 20:18:29 +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 1lgvJM-00053i-VT for xen-devel@lists.xenproject.org; Wed, 12 May 2021 20:18:29 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dd05b009-a7cc-4e1e-bda1-ffbca09f8373; Wed, 12 May 2021 20:18:28 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 734D361408; Wed, 12 May 2021 20:18:27 +0000 (UTC) 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: dd05b009-a7cc-4e1e-bda1-ffbca09f8373 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620850707; bh=5GSHqd6UoXwElcgEbYeM8UQG4GJkKSSlVE4wPB43XOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vHHpKNOcSv3F8S4EPFQSzTJKfGTM1mlZ8082xqqy+v1IZ8uxlYgnmk6Fw+JHyWk8P lEpvWBAv3fhk7v3LMfPuWzhRFkhPnyuPcey9qCWJOHG6kQ4KAF97xxCO/Vvan8EsLM G8W3vBQSLbZYMTckWaS7Nct+WIRm+WSuwvfYKcE6jW8okm51FrL764aLnv2fwVKbTX fFgm+kluXKRIjYpViGlO+USpxdzUm5zYLq4ZQJQ26qvLAOfIt3DAh0knAAas8Um5n8 tEpW9w3pkYeq6RkfKD0FPsNfFx5Yd7JEr9Cgzmd9SoQien1ww1lkTepk1KEtpz0xot YKaOZF832bj9Q== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, hch@lst.de, Stefano Stabellini Subject: [PATCH v2 1/3] xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h Date: Wed, 12 May 2021 13:18:21 -0700 Message-Id: <20210512201823.1963-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ZohoMail-DKIM: pass (identity @kernel.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini Move xen_swiotlb_detect to a static inline function to make it available to !CONFIG_XEN builds. CC: boris.ostrovsky@oracle.com CC: jgross@suse.com Signed-off-by: Stefano Stabellini Reviewed-by: Christoph Hellwig Reviewed-by: Juergen Gross --- Changes in v2: - patch split --- arch/arm/xen/mm.c | 12 ------------ include/xen/arm/swiotlb-xen.h | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index f8f07469d259..223b1151fd7d 100644 --- a/arch/arm/xen/mm.c +++ b/arch/arm/xen/mm.c @@ -135,18 +135,6 @@ void xen_destroy_contiguous_region(phys_addr_t pstart,= unsigned int order) return; } =20 -int xen_swiotlb_detect(void) -{ - if (!xen_domain()) - return 0; - if (xen_feature(XENFEAT_direct_mapped)) - return 1; - /* legacy case */ - if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain()) - return 1; - return 0; -} - static int __init xen_mm_init(void) { struct gnttab_cache_flush cflush; diff --git a/include/xen/arm/swiotlb-xen.h b/include/xen/arm/swiotlb-xen.h index 2994fe6031a0..33336ab58afc 100644 --- a/include/xen/arm/swiotlb-xen.h +++ b/include/xen/arm/swiotlb-xen.h @@ -2,6 +2,19 @@ #ifndef _ASM_ARM_SWIOTLB_XEN_H #define _ASM_ARM_SWIOTLB_XEN_H =20 -extern int xen_swiotlb_detect(void); +#include +#include + +static inline int xen_swiotlb_detect(void) +{ + if (!xen_domain()) + return 0; + if (xen_feature(XENFEAT_direct_mapped)) + return 1; + /* legacy case */ + if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain()) + return 1; + return 0; +} =20 #endif /* _ASM_ARM_SWIOTLB_XEN_H */ --=20 2.17.1