From patchwork Fri Jan 27 11:40:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13118656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B38E4C54EAA for ; Fri, 27 Jan 2023 13:00:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QWkVAIFQ+iV5Ks/aWa6G/06YcAX0QvCmzg3Ic3J7Bcs=; b=jsIqKXQ9uLijhZ Iq4d6WKk4W3PppwWnwgDM999xtPQLkJLcnyQBZsdKdWpZkg7dbDV4XxkT64P+vDAOlW0BUhe6M7zx WpLKEiqsZ1ed8rTtqdVtq2udsDqTs51hySzCqHBHMaqEQ4rSpMbfIOuaYjWXLJEcESdfoQuiYy4HG pS5djJ6eSHZEGhN6OHDwatRBe26qo89nvpskbgM5pPySYH4L8a81DIURv5HfrUPm+Q/bWolZt6nNN VmHxjzKCkkzAiLsGNbXituwX1rPbz3YGBoGYghi69B4MtXyPr6rtf3dC3SYMeacCgvZz+vK3zvuz/ 15Pzp0JlXMm09h9wqShA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLOIJ-00Em5W-Md; Fri, 27 Jan 2023 12:57:33 +0000 Received: from mail-ve1eur01on2051.outbound.protection.outlook.com ([40.107.14.51] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLNMQ-00EKj1-CT for linux-arm-kernel@lists.infradead.org; Fri, 27 Jan 2023 11:57:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mfmG/SscmSCGgdmMDRai/tE1Awu1KRQPqX/oIQCKwoM=; b=+JqUBo/jsRhua9s3PCNyd9sDD1dh2ja9Z4UAwuyOhQT2SIck9DFVGzkhC/3MNT5RZyGEgFD/n2xveKp/HfsxLVXFM6+uJgPh5LEtrZPpHJt/X5tN5uYi01rt1V/DX4TsJn809sSe2cSPC3VQkEkqQc9APcVMF1Gowb45DSlNjWA= Received: from AM6P191CA0074.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::15) by GV2PR08MB9255.eurprd08.prod.outlook.com (2603:10a6:150:e3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 11:41:45 +0000 Received: from AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::de) by AM6P191CA0074.outlook.office365.com (2603:10a6:209:8a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.23 via Frontend Transport; Fri, 27 Jan 2023 11:41:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT047.mail.protection.outlook.com (100.127.140.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.23 via Frontend Transport; Fri, 27 Jan 2023 11:41:44 +0000 Received: ("Tessian outbound 0d7b2ab0f13d:v132"); Fri, 27 Jan 2023 11:41:44 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 01b30c8a8973a124 X-CR-MTA-TID: 64aa7808 Received: from 414c00eca92b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2C600D57-46FD-4933-9EA1-500F83CBE8BA.1; Fri, 27 Jan 2023 11:41:38 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 414c00eca92b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 27 Jan 2023 11:41:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TzosGICsOKX23lXJIKzEiVxLH5VYcjXf+BDei8VgB9tLNgdfs7T4M62DnARQ3lTnaSuJwTQn13ohiJ5V50ipTcbIF4J8BepBHx8yd1/hBTL110uHt+6lZoZRFuZUO687xHPMOCuoI+hu9NLkO57f6gegPpmaVsepjLhzZvKu/ehtTcE5CsVF/j1CsJYwO4E2Usg2X+5Ck9ZFLX3x38JhvsWPsbLYxZO4O51etbNYcQZ+bh/ns00av++eZkIPrMLCC20baIti4zyNaZqqSyiHKv5K0W0uCYo9O/DGi5KiqJnPn0pyyd7vO90k8l7DUQsJBOzf+ajIlxXwiKg6bbwFCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mfmG/SscmSCGgdmMDRai/tE1Awu1KRQPqX/oIQCKwoM=; b=Q6xI2j/TbAR+DvXnakWyFxmv6cBI+KQ5UBYpK6/64AfUPDbvyiVKn/yrX08zRX/ptSiOgFb/qJP0RZOrjqfAAL1laLL0DGYj/FuHRKKPMQN1c+qxLI5qQRlYa3Mcjg7FF3qiPBaVe0euLhnNg8+9IS3qLo/EQlLwY4P8jEh0gXOGhZw9rzNKE70MwsO//GE9l5/En4DZxyAHrkFTBzmJzw8aIxUsoeQWsDrOHW00foE9hzBMNDgkKW57yEyIck6DZbvN0/dOjw8ZiDW3h6eDR4TmwM+VKiT4gbrlBhyj4QzvUZdfwR9QRQmeIbZixPhg4+70juGfRDOquVMmKPmbzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=linux.dev smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mfmG/SscmSCGgdmMDRai/tE1Awu1KRQPqX/oIQCKwoM=; b=+JqUBo/jsRhua9s3PCNyd9sDD1dh2ja9Z4UAwuyOhQT2SIck9DFVGzkhC/3MNT5RZyGEgFD/n2xveKp/HfsxLVXFM6+uJgPh5LEtrZPpHJt/X5tN5uYi01rt1V/DX4TsJn809sSe2cSPC3VQkEkqQc9APcVMF1Gowb45DSlNjWA= Received: from AM5PR0101CA0004.eurprd01.prod.exchangelabs.com (2603:10a6:206:16::17) by DU0PR08MB7637.eurprd08.prod.outlook.com (2603:10a6:10:31c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.28; Fri, 27 Jan 2023 11:41:34 +0000 Received: from AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:16:cafe::55) by AM5PR0101CA0004.outlook.office365.com (2603:10a6:206:16::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.34 via Frontend Transport; Fri, 27 Jan 2023 11:41:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT061.mail.protection.outlook.com (100.127.140.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.23 via Frontend Transport; Fri, 27 Jan 2023 11:41:33 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 27 Jan 2023 11:41:32 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Fri, 27 Jan 2023 11:41:27 +0000 From: Joey Gouly To: Andrew Jones , , CC: , Alexandru Elisei , Christoffer Dall , Fuad Tabba , Jean-Philippe Brucker , Joey Gouly , Marc Zyngier , Mark Rutland , Oliver Upton , Paolo Bonzini , Quentin Perret , Steven Price , Suzuki K Poulose , "Thomas Huth" , Will Deacon , Zenghui Yu , , , , Subject: [RFC kvm-unit-tests 03/27] arm: realm: Add RSI interface header Date: Fri, 27 Jan 2023 11:40:44 +0000 Message-ID: <20230127114108.10025-4-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230127114108.10025-1-joey.gouly@arm.com> References: <20230127112248.136810-1-suzuki.poulose@arm.com> <20230127114108.10025-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT061:EE_|DU0PR08MB7637:EE_|AM7EUR03FT047:EE_|GV2PR08MB9255:EE_ X-MS-Office365-Filtering-Correlation-Id: 627a22a5-3c51-4d10-637a-08db005b7784 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: BVjsYobxHabxc5fQduZYXdoGRTBp3BtDg2neAkTMmuIleelJgyk/pxf4dD6HOmq13+BqmX1UHjDVNDSgeSjM0YdUSmpsAOGyOkx1V/VdgUXh5rZe5S7QkdDaBTBKz4SFwHfjK44Yu3D09nd7bIJ7BRryJfJgWypWaUrGpM+jgvr0Sc4Q9FLIRSA/xoxRIEiR0HO/J8dUUAaZY1zx0Cv8trl8hQIMBEUbDwA9IJaD6WRXnqk2ufFmoki493X7/s4t0cIus6V8cdYCxPjkPByTzDXFE1+zSSIGzT4DfgEpH6bwFjtECAMUo2shhVVamNnQJ0xfNRNyxccbkdnxhsMOhobCJtwXDMMzUf4yAertjJeym07VT+MdPz69jAI3PimRANNor6j1qQzlZPnz0cQck7Jlnvj12K/n8+PE1yhaFyqP36LD3E2dB8zbv0A8qe1buOrvmrCY5w6Tjwdy/u6/63qR/maNlLDlDAuQtjoghM3RjzCpCYH/yfNdJpXZi7fppbxBXZykVc6PmqJhOK4vdMLTz16+w7F3R0uJdasdbs0ADjE0tmoG0/3MCg/T7mT2g+q8KSJKm4QaXf6k7bQyy70tHjODHMm+Bh89eLbmRZJ22/6BnE6Fdwrkp/ztfVpTmPbBm51dLhw7IE8SATvHMSwZ7Fu8ouVoR0J0ddXgoKXVulwh7cMHeS9EXxjn6femrS5CNkw0VQPhQQOF+SJTFIUYTRb7IKUzbSLxcqdVR1HRKa5eF5RxNwpVm3b7fdG/ X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(39860400002)(346002)(136003)(451199018)(46966006)(36840700001)(40470700004)(36756003)(336012)(70206006)(41300700001)(478600001)(70586007)(82310400005)(4326008)(26005)(2616005)(316002)(1076003)(7696005)(81166007)(426003)(7416002)(54906003)(83380400001)(356005)(6666004)(5660300002)(40460700003)(110136005)(8676002)(40480700001)(82740400003)(44832011)(36860700001)(86362001)(186003)(47076005)(8936002)(2906002)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7637 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 51920a98-4f0b-4763-9801-08db005b70de X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F4TFk5nHLjLKM8DUDX0p5QSO3RrPHlA+DF7uX/JSUSegZGH0Rh5OCofKmd8MbAa7zocW93QSyz9TfoWx0gZJK8DPy7ReTEq9qT4sYuPRpXogcxxVcZ1js9vqQcGIYbNN/YTPpkERN/v2UDxVFzJbrEAPjXVOCYFlhuImz42awf6mIWuYSu/DUrOS8Q89NvaxjgzrJ8FTMjLj4XeRHytiHkspQyWIWqxzd/VGWVAhsOoYR+1LSwXMqn4KYqgXByrQ+qcoJHg/v4RC65DSunfyyFs7An91CMuE2pH81hfq/E7L5EkUJ00LjS5PWktPlZuXbNqCrGwMsm5kHGVlNU+YmM2PAIXonszAWNDT2CTRNdEqn7JpdU3VTW9GlXX1cfuTwU7v1AgZ++fmz/v+aTRhrHZiU1odEhmlQQGmavj+i1T/fprCckw90TNAVVfOvwWCTUYaJNvYJdB1/AveBtRHdI7FxITf3ce/9bccxG/hDjV+JeqlpdXGgHwpq+VVrtrhcKZB06DtJrgUXRyTcqOf3pvAJZMgo9eRXgGqMH0wJLW90Kcvw6q3kZvsxknqA257MAm+TvsEpOClsogXJnlYpLh6MiuRa6IQGeIPwMgHckBgHH/saFwlP/+O/OBocoGcc1jposyHZqPLJqSu0V1JHzTIRh0ngo6PCC8P80CNuLwI56vzSkjeNxdaZWAt7l98OmHPtN1hw4s3+SvKY/vEXMjFx04Jsxk7kQhwUjrlhD8= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199018)(40470700004)(36840700001)(46966006)(82310400005)(36860700001)(1076003)(2616005)(8936002)(81166007)(40460700003)(2906002)(44832011)(110136005)(54906003)(82740400003)(316002)(7696005)(41300700001)(478600001)(426003)(86362001)(40480700001)(83380400001)(186003)(26005)(6666004)(107886003)(70586007)(70206006)(47076005)(8676002)(36756003)(5660300002)(336012)(4326008)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 11:41:44.9777 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 627a22a5-3c51-4d10-637a-08db005b7784 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9255 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230127_035738_638312_DE4393B3 X-CRM114-Status: GOOD ( 18.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add the defintions for the Realm Service Interface (RSI). RSI calls are a way for the Realm to communicate with the RMM and request information/services. Signed-off-by: Joey Gouly --- lib/arm64/asm/smc-rsi.h | 139 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 lib/arm64/asm/smc-rsi.h diff --git a/lib/arm64/asm/smc-rsi.h b/lib/arm64/asm/smc-rsi.h new file mode 100644 index 00000000..cd05e9c6 --- /dev/null +++ b/lib/arm64/asm/smc-rsi.h @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2022 Arm Limited. + * All rights reserved. + */ +#ifndef __SMC_RSI_H_ +#define __SMC_RSI_H_ + +/* + * This file describes the Realm Services Interface (RSI) Application Binary + * Interface (ABI) for SMC calls made from within the Realm to the RMM and + * serviced by the RMM. + */ + +#define SMC_RSI_CALL_BASE 0xC4000000 + +/* + * The major version number of the RSI implementation. Increase this whenever + * the binary format or semantics of the SMC calls change. + */ +#define RSI_ABI_VERSION_MAJOR 12 + +/* + * The minor version number of the RSI implementation. Increase this when + * a bug is fixed, or a feature is added without breaking binary compatibility. + */ +#define RSI_ABI_VERSION_MINOR 0 + +#define RSI_ABI_VERSION ((RSI_ABI_VERSION_MAJOR << 16) | \ + RSI_ABI_VERSION_MINOR) + +#define RSI_ABI_VERSION_GET_MAJOR(_version) ((_version) >> 16) +#define RSI_ABI_VERSION_GET_MINOR(_version) ((_version) & 0xFFFF) + +#define RSI_SUCCESS 0 +#define RSI_ERROR_INPUT 1 +#define RSI_ERROR_STATE 2 +#define RSI_INCOMPLETE 3 +#define RSI_ERROR_MEMORY 4 + +#define SMC_RSI_FID(_x) (SMC_RSI_CALL_BASE + (_x)) + +#define SMC_RSI_ABI_VERSION SMC_RSI_FID(0x190) + +/* + * arg1 == The IPA of token buffer + * arg2 == Challenge value, bytes: 0 - 7 + * arg3 == Challenge value, bytes: 7 - 15 + * arg4 == Challenge value, bytes: 16 - 23 + * arg5 == Challenge value, bytes: 24 - 31 + * arg6 == Challenge value, bytes: 32 - 39 + * arg7 == Challenge value, bytes: 40 - 47 + * arg8 == Challenge value, bytes: 48 - 55 + * arg9 == Challenge value, bytes: 56 - 63 + * ret0 == Status / error + */ +#define SMC_RSI_ATTEST_TOKEN_INIT SMC_RSI_FID(0x194) + +/* + * arg1 == The IPA of token buffer + * ret0 == Status / error + * ret1 == Size of completed token in bytes + */ +#define SMC_RSI_ATTEST_TOKEN_CONTINUE SMC_RSI_FID(0x195) + +/* + * arg1 == Index (1..4), which measurement (REM) to extend + * arg2 == Size of realm measurement in bytes, max 64 bytes + * arg3 == Measurement value, bytes: 0 - 7 + * arg4 == Measurement value, bytes: 7 - 15 + * arg5 == Measurement value, bytes: 16 - 23 + * arg6 == Measurement value, bytes: 24 - 31 + * arg7 == Measurement value, bytes: 32 - 39 + * arg8 == Measurement value, bytes: 40 - 47 + * arg9 == Measurement value, bytes: 48 - 55 + * arg10 == Measurement value, bytes: 56 - 63 + * ret0 == Status / error + */ +#define SMC_RSI_MEASUREMENT_EXTEND SMC_RSI_FID(0x193) + +/* + * arg1 == Index (0..4), which measurement (RIM or REM) to read + * ret0 == Status / error + * ret1 == Measurement value, bytes: 0 - 7 + * ret2 == Measurement value, bytes: 7 - 15 + * ret3 == Measurement value, bytes: 16 - 23 + * ret4 == Measurement value, bytes: 24 - 31 + * ret5 == Measurement value, bytes: 32 - 39 + * ret6 == Measurement value, bytes: 40 - 47 + * ret7 == Measurement value, bytes: 48 - 55 + * ret8 == Measurement value, bytes: 56 - 63 + */ +#define SMC_RSI_MEASUREMENT_READ SMC_RSI_FID(0x192) + +#ifndef __ASSEMBLY__ + +struct rsi_realm_config { + union { + struct { + unsigned long ipa_width; /* Width of IPA in bits */ + }; + unsigned char __reserved0[0x1000]; + }; + /* Offset 0x1000 */ +}; + +#endif /* __ASSEMBLY__ */ + +/* + * arg0 == struct rsi_realm_config addr + */ +#define SMC_RSI_REALM_CONFIG SMC_RSI_FID(0x196) + +/* + * arg0 == IPA address of target region + * arg1 == size of target region in bytes + * arg2 == RIPAS value + * ret0 == Status / error + * ret1 == Top of modified IPA range + */ +#define SMC_RSI_IPA_STATE_SET SMC_RSI_FID(0x197) + +#define RSI_HOST_CALL_NR_GPRS 31 + +#ifndef __ASSEMBLY__ + +struct rsi_host_call { + unsigned int imm; + unsigned long gprs[RSI_HOST_CALL_NR_GPRS]; +}; + +#endif /* __ASSEMBLY__ */ + +/* + * arg0 == struct rsi_host_call addr + */ +#define SMC_RSI_HOST_CALL SMC_RSI_FID(0x199) + +#endif /* __SMC_RSI_H_ */