Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1269204ybv; Thu, 20 Feb 2020 16:47:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxX722pLdse43QEqswK7spzFBuYMbZJlHGRfzoHFauBsKstPadas3g5py67T08SeI/xWEV3 X-Received: by 2002:a05:6830:1498:: with SMTP id s24mr27607949otq.79.1582246038445; Thu, 20 Feb 2020 16:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582246038; cv=none; d=google.com; s=arc-20160816; b=hO2K7j4pOR25uq4aWdYhvbCYCG+blgPZLS/0cN9ZgVW88ivDEGJNDFWYlI+mzIuDwh 0RKmWjcLYWsZ9jr+ER/tBMBdOGw863jEHaGZP2izkVmfGdMe5NaIdlXn50NcET5hu4Cl Ec1OO1oacvx/kXTqJ9rUyVnrJFUwxVa5V+pG9VT4SoZvvCtu9qRMeRK25N4OWIaM1sR/ erzL1gVJchHEepWCsj7IxsFb/K//yjEfrWHUXZOOUm8EPExlz0L/7orA4db8+xyZlA4I TuBqG6rtntbnRgCKWAwr+oCtIR9Me9ycv1oTMy7JuXMh7q3tFjcWDhzfaF/38gnu71Ty X9ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :wdcironportexception:ironport-sdr:ironport-sdr:ironport-sdr :dkim-signature; bh=A/+D2J6zIW3Ulh/6/EVmRAYYpcS1AG55zi+ucc8B3pM=; b=WPP0t5eRLwgssIjfK2cOOVQHv9z5X4FmrLhGTUHXoGLmso+NKz5M+YeInAlaIGw5UJ dHRCQXT6PJzRTNhRFV/H5xqjsPr8kQJHBK4nDCwgJkdkpMIZzVKlOGk/eIQ5zQ9n3XDy R02IIofT8yeD7wnGGZC2aszaexxneKacXbkc4cO0FtSO8G1JZcTzXtNa76LTLskaRc7i 6ac9HRaYqsnNDpOCZ/NvsSbfQlBIkFm//Cb05wuVtDagCM6X2ci4DcTjUogpD6cpBWyl 0s3oH7GgwOZtO7SsVPlzySftJ3v3VKZOT8iwk3S9qHdqnsTRtF1KxjCoKe1Bceid+2z5 Tirw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=gG4pbQOi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si480750oix.12.2020.02.20.16.47.06; Thu, 20 Feb 2020 16:47:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=gG4pbQOi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729479AbgBUAoq (ORCPT + 99 others); Thu, 20 Feb 2020 19:44:46 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:17954 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729419AbgBUAoq (ORCPT ); Thu, 20 Feb 2020 19:44:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1582245902; x=1613781902; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yDncWfSp6M8/jssWUl+xy8MMegbv2C/ZuQ85YJQuEro=; b=gG4pbQOi35VfaerEfbjI9gffqo4SyVLC1Qpsag0kFkRgPZnjFtPSvFE8 mLrWAAn9EB/2IZPVnzBESHBs16nP4RHiwOlycCD6HVge6tzOJ5l1LYEBx 7JQPRZshXw4VW/nYBcPXGgmf2V19qPw45qcw7XHUAupzBq7nV2wIPJV50 PFBfu+CZhEMjLVyd2PBYmcYYQqw56QG32VSQFVn/Z9najvmW16NMVSpGA UR+SJdqc3HttbdjcbAf/ks2TZge7WfyfRtyM00Kg4+QhZpJo59fHOx27N keoP7oV54vR8RSSKeHevNdz8LWID/26xleig3sbGz6F29j+0tVJyMfPPX g==; IronPort-SDR: RHkKl/tsCQ4RqWIRhGU+Nkm5hNA4uvG8tuv9J2iOVIAaPvRKP1iGQUoS3ADq6sigXjmsnvuRWc UyoECJXyVDEv91thKluARb0vspnk8RV6Fqm7MPPErfQxKQfJvdDUhWrMPQwK3c6AZak0ayogSs C50n2ihuJLt4+hRWq+dX3imC91gNZDHbJc1V06RolFdYqc3RWi3ck07JV/ouaFxPxUDBS1I1up FclCiN6JsdT9fUbYRthFtjmw7W3AQ/AYIc4d0mLWmnI1GJkGkJZzbiA1DCwu1aWTQCIK2uhK2h qMk= X-IronPort-AV: E=Sophos;i="5.70,466,1574092800"; d="scan'208";a="232211046" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 21 Feb 2020 08:45:01 +0800 IronPort-SDR: pSZ42z/b/xRCLBuJpsNN7xBhuX6o6Zu4rc1rEw5l6QbFtGKFzxpnMHJFur7pBFPU23KMdab9YO TJOvvVOBqHbBhZP37O/Ivp5ZMcASM0xpss+2dNWPcyCDXXn3OAz2uRCidJkSpOTKfuUYZIYqpH HrGNXq6Tpu7OT9VSVYpEhg3+rv3TTmiljvE2CNgAiIuK2FTeUjuLkTucinAEivME3s4kUdsB+4 8ujl5cGDHsW1sEN0so8tSPW8aAxrSAzW/bBYFQSSBkcfexWiM1iWn5TAFATTXuYGEfr/UZAGXr OgkvYi9XIc1XYQ88wrQfqv4k Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 16:37:20 -0800 IronPort-SDR: IfdrrNTyj4t+AKKpRxnTg6JcpdXfCtjjWuHNYKLcUu3a6Mq4B20NpHVjyzpllVCNQ9N2srRaIh YWtlmlYy+rFyz+xE4/5bzS6///pijnsS6DjZH8MvGgcWxDFzAGIVfrsgEVNsNFuf7MntjV/Stn oB0Fmek9akLIggLEipsVR7oHnmMiV4ybr1nBHTTnbi0uVqSq1nPrpUiPstIJ5voozYVo6YXPCp gAOUJx4BnncKhgervowcJxho+0jjN79hguvhbgSvRaMfr9g2lU/8w0900ElEgivgpXovdfX9O5 xgE= WDCIronportException: Internal Received: from yoda.sdcorp.global.sandisk.com (HELO yoda.int.fusionio.com) ([10.196.158.80]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Feb 2020 16:44:45 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Anup Patel , Palmer Dabbelt , Albert Ou , Borislav Petkov , Daniel Lezcano , "Eric W. Biederman" , Geert Uytterhoeven , Greg Kroah-Hartman , Heiko Carstens , Jason Cooper , Kees Cook , linux-riscv@lists.infradead.org, Mao Han , Marc Zyngier , Mike Rapoport , Nick Hu , Palmer Dabbelt , Paul Walmsley , "Rafael J. Wysocki" , Thomas Gleixner , Vincent Chen Subject: [PATCH v9 01/12] RISC-V: Mark existing SBI as 0.1 SBI. Date: Thu, 20 Feb 2020 16:44:02 -0800 Message-Id: <20200221004413.12869-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200221004413.12869-1-atish.patra@wdc.com> References: <20200221004413.12869-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As per the new SBI specification, current SBI implementation version is defined as 0.1 and will be removed/replaced in future. Each of the function call in 0.1 is defined as a separate extension which makes easier to replace them one at a time. Rename existing implementation to reflect that. This patch is just a preparatory patch for SBI v0.2 and doesn't introduce any functional changes. Signed-off-by: Atish Patra Reviewed-by: Anup Patel Reviewed-by: Palmer Dabbelt --- arch/riscv/include/asm/sbi.h | 44 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 2570c1e683d3..b38bc36f7429 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2015 Regents of the University of California + * Copyright (c) 2019 Western Digital Corporation or its affiliates. */ #ifndef _ASM_RISCV_SBI_H @@ -9,17 +10,17 @@ #include #ifdef CONFIG_RISCV_SBI -#define SBI_SET_TIMER 0 -#define SBI_CONSOLE_PUTCHAR 1 -#define SBI_CONSOLE_GETCHAR 2 -#define SBI_CLEAR_IPI 3 -#define SBI_SEND_IPI 4 -#define SBI_REMOTE_FENCE_I 5 -#define SBI_REMOTE_SFENCE_VMA 6 -#define SBI_REMOTE_SFENCE_VMA_ASID 7 -#define SBI_SHUTDOWN 8 +#define SBI_EXT_0_1_SET_TIMER 0x0 +#define SBI_EXT_0_1_CONSOLE_PUTCHAR 0x1 +#define SBI_EXT_0_1_CONSOLE_GETCHAR 0x2 +#define SBI_EXT_0_1_CLEAR_IPI 0x3 +#define SBI_EXT_0_1_SEND_IPI 0x4 +#define SBI_EXT_0_1_REMOTE_FENCE_I 0x5 +#define SBI_EXT_0_1_REMOTE_SFENCE_VMA 0x6 +#define SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID 0x7 +#define SBI_EXT_0_1_SHUTDOWN 0x8 -#define SBI_CALL(which, arg0, arg1, arg2, arg3) ({ \ +#define SBI_CALL(which, arg0, arg1, arg2, arg3) ({ \ register uintptr_t a0 asm ("a0") = (uintptr_t)(arg0); \ register uintptr_t a1 asm ("a1") = (uintptr_t)(arg1); \ register uintptr_t a2 asm ("a2") = (uintptr_t)(arg2); \ @@ -43,48 +44,50 @@ static inline void sbi_console_putchar(int ch) { - SBI_CALL_1(SBI_CONSOLE_PUTCHAR, ch); + SBI_CALL_1(SBI_EXT_0_1_CONSOLE_PUTCHAR, ch); } static inline int sbi_console_getchar(void) { - return SBI_CALL_0(SBI_CONSOLE_GETCHAR); + return SBI_CALL_0(SBI_EXT_0_1_CONSOLE_GETCHAR); } static inline void sbi_set_timer(uint64_t stime_value) { #if __riscv_xlen == 32 - SBI_CALL_2(SBI_SET_TIMER, stime_value, stime_value >> 32); + SBI_CALL_2(SBI_EXT_0_1_SET_TIMER, stime_value, + stime_value >> 32); #else - SBI_CALL_1(SBI_SET_TIMER, stime_value); + SBI_CALL_1(SBI_EXT_0_1_SET_TIMER, stime_value); #endif } static inline void sbi_shutdown(void) { - SBI_CALL_0(SBI_SHUTDOWN); + SBI_CALL_0(SBI_EXT_0_1_SHUTDOWN); } static inline void sbi_clear_ipi(void) { - SBI_CALL_0(SBI_CLEAR_IPI); + SBI_CALL_0(SBI_EXT_0_1_CLEAR_IPI); } static inline void sbi_send_ipi(const unsigned long *hart_mask) { - SBI_CALL_1(SBI_SEND_IPI, hart_mask); + SBI_CALL_1(SBI_EXT_0_1_SEND_IPI, hart_mask); } static inline void sbi_remote_fence_i(const unsigned long *hart_mask) { - SBI_CALL_1(SBI_REMOTE_FENCE_I, hart_mask); + SBI_CALL_1(SBI_EXT_0_1_REMOTE_FENCE_I, hart_mask); } static inline void sbi_remote_sfence_vma(const unsigned long *hart_mask, unsigned long start, unsigned long size) { - SBI_CALL_3(SBI_REMOTE_SFENCE_VMA, hart_mask, start, size); + SBI_CALL_3(SBI_EXT_0_1_REMOTE_SFENCE_VMA, hart_mask, + start, size); } static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask, @@ -92,7 +95,8 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask, unsigned long size, unsigned long asid) { - SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid); + SBI_CALL_4(SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID, hart_mask, + start, size, asid); } #else /* CONFIG_RISCV_SBI */ /* stubs for code that is only reachable under IS_ENABLED(CONFIG_RISCV_SBI): */ -- 2.25.0