Message ID | 20230127114108.10025-25-joey.gouly@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 96654C38142 for <linux-arm-kernel@archiver.kernel.org>; Fri, 27 Jan 2023 12:43:57 +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=j00Wuvhc6X8BcJyb8lOhzwCTbk8Dn8XhT4HabwsAhcs=; b=PKUYnWoJdyGrfP IKL1vA0ZEg3kR2FteaOEF11pZntziADbW/0FenQaWfIylxuKI3rNUeedpaUQNoIhSwojTCkJwlMxW 6ZiJqyQ1s9IUdKLO0lyW3dLn9+e/3E03QgyS1IJEjUvTtY/R4Vs510BalbHEEQsmn1fM9iDW595vx OUMaylVkN0ABZVk9OMJXrsTXvXuY0HU6MVPTNJ0MHm1VZayLVJtKc3ZfVngPU1QSKlsnfm+xsef91 qFxJAxv60n5iISqp4AnZ2go/ew1z3CIUzNtX1CZha7LYP74xF/wLVigw5wahTvfCyHzxZLpC7f2Q3 aX2msyOva6M0yUsWGrOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLO37-00EfVX-NX; Fri, 27 Jan 2023 12:41:47 +0000 Received: from mail-dbaeur03on2040.outbound.protection.outlook.com ([40.107.104.40] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLN9F-00EEjV-61 for linux-arm-kernel@lists.infradead.org; Fri, 27 Jan 2023 11:44:02 +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=PLaFr9PZgJyXyWlvzCfGtSQ5pj75jGDJirYDuCm7ASI=; b=dyuOUwHcjj+uJ/aaLGNjgVEKrEF+ygOPm9yazPHrNevEBS1W0ronX/i7r0eyJMgtFkSzOWo3Wvhe8SxyZV5TMbf4rvzXQv0U+dBVuS/xbjgLjJ3cft+W9LNDnOxjwnEtUB/szudXLJJNd8WPQyEsntmCNxnjHKQ7oSyBjudOEuc= Received: from DB6P193CA0024.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::34) by DB9PR08MB7398.eurprd08.prod.outlook.com (2603:10a6:10:372::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21; Fri, 27 Jan 2023 11:43:46 +0000 Received: from DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:29:cafe::77) by DB6P193CA0024.outlook.office365.com (2603:10a6:6:29::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Fri, 27 Jan 2023 11:43:46 +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 DBAEUR03FT040.mail.protection.outlook.com (100.127.142.157) 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:43:46 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Fri, 27 Jan 2023 11:43:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d6f7ab49d9999772 X-CR-MTA-TID: 64aa7808 Received: from b2b793b33f45.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0DCECF22-853B-4E1A-A060-004B8BF11125.1; Fri, 27 Jan 2023 11:43:39 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b2b793b33f45.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 27 Jan 2023 11:43:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M78kBIdhCd7aEFQB88Y1HisZSh3zVHVxb1CRKWSMHqrIOHHPYq/4s8pbHXACCQCcfXxlGHQQfRssncR+f5N/h7qigCUJE1sVmkZ0uul4wGkZAA7sG3xHLXCXp3cvg1YBHdjECVlsKEH7vas5W4QHLplqscvr8uz3NR+tAT8X40hLwuHvb2sLzeUPqJ0YC/DQ6fwi4NfRBbPQ1jfKWsJnkSqKuP+1JqU9cml/2QVE7KGBBOtfCtAsjm3ZF5+s+FTWxNQBTy1jEa06OUCnaMR/OnRLBBnDQoiM+asceAIVa2OjNZ7nxhKpW5aEg1WMU3fY0x12SL2md+nthw0DDLUcGQ== 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=PLaFr9PZgJyXyWlvzCfGtSQ5pj75jGDJirYDuCm7ASI=; b=Mfiz/6gzm02e7PZeWXFvDAG09cODON5ydgb7iyht2C6mgHKR+TBXeT844tvY3QAhvLnqiLcqM+eEAZcGeP7/+eVc/RGVLkVS/2dN7yhQYYbDKFJgg7YyzaQ9JxslV5IbSYy7YP3ooSbv1Aa88QNEQyGvQmCr9nrat9Q2was/CtdNtxP64JoZK5VFaQQMsdvQlKrEy70ODMgVTLipcMTA4FyI1OPeDBVl3+59NVpwAwSNXaneOikeLPCLnzXONBD0LT28lIUHgwJu969eqQqISXS5orywcqXXBJZrcD0aGCa7/3Lbnvna4epF/1/jHRuYwcDc9xUQZiK7FH4nIfVftw== 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=PLaFr9PZgJyXyWlvzCfGtSQ5pj75jGDJirYDuCm7ASI=; b=dyuOUwHcjj+uJ/aaLGNjgVEKrEF+ygOPm9yazPHrNevEBS1W0ronX/i7r0eyJMgtFkSzOWo3Wvhe8SxyZV5TMbf4rvzXQv0U+dBVuS/xbjgLjJ3cft+W9LNDnOxjwnEtUB/szudXLJJNd8WPQyEsntmCNxnjHKQ7oSyBjudOEuc= Received: from DB3PR06CA0029.eurprd06.prod.outlook.com (2603:10a6:8:1::42) by AS8PR08MB8274.eurprd08.prod.outlook.com (2603:10a6:20b:536::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.23; Fri, 27 Jan 2023 11:43:32 +0000 Received: from DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:1:cafe::91) by DB3PR06CA0029.outlook.office365.com (2603:10a6:8:1::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Fri, 27 Jan 2023 11:43:32 +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 DBAEUR03FT062.mail.protection.outlook.com (100.127.142.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.25 via Frontend Transport; Fri, 27 Jan 2023 11:43:32 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) 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:43:32 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:43:31 +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:43:26 +0000 From: Joey Gouly <joey.gouly@arm.com> To: Andrew Jones <andrew.jones@linux.dev>, <kvmarm@lists.linux.dev>, <kvm@vger.kernel.org> CC: <joey.gouly@arm.com>, Alexandru Elisei <alexandru.elisei@arm.com>, Christoffer Dall <christoffer.dall@arm.com>, Fuad Tabba <tabba@google.com>, Jean-Philippe Brucker <jean-philippe@linaro.org>, Joey Gouly <Joey.Gouly@arm.com>, Marc Zyngier <maz@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Paolo Bonzini <pbonzini@redhat.com>, Quentin Perret <qperret@google.com>, Steven Price <steven.price@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, "Thomas Huth" <thuth@redhat.com>, Will Deacon <will@kernel.org>, Zenghui Yu <yuzenghui@huawei.com>, <linux-coco@lists.linux.dev>, <kvmarm@lists.cs.columbia.edu>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [RFC kvm-unit-tests 24/27] arm: realm: Add helpers to decode RSI return codes Date: Fri, 27 Jan 2023 11:41:05 +0000 Message-ID: <20230127114108.10025-25-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: DBAEUR03FT062:EE_|AS8PR08MB8274:EE_|DBAEUR03FT040:EE_|DB9PR08MB7398:EE_ X-MS-Office365-Filtering-Correlation-Id: 1617d1ca-b2c5-4d9d-2d06-08db005bc01f 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: QVg5TT9odF25czJSLKRkpYcIxQv4Cd6qZYMRahjFc8VBTPM3aeNE94hqVrpbmqPZZvn8m8HabMvp9ZybUSZN4LBk3HOSGF5YxRQPjwBqJoqs/Djiny6TkIqL8YAZ+bUPctPKho+bTySKU/Su9hBr0cUqRgIoD4oWG0LtQKngaeeWXUbBD/WJDmjO5IWf8uJUqMfY8eenhTc4HdAubsat1/wmBFvFfX9L8MkGak3dt6vE4hT14wM4VOJBqhNGyKyOzzZzQm2m/JuaJeG3sHHNHbbYuYv2tq9AdDTb2UR44kvMoFRkWNVW6DJmqMqmK4eUeQmXiO4Em3vYS9hUFwxJf5tTQ1oZg/DMi8QT/CacuJDB3yru6FK9fRu8VgqV5YTav8oyDWBXmubuIKS4+v2Qj9smVEH31WxkuHbnRfQvunV+JKsnUHXswAspgGmifW1vYikUVcH0qyOVVUOsP6ei3e0yz1PAHnRrHu1K0UDm8ciikNFDN4JlqsE07vmEpZyeHjQkvVjh1TlsOL/Yx0EbRGnke5zC3U7SoNFoRDD+mtOKG+/w7Z9CA7sPTD5fgHlg1pGFle1DCgdUcfxZCNZUVBxuwaUlafuJKLMRz3b76iLH/+G8yUKmDIiFyTNdgn3xHCXQ+kBvlKN6cHkRl5fkjzjvEuodbsi22m8meLtyFvr1tfaFeBpCz8SI67nyZPxCo4YUGPkOPY97KeN9jI4XXq6vfQix/pYoaHdFe6OvX7qEFMIZET+/kGvUku6kHvQr 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)(376002)(136003)(346002)(39860400002)(396003)(451199018)(46966006)(40470700004)(36840700001)(41300700001)(8936002)(7416002)(6666004)(5660300002)(36860700001)(83380400001)(336012)(426003)(47076005)(40460700003)(40480700001)(82740400003)(356005)(86362001)(54906003)(316002)(82310400005)(110136005)(36756003)(7696005)(70206006)(81166007)(70586007)(8676002)(4326008)(26005)(186003)(2616005)(478600001)(1076003)(44832011)(2906002)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8274 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 27d06a6a-cd35-4002-4da9-08db005bb783 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7c9hdfxKlcgTOSnaEpnoNXlMVU0rtnsZ7HJ4HLFN3TcrtDWIZSCoNMB30PVfGhITC+AnDm0rwDh7iiqmuVtTRp/LX7x8QsvsymdIrzb5r0aIcDqMYnjOBApSK8ep/Y+r3988pUQV8t3+1ZYtKU7UhSntwX098a2pUjSeRsa55S1smFd7AZd+3MpxniZaovoQ4N8bDpTfaE5haeLyyzBjHQKIY+ISl2GV4cp0Ort4QUzML7ULf/8aGVfbSG2mSeUENFw/OrvOe47atGzBUHXjjSGPwAMqDiGvMDQtEnhMSTiCxQR7BcOzTucl/ENctrk0kIgW+aj9u/4HqitlkhSWwcjzTM3Kx5lpAMjSjeQlj5F2MT/HY4j6vNtr/1q7vZicXA6ZZ0pWV5g0dLMvUz/q7tzRfZ6/evMhVH0scsjIbwtah9YxZDApEndn4/fsErVU86BbLAVYe04IYmIu+fsQuxkW5X1VfVaJRSxyZamVEqGrbiizQjtnBc129+ATBwWOFZ7fHLciKw8c0R65+BHvQE23T3aU8B3X8KyLzaJ13vNIoCLq5pfNnOwyo3QkBBx9oLxVqv/oXOORKQ/7RpLh9Ly3YMFjLLuWiPM4GNgjWOzXu4MsBQTLqg7ulGxnLKUEZMB1xXI2L/Sh9TWNZbqEdqoChJhL6C3x1+dSW5Oh+IDSaNnx0nWURMU1HLj/6k4BMWSQ/EVhCxhZFECroE5eHzlHlzEHOXlRTISdlvbUrQw= 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)(346002)(376002)(136003)(39860400002)(396003)(451199018)(46966006)(36840700001)(40470700004)(47076005)(83380400001)(36860700001)(70586007)(70206006)(336012)(82740400003)(426003)(2616005)(41300700001)(4326008)(8676002)(82310400005)(5660300002)(478600001)(107886003)(86362001)(6666004)(26005)(8936002)(81166007)(186003)(316002)(40460700003)(110136005)(40480700001)(2906002)(44832011)(36756003)(7696005)(54906003)(1076003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 11:43:46.8193 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1617d1ca-b2c5-4d9d-2d06-08db005bc01f 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: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7398 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230127_034401_284058_B6A8AE11 X-CRM114-Status: GOOD ( 13.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
[RFC,kvm-unit-tests,01/27] lib/string: include stddef.h for size_t
|
expand
|
diff --git a/lib/arm64/asm/rsi.h b/lib/arm64/asm/rsi.h index 50bab993..1d01a929 100644 --- a/lib/arm64/asm/rsi.h +++ b/lib/arm64/asm/rsi.h @@ -16,6 +16,39 @@ extern bool rsi_present; +/* + * Logical representation of return code returned by RMM commands. + * Each failure mode of a given command should return a unique return code, so + * that the caller can use it to unambiguously identify the failure mode. To + * avoid having a very large list of enumerated values, the return code is + * composed of a status which identifies the category of the error (for example, + * an address was misaligned), and an index which disambiguates between multiple + * similar failure modes (for example, a command may take multiple addresses as + * its input; the index identifies _which_ of them was misaligned.) + */ +typedef unsigned int status_t; +typedef struct { + status_t status; + unsigned int index; +} return_code_t; + +/* + * Convenience function for creating a return_code_t. + */ +static inline return_code_t make_return_code(unsigned int status, + unsigned int index) +{ + return (return_code_t) {status, index}; +} + +/* + * Unpacks a return code. + */ +static inline return_code_t unpack_return_code(unsigned long error_code) +{ + return make_return_code(error_code & 0xff, error_code >> 8); +} + void arm_rsi_init(void); int rsi_invoke(unsigned int function_id, unsigned long arg0,