From patchwork Fri Sep 25 11:28:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1371182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=dZtaITix; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=JejhYGbb; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=p3Fhb1YC; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4ByV7h3w4Mz9sSJ for ; Fri, 25 Sep 2020 21:29:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=raLQgbxrvhczDsNSHXhNPR0vpDn94zr6vENuJb4WuIc=; b=dZtaITixHiL1ZTjmsvz2atRiT8 JnJgJAK81JOSIE8XYb/swF6uO7qU6svvijiWSmQsDbTOjuCCbWWJ+mJZ+Z2KTdgnB7jXvK9osuu57 TyQ31hdQrZdWBe0Hb3wZGkJZKeU0WIbIF2k6Az3B2CFG+z0sp339oawACpSLQxhH+Ow+oqhOI/HAg Yqv6aLN6CRpUIJfONjOw2xM3pNdWYL0bLHRguQJJed8OgCXuB7VPD92A8ZPz1sb4+nbaVLBkyzXd4 SegudS8f+syIvVvZdWGnUm9gw9AujdgC3aKtBRbMgjnsFhMLzOWEasR0auuzCSSgQuLU2K9UuNeIb xJzxDY5Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLlv9-00047G-0L; Fri, 25 Sep 2020 11:29:47 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLlv7-00046H-16 for opensbi@lists.infradead.org; Fri, 25 Sep 2020 11:29:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1601033385; x=1632569385; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=9wpzxF6kVG0awnPKVdpn59DZ+MlA1gBV9mA6Nhno+DE=; b=JejhYGbbeE1ja0mMW2cp+UxqDzuxiwzZ9sBCSYyYhpgWmr1CnliqDdyL flvSCEIPIVqNi4ZXBwdaznZbLHM5qf1DcXPjhhCxpj1AtvNKJ0+GM5U0s dizMLpOIj/2rEZdg+VkDvKUjFhD1UCn89Rb7mRatDqQeUyB2jVpJvr4j0 8zs3SnvjimBmZQbZ6u5XF797T1i/VoECsDJ+RyxC3nqJaWvimeuXsPCxM P/yCbuQovRmdIcGZcGV1xgh6pCKbvT18aKt9CvT18kUOAValRlwZTq6Xp El+zc6rifOzZoe63NszR4QPssB3oRE6laNzk0zJYN/oIrdeZXxqKy6fpK w==; IronPort-SDR: HiGroBa90xlqCYOG/GPOzSVdAPerIY7RW1LZczqCVzMnQCQerw9u3MjFXxx8scSJLcLwxhX/+1 bM9K6NWcZEIiJTFph+MHM/2QrJTDxEEd2Cgoy0VybOK9nKrrB8coQFgR/d34H8XhD/sUqesDUm S7O3v7zUOX0z7iaLSks1k2c0Rd2wv35du5BYThEZ6jUEPxP+fZklGQ5AnLlIqYWnAR9TqIpfoE rTKPSZlaVT8lvd5Vmaergmfw9KI2JWYb1FL3QG9gZs4kZolcjhpv5i3+RqBhn7cF0k+ZPbx8Bc Nrw= X-IronPort-AV: E=Sophos;i="5.77,301,1596470400"; d="scan'208";a="148192067" Received: from mail-co1nam04lp2056.outbound.protection.outlook.com (HELO NAM04-CO1-obe.outbound.protection.outlook.com) ([104.47.45.56]) by ob1.hgst.iphmx.com with ESMTP; 25 Sep 2020 19:29:44 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mY9jK99htRLUP9smBnJ24m3iRjMPfeh6gsV/sFsO3G2N+FOPpIIvOp35w9S56QSLRaHWjreAvHH6CFFx4kse3Z8CzOAge9gMcjr4FaPfdc7lL88zoqW1eItjFZ1c8/rtb2TWtCOD7sdPf9xF28o9OZmIfCygd0Pz9a+23V98yKfHgYdaWUEDFlrQG6Mwa7TLzxGYbO+ILGHxWoZT5fiMLUOBcoQc3blknCuIEzZ2L6qBdhvz40FnJV1KwnYvtF6R4MtVN4Li2BVYUWEj6w7Z/YJEhu8XLrQw16GXN+b7f4iSLs1qDyJjc2pLdoSVnOmJ+OJ/Ruppdc6Dma62/gEYOw== 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-SenderADCheck; bh=+dYf9e4GlO+Ebkkxg8/9y2775YIH5r1OF6LW9l8edBE=; b=Huk5UtLiO8N9gOmgXySpeURl8+67+fB1T3SijrHCM3vFfxg5LyInif9ky7g3gjO3ib9k7Q9lkCgj8DIHqaJapguBdvnlabZDtB9vTukWh/J6HT7jUfPGcvEqWzpNtdiJwd1CI7Aype5suvyta96EuvaExhb0sqMmioXh1pDjOmUil/d02ZGR8vfRIrDcCiU7WIpw96oPm5dNYJmnPkpYQpwyPhe11x7ErA2y7Vk6qCosoll6e//ycd7ti6AVt3UFZv//71/g8FrU1fht37YhQ6aBh8iiO9nfI8GoB8b/OID7pmz2sbNtw99dEAobvKlpObTlDhuoeUrT3NHL5IWGmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+dYf9e4GlO+Ebkkxg8/9y2775YIH5r1OF6LW9l8edBE=; b=p3Fhb1YC3sq/TIXcaNQIAboC02EFa5atVTAKjePzIJxQeGQ+kdvG8SZwu3bQNRUoqzKaBtFGMcpAEdg2wMqNnayLXzOl0IG8ZnwANsKd4I/9PzZhGYFYPsKfGAGqvPVGWIVLnfxd88dfG4oRXTEV2f1KME14uLaNR5UIQITsckE= Authentication-Results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; Received: from DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) by DM6PR04MB6778.namprd04.prod.outlook.com (2603:10b6:5:24c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Fri, 25 Sep 2020 11:29:41 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::607a:44ed:1477:83e]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::607a:44ed:1477:83e%7]) with mapi id 15.20.3391.020; Fri, 25 Sep 2020 11:29:41 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 00/16] OpenSBI domain support Date: Fri, 25 Sep 2020 16:58:58 +0530 Message-Id: <20200925112914.725846-1-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: MA1PR01CA0152.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:71::22) To DM6PR04MB6201.namprd04.prod.outlook.com (2603:10b6:5:127::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.69.106) by MA1PR01CA0152.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:71::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Fri, 25 Sep 2020 11:29:39 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [122.179.69.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 51901beb-9afb-4b9f-22e9-08d861464b3d X-MS-TrafficTypeDiagnostic: DM6PR04MB6778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2W0o1K6SWaFCtZOjnKNTCy26KDA7xKpG0psfDITA09qhaUWEsR/nJYrZb56GdZeWTahhEGBPcQ/8g2sxk3+gedJqLubKTz0sTkKjVXgY0VLKY+OBhOUyG5VY3fPbifrX8uGTqoG6J+UsQxp7w2EgZs02mkVDimYTWaoLuGiR9b7vCrbKt4FXw6YZ7QBUPHa9x4LPRqA18LY/ZjPGTQzM3sLOAw1gfEeZd1VfAOigXnE/t31vQXplOCzppOS732Kmj2+rUaTq13mDWHUioglY4jgOipEjg9AfCm2zh8cCWd9ijVa+yeZJst3raPIGKXKl5kj+xo2nU9nwc5MisQDUayMnlNyW4RTIhC3cTJmpBKJxWAJwqFG/8ncCh3Qcs8bon9iT9MnFNNaw/zK6BeoOEEBVMYEsV6yBeeqzjQE3HknqVXlnlBu9S4HjO/sp+wM4bzNNDsjwqIrccZN3ezScPg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6201.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(366004)(39860400002)(396003)(376002)(6636002)(6666004)(55016002)(66946007)(86362001)(26005)(1076003)(316002)(4326008)(2616005)(110136005)(44832011)(83380400001)(186003)(956004)(478600001)(966005)(52116002)(7696005)(66476007)(66556008)(16526019)(8886007)(2906002)(5660300002)(8676002)(36756003)(8936002)(54906003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 1RZfZ0ts6rUoPmlZoX/u20ZGcooQf/caD/ahOveY+pPaGoBC88JdBG7AUZuKbMQxVoU8Znn5rHcmhdtQr98my7xNavcpqMyB1J3gA0qNTpx7DL/hZrvS1tMLQxKbi+YCwDNH8o7wn97T6kUzI6Uap+fIjW/9OzN16QCteMee6E9vSFOF5vjl/332F86BB5VPqorbfd4oJvfAUusUfccsTzUJ0Zf35R78W0GcXg5J8NVHVx/40NCYl/BKFqvI9KOaVluGly3Gdm4v0TRBHOp6RGlViddyzbAs5wzUjTwumG6lam5HPmHvddzdbwlA63keFUDub5QocC1z9yW3no2cI6jo0aqjYW4wXiI2eaZ56oug/k7MtVaGDYPmtIpYl0S8Ybh9JsLo3jOkQGD7REomwTMSfcIRHKifaZWP9sfVKpgBTkGOypVPqlnPtGekWgm9BWBmV41l9KT2uxBOMLCJ7Cp3CD+AFnkTw8M3mgjfhl2ersHvDiwpe9dhHFNh9IygguH3eG4lMR0PcApIMGpG6xzqItfPIA7dYuXwF+Zkds0Irq+c7+O/FmLzU6kn0DaJClaHFz9Hj2JwhjsF7H1Y97AKS6YaGz1idG3ZylKfHw0myFVaUSR8dcrRZuao37j99WnmDKk85FBcbdao8tZwZA== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51901beb-9afb-4b9f-22e9-08d861464b3d X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2020 11:29:41.3506 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cU5H6ED5EFz1lxlT/Iy9WJl52JdBv3qis/QJIMrVWxek/a3Bp8YJ+Mu7AZT10TYULcpBh5U3KfsV1ez+pq8f5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6778 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200925_072945_196340_7A6B990A X-CRM114-Status: GOOD ( 15.32 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.42 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This series extends OpenSBI to provide system-level partitioning where each logical system-level partition is referred to as OpenSBI domain. The last patch of this series provides documentation for OpenSBI domain support. It will be responsibility of OpenSBI platform support to populate OpenSBI domains based on use-case of platform vendor. We will be having separate series to extend OpenSBI generic platform so that OpenSBI generic platform can populate OpenSBI domains from DTB passed by the previous booting stage which in-turn provides more configurability to the previous booting stage. These patches are also available in domains_v1 branch at https://github.com/avpatel/opensbi.git Anup Patel (16): include: sbi: Remove redundant includes from sbi_platform.h include: sbi: Remove pmp_region callbacks from sbi_platform_operations lib: sbi: Configure PMP late in coldboot and warmboot path lib: sbi: Remove redundant hartid parameter from sbi_hart_init() include: sbi: Make hartmask pointer as const in sbi_hartmask_test_hart() lib: sbi: Add initial domain support lib: sbi: Extend sbi_hsm_hart_started_mask() for domains lib: sbi: Extend sbi_hsm_hart_start() for domains lib: sbi: Optimize sbi_hsm_hart_started_mask() implementation lib: sbi: Extend sbi_system_reset() for domains lib: utils: Update fdt_reserved_memory_fixup() to use current domain lib: utils: Update fdt_cpu_fixup() to use current domain lib: sbi: Remove redundant sbi_hart_pmp_xyz() functions lib: sbi: Configure PMP based on domain memory regions lib: sbi: Display domain details in boot prints docs: Add initial documentation for domain support README.md | 3 + docs/domain_support.md | 105 +++++++++ docs/doxygen.cfg | 1 + include/sbi/sbi_domain.h | 144 ++++++++++++ include/sbi/sbi_hart.h | 13 +- include/sbi/sbi_hartmask.h | 2 +- include/sbi/sbi_hsm.h | 12 +- include/sbi/sbi_platform.h | 56 ++--- lib/sbi/objects.mk | 1 + lib/sbi/sbi_domain.c | 461 +++++++++++++++++++++++++++++++++++++ lib/sbi/sbi_ecall_hsm.c | 8 +- lib/sbi/sbi_ecall_legacy.c | 4 +- lib/sbi/sbi_hart.c | 152 ++++-------- lib/sbi/sbi_hsm.c | 59 +++-- lib/sbi/sbi_init.c | 59 +++-- lib/sbi/sbi_ipi.c | 6 +- lib/sbi/sbi_system.c | 11 +- lib/utils/fdt/fdt_fixup.c | 55 ++--- 18 files changed, 906 insertions(+), 246 deletions(-) create mode 100644 docs/domain_support.md create mode 100644 include/sbi/sbi_domain.h create mode 100644 lib/sbi/sbi_domain.c