Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp239999pxt; Wed, 4 Aug 2021 21:24:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysNtiKnFF3uIRKUyGIMQ6Ptgy2XIx4t5CdI0Wwdpk7O6F+hiqwV0pdDEMtyPtwxR3HbPZh X-Received: by 2002:a02:664e:: with SMTP id l14mr2691554jaf.56.1628137491618; Wed, 04 Aug 2021 21:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628137491; cv=none; d=google.com; s=arc-20160816; b=W+0C0crwQpIGYoT6t1HYxA4EkZ/PBBThZEEXTMcPodQUnGmCAb6l25qsCYZCtnHEAj TyRRpvV+oEpmg8UG49mQglHxqk2xgImhb6JGIv0k/hmCv9YsnWP1kWwsze1pcCAVwZcH YM5F8FR5vOSFw3zv1+WfQ7tVw3uIlQyIh/d+P57t1nFFHV5UjhXAh7/GKMF3dg5J7hGl ReTtKRvwRjcBUkxKNgZxhGyBCoC+2XYLSzlSzr0DInX52gODnyhZH5YLOc/DTuLX9i5k j4zUhWWq1OAIizs37IEOIQtCT18evbnnvGmg1etudhcCAapeipGQl0vDhzDd/JAK7DX5 HeGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AY/qAlmgsl+TGoUavOYTmFcwEEyiEM/fJ7xc/8lnFZQ=; b=IGfw4oAxFXneDjjnxBG1bjw520h6jCRe1m5fn+vAg2gLdYrGz7vEhECMdafm8wmDFR OUbClYdxYqdRqmwvLlXrmuiDnjI0sla8bextUwXRNE+3FO07KZKAQxtYMYk80THv10Sc PcvlvcMZRgu+Y5VoBWSoGgoxuYrTGd/I5JCa8DKG6gKX2Qpp9Ig5uzJZQRREUr/54aZT RtIH6XYjjZUa+sbnUhvXGvx8PMuU3sHW8V5vB70pJBnQV9iAWqlqT60d4MUBAFqxF/Zx ciW5PfD7NVyH2aDjco5AOENle91y0pIrZhbywtoQG9fM0vRWa0c0bCk5womRZ4Bzkmyb tVyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si4581312ioq.70.2021.08.04.21.24.39; Wed, 04 Aug 2021 21:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237227AbhHEAyW (ORCPT + 99 others); Wed, 4 Aug 2021 20:54:22 -0400 Received: from mga09.intel.com ([134.134.136.24]:27472 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237104AbhHEAyF (ORCPT ); Wed, 4 Aug 2021 20:54:05 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10066"; a="214027478" X-IronPort-AV: E=Sophos;i="5.84,296,1620716400"; d="scan'208";a="214027478" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 17:53:43 -0700 X-IronPort-AV: E=Sophos;i="5.84,296,1620716400"; d="scan'208";a="437617269" Received: from mjkendri-mobl.amr.corp.intel.com (HELO skuppusw-desk1.amr.corp.intel.com) ([10.254.17.117]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 17:53:40 -0700 From: Kuppuswamy Sathyanarayanan To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Bjorn Helgaas , Richard Henderson , Thomas Bogendoerfer , James E J Bottomley , Helge Deller , "David S . Miller" , Arnd Bergmann , Jonathan Corbet , "Michael S . Tsirkin" Cc: Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH v4 10/15] asm/io.h: Add ioremap_shared fallback Date: Wed, 4 Aug 2021 17:52:13 -0700 Message-Id: <20210805005218.2912076-11-sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210805005218.2912076-1-sathyanarayanan.kuppuswamy@linux.intel.com> References: <20210805005218.2912076-1-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen This function is for declaring memory that should be shared with a hypervisor in a confidential guest. If the architecture doesn't implement it it's just ioremap. Signed-off-by: Andi Kleen Signed-off-by: Kuppuswamy Sathyanarayanan --- arch/alpha/include/asm/io.h | 1 + arch/mips/include/asm/io.h | 1 + arch/parisc/include/asm/io.h | 1 + arch/sparc/include/asm/io_64.h | 1 + include/asm-generic/io.h | 4 ++++ 5 files changed, 8 insertions(+) diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index 0fab5ac90775..701b44909b94 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -283,6 +283,7 @@ static inline void __iomem *ioremap(unsigned long port, unsigned long size) } #define ioremap_wc ioremap +#define ioremap_shared ioremap #define ioremap_uc ioremap static inline void iounmap(volatile void __iomem *addr) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 6f5c86d2bab4..3713ff624632 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -179,6 +179,7 @@ void iounmap(const volatile void __iomem *addr); #define ioremap(offset, size) \ ioremap_prot((offset), (size), _CACHE_UNCACHED) #define ioremap_uc ioremap +#define ioremap_shared ioremap /* * ioremap_cache - map bus memory into CPU space diff --git a/arch/parisc/include/asm/io.h b/arch/parisc/include/asm/io.h index 0b5259102319..73064e152df7 100644 --- a/arch/parisc/include/asm/io.h +++ b/arch/parisc/include/asm/io.h @@ -129,6 +129,7 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr) */ void __iomem *ioremap(unsigned long offset, unsigned long size); #define ioremap_wc ioremap +#define ioremap_shared ioremap #define ioremap_uc ioremap extern void iounmap(const volatile void __iomem *addr); diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 5ffa820dcd4d..18cc656eb712 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -409,6 +409,7 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size) #define ioremap_uc(X,Y) ioremap((X),(Y)) #define ioremap_wc(X,Y) ioremap((X),(Y)) #define ioremap_wt(X,Y) ioremap((X),(Y)) +#define ioremap_shared(X, Y) ioremap((X), (Y)) static inline void __iomem *ioremap_np(unsigned long offset, unsigned long size) { return NULL; diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index e93375c710b9..bfcaee1691c8 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -982,6 +982,10 @@ static inline void __iomem *ioremap(phys_addr_t addr, size_t size) #define ioremap_wt ioremap #endif +#ifndef ioremap_shared +#define ioremap_shared ioremap +#endif + /* * ioremap_uc is special in that we do require an explicit architecture * implementation. In general you do not want to use this function in a -- 2.25.1