Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp330193ybf; Wed, 26 Feb 2020 14:03:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwTgg4sDRQZQuFjz4r92efznqaXoDeBdNQUoe+4vv4WTX8rGg6qmOTEN+vzPBym2KUuO89k X-Received: by 2002:a9d:21c5:: with SMTP id s63mr756447otb.142.1582754586332; Wed, 26 Feb 2020 14:03:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582754586; cv=none; d=google.com; s=arc-20160816; b=wVbCvIkczDk9kyhvQaQsPRUuXC0IgtG/9jlbeLbp3NZPtInrbcNtjmkKYJjZz56Cto 0zOxxHwacdI8m5exGvVUmLxR+XHqz9MZhaj7foJHdhuJrfMG2cgyTNC6jP3L5gD6i4UI M61mABo85Dt9XgQB/tyMielxWLT0ZtkwP+XE8mqIoosOgtKAMOfMUrwOSJmQcDCCHYoE RpoXUDPiFtnJ2arHhUJNGMk1afPgvyJr2ofV9NRjt6FEabY8pc8pcDRzkRYuDDK7yQmK Y20KTnPnMOUveboxK6mVoa8R8UB8jVbcnQe887rEFrwojkD8g7SBMewgL2HTYPTLvY4C 2+Wg== 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=tfPVK/HJb/gx9BEeuwjFz9FBW6TX0o9spgT34qrnX58=; b=o2zdF8xnwJYcFFbO3not5SjqOjqGDVrst4+99DR6b6fVAEgg3ezGrkIB+ETiqDocyd I9YWMaWneQ3HYmYPPS28lsD4SEUNqi8yQ9USjl7uZGpG+O5bloHmt1jNhCF+SD+WJAQp 5ESXa8ssE/zYYbm2HVaMa/hAutral6v8mT2DqLbbPOzpak2Udn3Fhz8LO5ak7JkF3kdS pRsVgveShQzNOF5eQ4QlQPe53EcwtCaNv7/63Zq8OKn13lGCDaL62/PdK8VyeM/Ni1K1 wYEN9LZLbC96l3SkTJo4SaGEllDIm/6XhVr2wmOP8GzY+j1ujkCArkWM2x9jxeOw9bfO evcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=RvO9Ri2u; 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 s64si268775oig.147.2020.02.26.14.02.48; Wed, 26 Feb 2020 14:03:06 -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=RvO9Ri2u; 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 S1727925AbgBZWC3 (ORCPT + 99 others); Wed, 26 Feb 2020 17:02:29 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:45045 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727885AbgBZWC0 (ORCPT ); Wed, 26 Feb 2020 17:02:26 -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=1582754546; x=1614290546; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9Ui27SSBnDNLiTnFJyNqyp0+HmPzoBOlVS3ULCIEs7E=; b=RvO9Ri2utTVq8PpCmVOBXAlZt5MbYhq2O+e1JEM89qSmn+8j3jRPILmW YGPvJ5FNGFv+Di7XJSw/4L4Z0nHE7XD6rbPpyICkO2GHunOd8UpljSQi2 Rly7iH7Md+fpsolId9AUlVy9RHGAo1QSnfb88KFkR47V+yFfoIQsAaETB pEYN152oFu3D64uhxTgXmzKkdRNvygPdWl3gxtvfaeLAZCZdrzMg91LGc OHKJItm2pI+rx8CZTSklKNm7+Lb0B4qEQoDYM6RqXmhRxbykdcqmUMO4Y BX6LaDSEOGqDmMQq2f0iF4zH+DFQRD2E+/7oL93t4q2SSYatLfL8K9PiF Q==; IronPort-SDR: 5eBR5xkwsC0EtmjkWAD3G9vS7f6usCdejWoFyiFeKacD193X83IsuDRSn14I8c/ujLybeGjFlz 4+i6Ia/k/xXYNPwmZd7dk0T+WwW/T4p2I0mdcUdh+ZML28pMPf64Hr0mF2hAYO6bkCvyVLF0ZL S0ShLcYoB3K+Sy3uJNeHbfSBTfFY+uCzbPzSgaCjsF325Wb5OfmUGW7IQPQm4o8jKDuy302K0w P44YoOWfRQ6JrzT+tF7u9Sdjk6E5vB/1j+DdvsePvkzsIv5OWKx9f9WrFTtkQewr5wFrO0kjMW lz4= X-IronPort-AV: E=Sophos;i="5.70,489,1574092800"; d="scan'208";a="132290747" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 27 Feb 2020 06:02:25 +0800 IronPort-SDR: L0aGCYIID6gmswWTl0klVUD4jzbPEUjjwdBNt+1nFg2UWsJkZqS9edWj0e4rFWC0pqp426kU8d cpUPasrx5DMAJuebe9oAhzJCMovAOy4HidxrnzO9J/I7sWQ9gsJoNPE6jm2R01fuyqypEzfqZf VoYQwCtmGWzvK+S56G0LpRr8URTCpKu/nctKXEz32pyGg0ghVxdB362U1SmPHVWV/pTQaC5xhx 2Whs7rsH3/OCZjqsKoqgUNrZy2pPHhoHcEQDMSC4V00uIstI7qvr4fgxO6FCdgbLzTy/HEMyIK +WUv3LL4iMNYCdRrhSIfkDP2 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 13:54:50 -0800 IronPort-SDR: cwWbOHXlgS187vh61TxRjM6guQ7ekDTpm98OcXyDB2OGhAdfCG+xrfniT9NPggwCnklbxc0dB+ +exZW2EhASXPMZntYxbsWCex681LyalY5ySfsrJfMH8QKGwx8ZKJjPCsJNzeC4GEuM3PCwqtGR 3lvXucSrKbzrSKMUsoSNOOVGt1tH0ohUKoTuSp56n5+fS77Zy6NEg2dlcNEdjBTYXJIuX0x/NN PAfilQhS/RXAuTURdERtFBjcHBPsZnc15GBqImlUTZ5K1hupUAB6RwniAwb3PI1p/XokGe03el ou8= WDCIronportException: Internal Received: from yoda.sdcorp.global.sandisk.com (HELO yoda.int.fusionio.com) ([10.196.158.80]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Feb 2020 14:02:25 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Anup Patel , Albert Ou , Alexios Zavras , Anup Patel , Borislav Petkov , Daniel Jordan , "Eric W. Biederman" , Gary Guo , Geert Uytterhoeven , Greentime Hu , Greg Kroah-Hartman , Heiko Carstens , Jason Cooper , Kate Stewart , Kees Cook , linux-riscv@lists.infradead.org, Madhavan Srinivasan , Mao Han , Marc Zyngier , Michael Kelley , Mike Rapoport , Nick Hu , Palmer Dabbelt , Paul Walmsley , "Rafael J. Wysocki" , Steven Price , Sudeep Holla , Thomas Gleixner , Vincent Chen , Zong Li Subject: [PATCH v10 09/12] RISC-V: Add SBI HSM extension definitions Date: Wed, 26 Feb 2020 14:02:10 -0800 Message-Id: <20200226220213.27423-10-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200226220213.27423-1-atish.patra@wdc.com> References: <20200226220213.27423-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 SBI specification defines HSM extension that allows to start/stop a hart by a supervisor anytime. The specification is available at https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc Add those definitions here. Signed-off-by: Atish Patra Reviewed-by: Anup Patel --- arch/riscv/include/asm/sbi.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 82ff88f06ddc..450430c15879 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -26,6 +26,7 @@ enum sbi_ext_id { SBI_EXT_TIME = 0x54494D45, SBI_EXT_IPI = 0x735049, SBI_EXT_RFENCE = 0x52464E43, + SBI_EXT_HSM = 0x48534D, }; enum sbi_ext_base_fid { @@ -56,6 +57,19 @@ enum sbi_ext_rfence_fid { SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID, }; +enum sbi_ext_hsm_fid { + SBI_EXT_HSM_HART_START = 0, + SBI_EXT_HSM_HART_STOP, + SBI_EXT_HSM_HART_STATUS, +}; + +enum sbi_hsm_hart_status { + SBI_HSM_HART_STATUS_STARTED = 0, + SBI_HSM_HART_STATUS_STOPPED, + SBI_HSM_HART_STATUS_START_PENDING, + SBI_HSM_HART_STATUS_STOP_PENDING, +}; + #define SBI_SPEC_VERSION_DEFAULT 0x1 #define SBI_SPEC_VERSION_MAJOR_SHIFT 24 #define SBI_SPEC_VERSION_MAJOR_MASK 0x7f -- 2.25.0