From patchwork Sat Nov 21 09:47:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404385 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=MNJzRQPQ; 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=exJoyICb; 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=pRLCHQw6; 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 4CdpbP0Gnrz9s1l for ; Sun, 22 Nov 2020 09:52:49 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=euSoWWENLNwgSrYZgpG+K6cOHk1RtZq4RXQ5IwCWC2M=; b=MNJzRQPQkT6LDD5nRaeFH19Lw OqWqTtKbR6TTN1JJRb7mTPOkfhVFtqal/Zo4N+NVRhzSTOmee/FJL4bu4RVzO2tny1F4siU1obn+W 3HuoRvFzi+EJQWA+wP38Nn9gGAAckC50u5E+5zNlpmMoxOZ4cpD4X7UWsMQP5EfamKTPP6sEBQz20 hfmY5JcFG0zDGq59b9oglirWSiz9oLI2vMCx2GalmhSU3BDw17GoKlUpe6SwY5xMHuz2v4e9yLqrn xpgTfbBQ4E5I3F9d/mayTIFMA3r++ZEq/2ICjhrbOCMY1eBgg0yZpheuhCwUswaDY55uN7I9FSesE eUodjjkFg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkI-0005nK-9f; Sat, 21 Nov 2020 22:52:42 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbk9-0005jO-Aj for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:34 +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=1605999153; x=1637535153; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=Ax6Zw7EstHXptKKcd/8+/AgEIhlAyT4fbTZjZpjxjkM=; b=exJoyICb+IU655OrdmSCaKfm09Qj6qTWKM8XndPDW7UHt/Y5DvZfOMm1 gfiyAoJkqknpxWYtV73++y9unvlGJIOCANx+lxhejTJtxskUIaggIrNDi SCr48iM50W+vWMH3nqeIa07eqyKGWpza4sbjBNOMVke0FSJLgFNB0Lqp3 G2dHYLla2L9DFEgyv5NvUmBuegUo+h68saju2JtxsvPa/RJTYjgKnQh+D WMi0TjaP18a+ev4beJSXusjrkup2SHqauI5OYdy4Pi0Hp2HAKzCAaLE2I WHduKfpvwWEdEdmS6JUIHbHlcSSU2RGOk9aIBtOklSA2QvqtkoiizstP+ w==; IronPort-SDR: HzP0AMlLgpLzNdtmzy3ci6Uq0eq0cOby2FzUiTm0RHQ6n95pMdAefaV/bY7pkN4Zp9Knn6F9zU ZBe8a3eIVPQxNzIMZouPuEFU49JkMmQ/jYY1ySwBpQFjGuILwXDy7ZlIXiyzZ6qF7PBtqre/sq QhO5m9TBvofHY0Czp67v1bavI2cs389am9QbVbBAaRPeOo0swtNjZiRg/rEgqMwaLxRX69mnt7 f91u3jEiJj2HynzRsEI4IMWcYNDJTMEjnFPvA4Z5Nq3IYdpD1TjL53/aF848UAB+CG7u8uorbT dss= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="263192669" Received: from mail-dm6nam12lp2168.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.168]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:28 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QlmM3apBsvsxXsQMc1fR+swK0l65VizQOauFDsIEtAzSM52bBHXxrwhOITINh1vzYl5xIHJwNJifhuP5mnDE29YSZsP2MXTRj/8VwPJMByJoo6y4T3TF1kmid+STtqlfJKcSp3IO47V7VQgwZCavr6dPBhj0mmvqj0uHC5TPtZlnEb4SOI/tQrP2kkpDIUwEW8WhNOXCTOhNUMQGNUCowkYetNvY5afW95lKKR/7XDqiHDMsaFM/J//D3P756m0/ZmzbAXNsEtSzz0NjMtynACbkB2tuuxwcc2Cpn2GXDHs2Lz2BYIOhSAImYFohjkWXPGke6PE1NMTacxn/k12lRA== 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=4YYat4gzBAwUfA5jBsgvvRUSGK/rMYff6OeHFL1Li4I=; b=m/bopntOy51J4eKk5pr4791WROMmgIHCR8awyGl95VWEUm7fhLxRmeuWS0pa6jDD1hhvi48iNgk6Cb9kP1bsalThQa9RUOgiGxmq1yezUMvB+WR61hIiFNGy9EZuMypavr6FcYyi8dwEpVeXY/wZMZPRgVrvCGkVCSS23MuomxjJpmQia5x1/A6w+aPANOSGy0Hic/h/d6WtXAUXfeNuVBaTDNnH61SlguYbyz6Ea57No7odCM3hgg8+QzHOHG4Ovi7GAJajd1BuatJ7mFywVDRCO6PfJxlR2IpdgvSmJ4kNUNA/+bq0yLx5fEQMhkbRx+LnkUR6yhJyJ8DAszBY9w== 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=4YYat4gzBAwUfA5jBsgvvRUSGK/rMYff6OeHFL1Li4I=; b=pRLCHQw6Jy1KGNQeEAZyylglA1gozAX/FUmEg1OIcKmoAdTlHNFBrhHaEgMtp2Q+D3WKIiaJi5+IfePDxhYUyrnwnSO8KUxUlzbW2upVf3bR7M6Jj9qdrIE2fy4L1MSR/G8A08zqvDUr6VqCZfXIzljVEXwhxqRTreV5h1kOW+I= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:28 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:28 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 01/11] lib: sbi: Fix sbi_hart_switch_mode() for u-mode Date: Sat, 21 Nov 2020 15:17:46 +0530 Message-Id: <20201121094756.4154728-2-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a3d87cb8-0092-4815-1205-08d88e02984e X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:67; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 47HkseN+/3xRa4RfVgKqFn8QBRmG0IfT02xwlPx0dQKjejg8DyX875jsDoJe81owzHAyMxxqHbfWWLHJkNx4un5tbcq3/AmX70zl/S/sZzQ2xbRwTLDrWY6hkROnnST3nJ2TIjtHGDT5HqKAA+ybmYLjS2YXUf5LuLrVvLc3x/9o2AAhTrDKxQGQ+dIHpB9sCejvvzHsUciJjN27eYxxPvNCAMVXlon3lKNBniUw54n9S0UpJXyt+PUczmP+jbe4I7HwzK46Z3Und9WTGPGlvHqyzPH6CRhJ9YSumVg2ymtBZ9PXY/OvssvQzmRb5lne 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(4744005)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: W4JAboHGrj0M3PhftUeQKER4ozvP1h/FxifxNK5rq5sXfaQnV7dxPcimZEjwhk0jgnJ4ZJ+KFKCgigXxJMDhe6uUW2Hcrq4KAXlHvbVQwq3nmeL32ICISBd0hdvAuFRtJ+H1x+AfHyz0pB1B0Rto9Yyi3za4Z48AApo2u3TnuKQZz6EZia5Bzs+6hxej+eRNQyUdHBsfcugC2YArWrOVVqRSevucStt8pl7pbtVE3+P/AQrZn2aXjaTLxRHXukqK+JmM6jQRm9xUMXiENNaiBeGsGCxuUHOFvYpoZxm+1Lq8c67DSlAXvkxabG8nLN3hEWCX7Xhi3Goy7mDt9b9VkWjadTpSi4tOPN+f0/lN4+MpWDa35F4lczQvINLrL0Gt3sGukb3dJnEkUK5xfKI0jpbRP2CQkWniAJ6pV9UG4e4ZKPzc5NIFML2A0uapXyFffBswvFF4KK2NRQtUNNWbQu7BoNhPGE6i3M+SmecfBJKd77DxR3UxY958UA4YZ51mBRtLW3Wt0M4JgI8CyMTEN3V5++NIsZ7aNtwCQRCJaguQ9SPvdl9IDkWSEltI2IWu/bHBG0mnEST48XjIVyOfz7l64z8blfrFmH4XuOBd3ctQ7t5Zc4KduOUkl4FLObdkNIV5HAVNt5jKfbkdEsFQtg== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3d87cb8-0092-4815-1205-08d88e02984e X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:27.6732 (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: NljXO+cJZBwv1A798qDLjn6bAkcuYIC7WdJYhIyJ/Fvxv5hSRIXIh9eON9LxJhkC+5cXxgIcWvi3DVhCcojoDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175233_631693_8864BDED X-CRM114-Status: GOOD ( 13.70 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 We should check and access N-extension CSRs in sbi_hart_switch_mode() when next_mode is u-mode because N-extension is optional. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- lib/sbi/sbi_hart.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 30d8aef..fc86e9f 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -522,9 +522,11 @@ sbi_hart_switch_mode(unsigned long arg0, unsigned long arg1, csr_write(CSR_SIE, 0); csr_write(CSR_SATP, 0); } else if (next_mode == PRV_U) { - csr_write(CSR_UTVEC, next_addr); - csr_write(CSR_USCRATCH, 0); - csr_write(CSR_UIE, 0); + if (misa_extension('N')) { + csr_write(CSR_UTVEC, next_addr); + csr_write(CSR_USCRATCH, 0); + csr_write(CSR_UIE, 0); + } } register unsigned long a0 asm("a0") = arg0; From patchwork Sat Nov 21 09:47:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404387 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=BzgVXxB1; 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=RIwWetQ+; 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=Z1bUPg3T; 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 4CdpbS2ttHz9sT6 for ; Sun, 22 Nov 2020 09:52:52 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=Yh0181GO81neiSArtLxThcGClHyWBwkaKs441RjkZvQ=; b=BzgVXxB1cSvn8oKbh3WA2ybok dS6bBMvNqLAKpGsgixUNU9pwz7aoKmEKJjZ5wZUfn8jAAs9nJiuhL3CJIQhGC/ElQVtZuTNCXJyFT JGCkVzRfHnYqjxkCApPVvh0/1inPg1wh5AEyfM/CVOaR8zifn0rTeFezGeusrikdQ6smRYwf7b0aM FlWSQGGXrSvesDL2EuVApKn6BWmUWbiLsXOlqIAYxJjbzTa76SWzNc96DNuSVuRfPIoCwuPTACRi2 gmw0wAbPWxzd/b3Do3OcQz0SkAEdAZLjIfz3+lRAoRhWpX3rMeEu7JILERPHZrRBBoessk6QWfxfl 1XEw8QbiA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkF-0005m5-K0; Sat, 21 Nov 2020 22:52:39 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbk8-0005ig-SZ for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:34 +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=1605999152; x=1637535152; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=WGdPSDjdENuJCqABLL+cuEpMl1d6Z1CfTdnvSydn7vo=; b=RIwWetQ+MVmoeutarysXwOdYMwvoU/qy10YnMR9dhhp9PjOfuGnLAnaK tv+RpFn4YEEWPvu1JEne3p/G1Xekp8p5xcllCufmEoS2QW2jk3RsK2245 t1DhouZ6llDcn3paa8p+UH7k+eMVvPIYgpJdYmYr6G3M2THFM0cb38g6V JU2fHVQwslrScxquaHQkqXl5dxrMZZ8a7P7Kr3FIDosODm6WgbXasyRZ8 g+n9pdyzS5fKy8t+BRWY4hD0mjKg1ZxUVE6w0+Ap02cGwCihInrtJ5og+ VWIfH0Bm5AYJarg6+nOhKsQSgkakCdtXaktbKLpoT4saukPPrd7jfxQFI A==; IronPort-SDR: NZwag/PPbO5/T+r3KO36gxxUNxmOWJgorEDdUa/T0+pdMAvUWN8ajmTWU8wXtpLWW+IFgFq13k Y0PDH0zoJx+xCMKrhlG+W74N6PiIrswsAkUA0TjpvEQ8BEm1VmFanD9I8u7XxuBNFXcOs7A9hu fUBuX525WdvqdTtvdN4iVbFGN6IaN7uLlZv+v1RgAepjkPY8bTrr7TTFjOW+pnrOdjINiF7gv0 Cf/ANPwNzXbU/ui92pM3b6g6Tx7nAnE8c2JlXXF17S14+6S+1BekkNTBdGDlYgsu2yV0nBIyxL Ld4= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="263192673" Received: from mail-dm6nam12lp2168.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.168]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:31 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BtR/5ZUAwIgjEKeN/EloIXgc8xrED/SdMOBoS1X409qS3R0s/xVxFrwcveK4iBzAdjcBzM0yf0uoB+CRxJpilrkpDZPp1VpI/q3uxRPvrv9L0WeSroioZZmOpcg83cK3Flh1QQnhIg1opFRZA+mc1H/Tg5W8yDSi3xsRRFUC228vcahyTlZq7M5O9JuQACSL1SjPhMPzgvRzchNYP4VGphtzCscuwNYwjpVqxCMy1yK7wgk1NVlUe9t9p8/6H5jXiUER/6jnP2fd2l6YneNz5tIppedbuiGaDYFAKrIJDdjczk2ZkhAN4H0Tgwy2FSIjifV95zBCUomMpvh9QsM4Zg== 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=pKPixm1wvyC2S3ZS4KgheKRUkMJicpOblE8NZLWmnG0=; b=Mic9duRpgypmMRVKzDOFWUZxQE4M2TqfhxpurSZIqBdxmrEpDZIbhdjxmBBcPenCQ+bGqr6uZq1zUJLPxtHok8cNGB1Rkspsth5g+aPDWYyAQMLboXy+uGOVIs7x50YG9dj9nna6HzDiSMPJhcGe+Rmc751gQKHLp3ZEa/BhaOR4aMZnQ8suTg1UiqB9UhyeVpc0IzXkzwr6FoptMTtmYnehhKj89qEOvwcUPSi5eJXQ7NikhZw3PAS7HMtStcn5FDTmgBTnk887I7CRoWCFuE39QqG4n1dhWFvCZgvzaaTzJJwoTE2cECMU8FfpvWAHKvpbLYrE5eo1SgmOQv+aLg== 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=pKPixm1wvyC2S3ZS4KgheKRUkMJicpOblE8NZLWmnG0=; b=Z1bUPg3TdeyKTIiTXC5OTuwof8MGkKYcs3MBql4lyXTZQw/uqRr9rfHDZ98SKL/Z87WjoGOM6u1DphA89hirq7SxtNPZqPLgmlYEli2WxXwNB5J08CBZ79xUTmPi9d0SVbO/skSkS6C+pE94+/IuIFJvULYXQf03kiJ+SIdIj4M= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:31 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:31 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 02/11] lib: sbi: Fix typo in sbi_domain_finalize() Date: Sat, 21 Nov 2020 15:17:47 +0530 Message-Id: <20201121094756.4154728-3-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3a15438d-d675-444f-5db0-08d88e029aa1 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hD7e24/BGOSfeqZQITffJIFgAVtjCAzV9jEeI4BYeHBRdsbtvkZFw4yNdfla4B+pGjPw1hZtCiQwjkYax1mb9zaqD5FZKMl35AtlscdlU/fVXIz6f7O1H/1MIt1XVQzAoQTo/IXiq2BJYRunSII4HN+l7kLiCltpXtFNp2k/D5sMqtEzC4oTc7PQl/L5GDs6Nh0v1GCQCoTqYNXpuIJXawwleJyWPxHUZOcmJlQgOdpow5gEw3j4cG1/OMuZQSh3wn4z/GAZGJcnpE7k8q7xvfrzaBYY+5fmOijdLIEIYzbW8B00b0DJ67mniObTzqAN 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(4744005)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: T5RBP5FK3/rMBzFP7qZrSsYTq15zpdH6ZlfFUNzYLOtOp0330kx1YL0SBukXFpfkZ4E5jZ9MXV7epQlVbR3qLr+B4cNgqdK38nQc4Ji8yDfcKrtL7TkAiFafsyMRDkbrtWIYhPjq3BK5/upDLsmsoBfgYd7HMwkhKFyElQTPBLZbOAI4EBi7XAoSj6fP4mUAUIk0kcuuXTrgjhWqNsd5o1e9mbH4IvK4aqqJ1WZC610rjhS7lwrsOHXeOhV38QLPjPLyhoLeD6ZvnppoFxmouWll1Dtg/o6PwVPQBE4mT+CRB53bDcxDZO6VPaGLtzbUl1KQlm6l6to4F8NBgQEnneHAX+jAljil3jxSr9z3OO0oZ+BUJKo5QmSq8IN5McMUIc4S3VfTb5hUxDtcaAN0/garULh3z4DgpNsghTVrPD4CT06Dq/DFQam21WZgJ7RILr9YIEUy5OTGox/cYB6ojnOWTERukS0uO6n+Ih2TK5Jv8kbRg+0iRGXOC3LUptpHvcvQO8oW6UVkAOnmshvF3M419te4Awd92cpFEYP+L95L1MtZFXIl/4N6yafCp/tnStEUTQS83GuBOVqIDmPOXGNk8x5xUxzfcdpRt0pIybiA4v04YC1O3LjKT8Kb0mBzYiB3hOfnyX1YoXY4WKYTeQ== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a15438d-d675-444f-5db0-08d88e029aa1 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:31.2727 (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: xcnzj5eoL0fBmGLbS9lvzpQcPkqBa37FFDY7OovNy6qSyLU4PPzego2du2gu2XIWUKMBbU0EU3qM4nZhYsihzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175233_371748_A7A7B3EF X-CRM114-Status: GOOD ( 15.31 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 There has been typo in automatic domain boot hart startup for non-root domains so this patch fixes it. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- lib/sbi/sbi_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index d4b82fe..4c98a1b 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -404,12 +404,12 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid) dhart = dom->boot_hartid; /* Ignore if boot HART not possible for this domain */ - if (!sbi_hartmask_test_hart(i, dom->possible_harts)) + if (!sbi_hartmask_test_hart(dhart, dom->possible_harts)) continue; /* Ignore if boot HART assigned different domain */ if (sbi_hartid_to_domain(dhart) != dom || - !sbi_hartmask_test_hart(i, &dom->assigned_harts)) + !sbi_hartmask_test_hart(dhart, &dom->assigned_harts)) continue; /* Startup boot HART of domain */ From patchwork Sat Nov 21 09:47:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404388 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=VkLqOeKS; 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=mn7fHJdY; 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=rS5x1T3F; 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 4CdpbW0CZ8z9s0b for ; Sun, 22 Nov 2020 09:52:54 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=Uz1FkE4dHAAbJQuSvb9dPbpwtjAz0xMSmlpLB6TVlsw=; b=VkLqOeKSj9sIeQee3nj9f5ElC B4a5YJyW8lGMjDDhovwWOlUaqE3AxHIy656jZ0j2y7zucSTntl4gY7vwRr8P9wN5yc5PLIHfzWsxH JXczrFeVgoibU1ixCQ34pWoJ8WBQFQYH0Zo3q7XwotLnCRw2y5VLWl8guRpLY+W93DaaV54U6CH8y NEegy/4h8eM7fWZSylttQuZ+iLNrJWlF1hgkyPpSl9Z3f8dHwm1ZvxgorHzawFpyYn6I4bP5WAVGZ aDiDX2Q6+XATJLxasWRtzLFLFZl2qhm/hkraTcSvabhz7hsa8hW49CZoVYF3IRNY86wE9oYHKtxjA GY7eRAadA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkL-0005oa-Uw; Sat, 21 Nov 2020 22:52:46 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkA-0005ig-Fn for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:35 +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=1605999154; x=1637535154; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=O1FoxIlD7AkoG5PULTGyqBkV1n1vdcQEaXN23IsWt6A=; b=mn7fHJdYNXL0Rr/rjJNQLmfmfpg8YfGJxfuL/iq8+eFUGz7SalPd7U46 MRztFcfufc7JA6sbIpWu6mXCoF4l48cqlmT0eHOvT/TQlAm2p0pGcnSzc 8vJP8wt5PMALSuF0iRI7/GdSg4d7U3W0LCZUHhnYn8RbpjNA73TdCMkyR Swz1yE+1wvjKqZu9XrSbuHrvQffweqB4S0/Lwc709TwfTXvN6S9UU6yF+ Aiyv56N4zJLDwFzchJZVIy9wrYgoXX+OJXdMpTDM3QaJWtJ24MCbxeydU XY0p/TbiuepiBlnk1NvnlHWASKTE/v1FhXrTYQFIiEyaX+b3VK/oFrx8O g==; IronPort-SDR: bYAOCzRjrgvB63dROP1YPn9MYL2r3NMmPWEvD4zEgH3rK1BM1s9yDmqTihKfoyhnRLoe8fDdX0 vqrX29WD7SDQ6MKDNWCnNj3LFBXssx7h9ZLHypX0JQtCEKo4yPboT/8z0Diy7zMuo5l+QD+YXR KPm0JeyGDx2sK9DJw/fxsXbJcswNKVfvWtHRVBUZV6KQh9fgj/SmX+OKxpbj3Bp6keYZa84WqC UoueV6bboqFAdmBr9/syT2McaO5SCtqXunZSY4gW3hBnjFazK2o9IHjKY/et7D2S0ZADcGDJuh z88= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="263192676" Received: from mail-dm6nam12lp2171.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.171]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:34 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b87hHWIQrWOBmeMVsI/CRTYVOitF0puaAjKee9TQm52Ah1RmJ5JIp+FeCzV/uE64geA5BWfgPyAGv/Un1HQyFu7pF0FOR2ieKuTZ8zciG3GVxs966c79RigYs4wALynxgqREs+eQOf7l9HByRGJz2a/EhCX6eeDSRzB10FpbFySwuND/tIFMGjh49nupIhVoIgJv7sWwwJaXcFXiEWeNg5dukA6NOgA3ZGBcehJDUXIRxcra7g3Bd+69C2sHh3C+zHtE9TxhjgFBVx/ZGqTLMX67UnTCZAGTujEnwgQh5h9Yp9Pg4LnjM4xwRCiU5a4JSCmsxArc3j2RQa54Ps87PQ== 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=HBjauWZIntd02OQ5pWvsksWd1kEedHiUSzvl7SHD/4w=; b=Y6eIgLRlYJgBbIwWUbS9d3AY3jMLRHrKUUimHwlFjPyM27pE1Rd7zdGXm1i59koPhy2c/3gXaHfLyjVAM7Wid1U+9q6E9VyN104cZlRqLMERwcqTEHNXuegkWyaWIFGI9MZAZb/36x2a6X0ZB5CXo8fArQeQEVyOZAAT5Trca9+RJgC7Rb/z/Hj3Q28WS+APe+3DVY2ey23mhu9M+ijXRAd6dnwE861N/8LU08+qZpg0vape914esDUWpqWO/m/OWO8o6QDtA+DFtW0Jk3H+Xk+87j6pjeuHh7tEVheFt52EDXWoI1xNj01TpZrybiiet8pW0b+qAH9uvxIVzmyzvw== 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=HBjauWZIntd02OQ5pWvsksWd1kEedHiUSzvl7SHD/4w=; b=rS5x1T3FC+5S1U4cnqwb90PgQ2OIy6o53atYGvYfZknExS7I3GypSioebPhuh7WdEQN476NBOakuukYWCFg2ZFeNlQtIsbvJMnbVtRtkTKJR4+ICHyfAioGTjnpYvlsIM70qOLMgmH1V1pg5QpfGgr0M0DTyZ3G26O5bZD+CGww= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:33 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:33 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 03/11] lib: sbi: Fix domain_count check in sbi_domain_finalize() Date: Sat, 21 Nov 2020 15:17:48 +0530 Message-Id: <20201121094756.4154728-4-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e199f80a-a260-4032-c52b-08d88e029c33 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U86DkqOlWZslgmDa+4l+pxCYQ4gUszV5rs0P40psuxCzgyEp+zkxk9ZdSgSiKT3HzeDDtNrvRdtLaGpPr1snTyX1P3ZdAs/keXLwcgw7LAH1v/DbzwkSn3DDFcPZIW3VpKpUpZyXHxA4CJDAbAPWGJGbFC+PU6f0x7MjuHWnxrRlHzhgAvg+yALaCJEinT121qqqmgtdb5oG6XnFRhqiH/k37CnJn8sQKIe8VpIxsitdoF33ozIOEMaC4Omyqde20NMlTeGKguWm8RXCH0m7c4BEKSLKKvoAMLvdpXVq7Ql6LbfaQSPNI3n/vbac/6T36NicZKmmUIg1lDOqmkjxFg== 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(4744005)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: pcx4Mk6v18ISIC2rsY0ldlXtEnxVJdYC4Ln79Bn8J7zVHylMDo5gQ1PZCYZjJ2nSOn50RGSjg5sKHEV5vBIyVv7W96WOkRQb2Zg0ABg0UdJITxPR5UV0cRIKJLBunV77I3lhIvvMnVttdq8ffNleu6Irbis2QN+4xZOnm3cCOhIbQKvyl0t7LgQpGAzx/hBZWnXg8oHTfl9dcSpyUeGzkfSlBcqN00Bw+eZ/BGv11rcposxivppkHbATYue1BoDkc/HJasXjzC0ALYJRP/7/RWtDzQqpc1Usw/CwiEQLeXXpznFnd+p8fZ1b58LAqX9JDFn5aEQ32BB3TbjNOnAT3tJPEm51mHTl6lZd0lpsANfiSO8gzXfG4kuH/OHb0EX+Pxg3kmuYXkUet/5eo1aTEYBXldKyRtPAa6A15Aq0xKdGN14ypVHOSYSE2UyHvlGJca5/CCkdgaRwkxNJ5hNNKnu8ynrlCTYH34gVLoR4y13pibOiKbo+TOTHbpRJQTRO0Th7IbnQsKvsNpv3kwyGEqPlLcY0rX7O5jLEtGQM7Ckze1d1zqSBa68qqs3Qnfr591GTFHND3wlC4mefsjRIwZuXILo7RFTjwlhSIp5PFj29NHa/ECKtNGmrisQPwPPn6h0APej8C6i/jqVtybFWxQ== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e199f80a-a260-4032-c52b-08d88e029c33 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:33.9029 (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: UiBNcoVFr51rSVa6NWM8TZiKB75CcZNZZfG0X+6w1nno53ZsxMhY8ZNwwBOf2ls1w8E9GK9zQ7hEaj0k5+kizQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175234_730415_EEF48BDC X-CRM114-Status: GOOD ( 14.74 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 The domain_count check in sbi_domain_finalize() for newly discovered domain is incorrect and should be reversed. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- lib/sbi/sbi_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index 4c98a1b..ac920b8 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -371,7 +371,7 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid) * Ensure that we have room for Domain Index to * HART ID mapping */ - if (domain_count <= SBI_DOMAIN_MAX_INDEX) + if (SBI_DOMAIN_MAX_INDEX <= domain_count) return SBI_ENOSPC; /* Sanitize discovered domain */ From patchwork Sat Nov 21 09:47:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404389 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=Rn6wTtzA; 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=MANTq9nO; 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=u0mL6iKn; 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 4CdpbY1lPQz9s0b for ; Sun, 22 Nov 2020 09:52:57 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=NJkbROeUoW+wS0olw0SyQqem5L7i4CtOlaTaiflDsUs=; b=Rn6wTtzAOZd0Sgu6jYfxYgAgL sT9ieING2LPZz122WAyPjmX9lEWe5eHz/dcectMu/5brFPX4G/tV9/OshXarUuXkFElpyu3mRuSp/ RWduQgRoGrsgi7sIi6GM6qMUJelFoHYqB1c0jD/CJLxJx9vrglgLVqV/Vhci0lgAysCCwKWcirQBe Y5NCWKb7FgOctzjxFyypNym5LZrxw8PQlc0rsnUFXS95HTlD0wPnPbJhNveWOzT2kwzQVyVlyHwxa T6ddGIK8dlrbV0JtesaXXvVfMstsz4wq9E6y2AeObg2LGg/btL6G7TrG5VdXMm+2g9FSrhkxyD9r+ qz5KFzePA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkP-0005pb-1E; Sat, 21 Nov 2020 22:52:49 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkA-0005jO-OW for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:36 +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=1605999154; x=1637535154; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=A/YokwNpZv9PjH++b+jcpWVlsJpI/1PMjcvW/PzsPpA=; b=MANTq9nOmyY2VdbaYMl2esrHEWPYEAnX6vEb+N+IWOoogzpaKN1DFDl8 VoatelbzgutRMoyRgHFyGNKbjn0NA/2A1kUfiI0qHXPspuFKNT1WK9mAO UKkFyYqWIcgJhAmo3PdiJtjUQePc6TCbr3mLU/LK1ofT8fQxwwAokS2Sk 09gH1SCNVirTElq6o8mZyoaoZmTi/O2KaB+7q05R+zAEjIwIMniKY7owQ pnksnFG6IfJ3hUk2BxAiT9KU+X4fDEUIg+/KBYsFMJZzVCDM26O3keBSc pyU3R+Qq5d/qhtRMlWXMAl1iqIIqWD9EKZlg0bffx5wjGpP+c7r1Hn5JL w==; IronPort-SDR: LS2vA6ZYIJmEc32QgC2B9wbi4f3u72xrPecMOxVmZ4J0A3T/6lD48VFVFR9K+HJQD/oNuR3U/c KovheHdc95Vp2LZX4pehqt4c2Acv9EcsuEzk4qCXRqkNTk1pCqE+lNxTPxT6fN3Or42SXa1OSo gRAT13v8+HPSqBHq0YLzAwraV8ztWMha0GNiCkUeDnUwq54aUDEEw+jKK3z4bV4LDh2eN/Mw3G V2/JKWixrkdqUMSIqqfzPRoEVNGb73c+egaCdk07ueZwNIn9G7V3rkgq6sFQvd+50AQ1Jk6oME H3U= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="263192679" Received: from mail-dm6nam12lp2172.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.172]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:37 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nT/Fr3Ovuo4ebwbpGFRW3yjuGpM6LIy8X+NItduxqPY38egfabz/SUECfCaVTwJvpt3hx/X9T98o/ErbgmUV8/djp5Zu4+XO5l3/t1iMZiGs2qzRgE0HxEhzdQHEE8jCY8z/TqI38JY2tmKgm9uJkq4kVXc5u7HGNhb0xlEybYHTG4X3yPuwMlrzLG8ZCdKR+Vi3eHyexThrFo9NeAMfSpArdlwsaVtDGpIE6be4x8QzWeZKjx8nfOpmiR4CDuyRTq+41zsjkFRL5V7SP+4qk8HkjU8tlBv2bLC4oizS27n8ONd+54cONSyShkio4C8PUxAZKUP0133nOP+cGibgDQ== 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=CrWjRKVGj8kSKHEBpmbLx7CB0NJHIYt6k0nshe1c+P0=; b=NfhVu6ZM5IWWJoo4IjcPcdC8fPABGBp8eX2dBs03vPjEYGqB8vnj3DXMf/bQpSsuL4yUBiGdGv5mY8juNBu5kCiTqSEvFZyxWcIe2w+Ze/HwoG+mU4LZLEfbgbiDJixgzHJiED31XkxLKVNS8y4Cz1qWDqGtnp8drxu2cByRv07mMmVvU7KzW+GjcnS/5AZwbCS3qPytBcAn3TV4Sa/6sqZsrxEnLmrwZio+2TERtp465Tcvoyvnh7dcisBr2eaehxecycGz+Ym8kAfrmOZRAD1Gsa83eI+yOdwM3rGt0JtWs5Duq3juM0xjSVsDz+MU1l9+LpKczfUQHa6TYaRAXA== 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=CrWjRKVGj8kSKHEBpmbLx7CB0NJHIYt6k0nshe1c+P0=; b=u0mL6iKn7rn+OY6TuWRtO7S18hXpt3qcNone2UxTVBtmSSyCCBfDW/b33AkPJyzDvZwp6a9H2Mv50iWwUhOkpuWHVdLhGGOnelEDsqOg4zI+5Y6NGbIfaJCScNgulMjV3UqLRskgXH0jH+4kfPmF/+7bIJ/NMyhgQk64wL4oPzs= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:37 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:37 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 04/11] lib: sbi: Auto start domain only if boot HART within limits Date: Sat, 21 Nov 2020 15:17:49 +0530 Message-Id: <20201121094756.4154728-5-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7b70fe82-0c4a-4f52-cd5f-08d88e029dc4 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0kyIYvtYrbimfjkMlLrcmNYp5AGE9Kth6dRNxREfX73eibXzkaMJHvCBHI7ROm0Ge3NGa7YJeh+vqbPXZc2AdAxmsPYyYyN+E9H39WfI4i0PGzw06zK31luKjdhl9tlCal2N1C6GhRvp1W4fsVORGzUuH8vC0+mfHmRdc1PZ0PMCfzdKWO2IwrXehHaJVCh0E/f3NgabxLyyptFXMrETOkhf8UKUHqVKQu/ofoioUpYs03tGOT95VdCALen4XeIcbWA/1bcKPdlQajvG1M/sKnHfzt46NCpeiPQJ65rfnj7xRnTOjMONYTMgBC6G3oskg3IOQLTFlc9mbPZNjPy40A== 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(4744005)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: aXynk4cNwAqmmb0G3XoLBCj1aLOmSfEIYZ650la7nGVKgYgbdJP1FXfH5k7wsOVv3fiMnoQ9N8fMEInvXPSfjUrmn73tTyWsobKtnVZtmCuyWquRE1XX7q1iFDhol/VNOALkB0oaDIVyDFvFQ9rSiwkgwMBF+l/uz+6xIj2auXLkAFpSHjyUE0hLbatSMfzaX62Whjh7y96P2fZCEzu2eGDIBGXxjeuGlMCyX2hFOCzrN+CCvvE3ENBqwxM7UVSauiF1ysQapshvap3SeGj35OrzAE3vCeTnQeB1wADkFYVo7ahV+cgV9g9bSSWV/O0yllsIAghiiySA1MmmoluYSk5gZrc6Qj9Wd/A09DYpuYwFgZUM42NVUaKIw23FG/BYlftCoYtFDs+oQVaodn+xIPp03sXD8rt08TZhk3XZBd7J8/VWiX2p8N8vw/e6ffGOzo2V0DxSW7n+O5fHzs/h3agmIWTNZJt8eTFI/DvBUimQotXMwqMFN4crOl2w9k/NYlIIja5ca1F1QzOOpwcWXUSKzM/+Pvea7nBNxOD1bHcw4K29NWBWmIOz3JXGtlqNiGF1UJjTpOUdAs9UJwiosSth9qLC5rc6uixDBk0AhRbdZEfXdZFLhwe7+tKShPA/ojmfRif2u/fWOMQW3AviSQ== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b70fe82-0c4a-4f52-cd5f-08d88e029dc4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:36.6300 (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: Oco0xnahVIhzYHTXmIXAh1M97BNruRtVm+bH4/6ID2T8gvpllDRNwNCQF2qNKTl8/Ug8B1AVL3xFmaB6Vfk6aA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175235_021378_43A20817 X-CRM114-Status: GOOD ( 13.85 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 The sbi_domain_finalize() should auto start a domain only if the boot HART is withing limits (i.e. less than SBI_HARTMASK_MAX_BITS). Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- lib/sbi/sbi_domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index ac920b8..ecb098c 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -403,6 +403,10 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid) /* Domain boot HART */ dhart = dom->boot_hartid; + /* Ignore of boot HART is off limits */ + if (SBI_HARTMASK_MAX_BITS <= dhart) + continue; + /* Ignore if boot HART not possible for this domain */ if (!sbi_hartmask_test_hart(dhart, dom->possible_harts)) continue; From patchwork Sat Nov 21 09:47:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404391 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=mryi9hPZ; 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=J8xQldrl; 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=rHDw+Hju; 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 4Cdpbj3wMhz9s1l for ; Sun, 22 Nov 2020 09:53:05 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=vUxRFKUBRdq77kEVHKKNiIrVwfquspn0zHzGQSYd7Pk=; b=mryi9hPZ+/26KGlaZ+Sg+9i4k jBspjpy1CPWcZxYW+O4IfeYo8IDcGzp5GJvsBwgR0XofwYnhDYlm8KUJ5LjTCGu830c6a8M2lpEAz aVX+xAH6TOxBjEtlvTe7MFMdQvRJn05F5q0zoLuWzDCgD5cA1w5l2F9Shp9QkOPv36VasmOZtYmYN iLIzv8ojk9s3D2/aGO3UJCaMyQ4Rnx8NZ1js8NduYWks6BWxeaoUhHzIHCslCbbzKXkp8Z0xbpuld X3/8UVj93dgDbwrK7mkase0mKfmXdpuCuNZjSqRBfFNbl6xRQzGEBKl9W0nwW0KwBq/JP5zTUv7hX zL5wDInRg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkW-0005rk-Hx; Sat, 21 Nov 2020 22:52:56 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkB-0005jy-GW for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:37 +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=1605999155; x=1637535155; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=LtLK3k0QLMjn5mMQDxrwn220I73W5b4f3WFK+mWGldo=; b=J8xQldrlDmivNjHKGMvQD1ct6d42Z6A70x5GToeHpfjJjTXTCkLVERwP q/29vzQuwhOXF31Il0otMVJi/mUsty5DKzLfUbFPi+vA3jD4dbCh+PONu /4KzUOY5g5IYmZ8PcdQVWenLcV1pB5dFrkbJvccunGj6LLfKm3EX6Bo/7 tE0juve9eilAdzF1CeXIYKEWTexJG5ZeotVe60lTEOZxTs2BLadadVF8R 49z7ReGrURjUDvZzSNx/PyjofUeIydkPDl5s7Ck8mOD1jwX2LQEX+IMlF /Archpo+y2NOV+jyyOARvybiTBx/8ASF3ssTx+UC02AHdv1DGWE/BXNQx A==; IronPort-SDR: 917ybOzs4vveTncNKoGzy4U0rElBhSbMfd4m56UascXc12UCIsIXPEdSc5ugx8oFuw8K+eZ4v8 Ik0Fe9xY0e21RKlUTzouL/R3ZxxZ0PXzkkDjjEeL8is7C8oPhXcMT6py2FJpCBrY1mc9DwySjk MK2LYUtW4th33yhWma8fgUTsg+LCUC9Gl3TpqdBozFbPHn7+FUgSMHOvhrzRMj90e6NVjQRrWV 05VrqRbf3rul4WOUPhNv9wA5jFTemihTyyeWPtya1ak1flUIxeuS5NgvdJIBpM1W+UVLu+Fnzx SXA= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="153218783" Received: from mail-dm6nam12lp2177.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.177]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:41 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L134fmuDdXGJMKUeDt/WUYxYccRRHaxBgpXETKNJVo+W0lvJJJjfysSF1BnC8lf43UpTFYqjACGnXv9UYBwZtqlAsxFg3i/6300JrZ+26CXYDD7AW3r0A+A60g7b1HM+l5QXEIkjF7jzNEc1Dzkn900dvkQ5d9uqF+TyUdKYekyG22aTkjRKG5XW9sWg7s8wYzTT4Y+TZtn8prrh9M19XmBg9ZIaaQUFAoL05yGfSBSgjA0jQjvE1MoA5qehp28m84yvqTxShuDo1+G9rOUloh6X5dFy1v9RiAj/j352dIp2V3pSQGaHw5b56DWJ0akk9BFLxAliff56Wj/LapeSgQ== 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=A51BGd/b3fLVRPxVJF9W9nftgiQUrijg670ChnhRhDg=; b=WuhJEp0dFt6jIuq9SQlkx0VtX7yQsXj99q5kIkH8U3dywNaWxnEX4OQo91Y2NdvzSpw/QoVA3y16FZrzr1lagIgjmeas9SLNOFS3ndqBKdIVH71pYiciivz14R4Q0eERMfCTxn18P/uM0O1pNOV+b+NJa4PLV9jpKi08vW10ZjQ/eQwNG2fqtUq2hYHjYqhtfZEU8OrcUtGbykQCqjHyIVuboHklUyVzUlUKMtr/jldD9gFvY45NqquMm8iWcoo2fk8kfgwm9wCQ2BBwjQPyi7zjSxNok6L1fyVAQQcMy9eAaxAT9W08TBVd27ChFtVzGetof+gapj5y0d+DGTWUlw== 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=A51BGd/b3fLVRPxVJF9W9nftgiQUrijg670ChnhRhDg=; b=rHDw+HjuXJQxOUkxw06RbXHeU1k1Q/ced0jumVh4R7OfmVE7wOdG45ostY949TCeyyZHilXW+cqmSMy12lUgdQdA9Kd9X3h1eHlkLxrkUT7gvi49Ku3J+n0VIOcVx+YXjYUEsnhX2mXpK4/zdNLJ61GZzRdpl7Ou4p7hIhlPo0E= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:40 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:40 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 05/11] include: sbi: Use lower bits for domain memory region permissions Date: Sat, 21 Nov 2020 15:17:50 +0530 Message-Id: <20201121094756.4154728-6-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7d765a0f-c643-4373-0555-08d88e02a007 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:1284; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hu0hRdkyjvsKn6t59wGJCL4/o+cRhzDarW9OXy3JaTDxF3dyQGGwyfGo2P7Dn4D7bAIz8CtMoRxIf00Muf6FiqR4Rjxxz8nXG6u1/+OcHlf6UKzR0JpnDvbs8NXcMJvr04FPxfrJP4u7D5o9KVugb2kHYdKSPds94rYe1BJs8tgGOczgngRb6Pt3QHmkviIRlQmc2L2lBScgT6gatEZ1SgqkEN5fO+/dUqZAjTFW24+Zoupsjy1HdOdtyssy/iQCM3yrY0rwF9BSl6KvwfeqbyYOcqySlwlkyWgSHCOBf2I8UFKpTTVrl64EPnzGIvMdgqFphznoLRqwF3Xd/GtwUQ== 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(4744005)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 88+K8V5BCXGbQUC+ZHQcd5jQWpSUY8fm7+BRhAPrfU21ZYm9WQTURrQ2mTxC6Ray5wKgUTwHTIe3INmkfxcM5tR/ewUBRpFJWWdDhVr+NEOyGy8m4D6odN1zhFwJKkNt+CkOBuAWeaKHV4kqx44MUxDqLNxTIBGUo3OLPP5eEFu3fL4jnXAgyG1c2y2MRClZ/eYy/Q7zogS9+n7yoCkhQDh6bbby5P61C3ShuGdDxtHNbNlzLMc1v5M0T6SwhbO3JK+v1svTgvo8Irk4Cl/CxzLzdGItODmrhE3CiQJsyNhljR7IG1zJnJiQOGEe8oF1gcH2Zlb0+j4HFsvOkBhLEqgV3VCwtLt9t9ea9dVytypKB3ySqtB83Hnq1//U6cErovoyl3YinijiaHu8VgF/Phce8NICzd1Nav0JmJdmyFhHR3zgXeis7YEbh/dMmFJHChJ6Ey4IGkX68U9+/n2S9yu9ZkRK04AOBbAmDPQL6Sz5narpHHm+iTYUGSLN1uUghenJGQetcyG/9s2xRPIEoyyKatzZado5TAyskDU2086Oxpuh2QPg0TeswNebftEH/gkG4oJmHeo4CHyFALqg43D4vvIEsVtMYiT6NQivPi73WlY34xGIYpmSM0qZQZwsQFrjt3/1piQWyBIqJG8Osw== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d765a0f-c643-4373-0555-08d88e02a007 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:40.3465 (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: ablBHfLU/9pEGy970rZJc82pE1u4wjYz4J2GgcC9SUSnel9HG9brNrQUkyQ9md+cbNH7sz+WErxw1gq5LYs+5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175235_858527_BD39E5E7 X-CRM114-Status: GOOD ( 13.68 ) 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.153.144 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 We should use lower bits for domain memory region access permissions and higher bits for other domain memory region attributes. This helps us use same bit assignment for parsing domain memory region access permissions from device tree. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- include/sbi/sbi_domain.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index 6f90b26..a7cb61e 100644 --- a/include/sbi/sbi_domain.h +++ b/include/sbi/sbi_domain.h @@ -39,8 +39,10 @@ struct sbi_domain_memregion { #define SBI_DOMAIN_MEMREGION_READABLE (1UL << 0) #define SBI_DOMAIN_MEMREGION_WRITEABLE (1UL << 1) #define SBI_DOMAIN_MEMREGION_EXECUTABLE (1UL << 2) -#define SBI_DOMAIN_MEMREGION_MMIO (1UL << 3) -#define SBI_DOMAIN_MEMREGION_MMODE (1UL << 4) +#define SBI_DOMAIN_MEMREGION_MMODE (1UL << 3) +#define SBI_DOMAIN_MEMREGION_ACCESS_MASK (0xfUL) + +#define SBI_DOMAIN_MEMREGION_MMIO (1UL << 31) unsigned long flags; }; From patchwork Sat Nov 21 09:47:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404390 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=QrgOkiya; 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=Y0mHt7ZP; 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=MOlKq8Ir; 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 4CdpbY50Xsz9s1l for ; Sun, 22 Nov 2020 09:52:57 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=RVyKu4TCmDzGUqPuXYUDeoPvvJ2gsf8L/acKrKGhSi0=; b=QrgOkiya2L7rbCOILKKASbkaR C0xoiOTwU+j2rma/CjGozDWSP/zn54vcfp1N2tVGG8HoECApgRC/TbHSl2+SjqOC/lLVcnponiulm QAM/5m4/CNbDB4gNDv0SK6aB6/gTSeLM2UOE4H73C84iYiWeqp7Rov5MXmj7+McJ/WCt0xfsAXYPz AB76kxI4xmacAq/5k5iMM4NeqxbytKyAhcTU0IU/TLKxtEszHT27fif74nJaBRfbkJXtlvLZtv5kT uKtGttqGc9wUh/U7xD8EgaUTLkdCOhrBKgjJxnZ1GP/wCYRZOkhM/ZlzmbqbjgkZFGVIr87hUcUTz /imKxnMtg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkR-0005qF-4i; Sat, 21 Nov 2020 22:52:51 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkA-0005k7-U9 for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:37 +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=1605999154; x=1637535154; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=EU7LeASZI6qXZ51DxIvWk++CBv1BAAmZiwT5KKwU5lk=; b=Y0mHt7ZPEvGCHaKwX7/GB//tWjpojqunh/B31BKaZKTon4Zgp9lHv1ws hz8cEEuDG4bLgAlSJwQTC2fFzPUAYanV5VoQV8qySatpzG/jTYUpdK/W4 DpLfl6HoQ17nrxTkit27I/pmylbf5Wz4FBkl+b3nvpwcrkhGIo0+0mUwf 7yeJNKCSItJxcgMKInYAyKJ2vca3UNPemoNy9wJjEGWMmiunVYSynRMir ERAySFHyI/4TW8YloHkqKKZU/R5WlOZi3UZlskqw6UYtWaZ+YntkQVWbg 2ojkWCooLYynK0PxDRbc5uOQa0d30y4vfOrb1+3jxdoSbujjwWq+VRs07 w==; IronPort-SDR: X4pjSbFJBupY53MtnTu/Qjnrlu3XK996oj4ELcSy0mcnO5t6z2lop9e3/a/Dc/mzlES8wH2cS4 ZsQ5f9etQLyWPv0+93a5Cblt6FObKWu4XLdlGbvT20rPUq716dYs68B/UtEnI5UFebmmhFFCzM WJ7eDy/lNuMGGYTM2r+ovyuufZrV4RpnK3xgE+p78X3032qG31ocxCx471ixW5jjNlJsz8JWF9 ln3pElsuYpk+DcuwpWPShr96/i+ODKqQvt19/nC3n0irDFhIs3s8ITQUeBluxKuXFHL8UHT3zu MHg= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="263192683" Received: from mail-dm6nam12lp2169.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.169]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:43 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=asSrtU+A7vwHuMrKjDIc3nPVXkLlMS/DGCOGeL7UKTbnXfPevzJXVoOkkBB2kFJp4Gxa82T0C18sC0MEC6BMwkpbGbdV18EdHreDYHkHP9wlKsmghr+ZWhtw4H/VHoMLA4NVwHe+3uM2QUEErjvx3cj8ffcYCHFTSJEwBYl9fQQIuL3mgsaecB1e7PO11n0yip56rOekO8Gr71iunKVjNurPQB0l7cRJf5wkACdzy4rzJ1lU84HJix/mjqDczBzWEt4dwqKTiNNwSObrsZt3sOpUaqIyiptfezi8Ev8wjEn232dY/81iWmB1/+pYQylUK5YUzs7emFr2+Hj1a3oMCA== 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=GP+q/oiDaemutsGSbJGbNeVdTK2/yQ1Yg0710r6IUms=; b=YL+vy+MHeYIbGKVLqXmhfwe3PV9AWoGhb+DQ0p2yTigU5bi2chIRc3sXZqhIHc956H8rP46bjYg7zw4QSmCmE7TzDzjfMaWAkRBm8Q4O4HCY22PUUFg3UPCgGmpXn2tPQFxBFG8a2j7sbtvkvUSRb1xg4+Y49xasHQ+y7OFEnbG9lIhU9VVLi0Ro8HIkHp2Qwzntkt5Qxw4RMdHe8iiru3A2+N3tpfxp3ypLjoJKarMa72tuspvQRCUJkGCYbgMnP5dv97IaSiujbzIcUwcZIzd1/hoorjbX420jjD+c7cqAky3+mSZDMMIznjlbtFpS0GGrZH5j/MQZ0z9uZnIuKQ== 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=GP+q/oiDaemutsGSbJGbNeVdTK2/yQ1Yg0710r6IUms=; b=MOlKq8IrK2rJ4wIMni3MSsQf/S50qeINPEewc6gojqoC7Py8MGT+xbThCnoSNgaXn9IlZiF/iteugYZ3cerjoqJSLveLCXbLs1wAgASxFtlLUBRLTcErbPAarPmbnmIdv6Qkd/X9lcyGFa5/QvGGQ7PAqUJCv6H4yCxCAtfR03U= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:43 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:43 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 06/11] lib: sbi: Override domain boot HART when coldboot HART assigned to it Date: Sat, 21 Nov 2020 15:17:51 +0530 Message-Id: <20201121094756.4154728-7-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ec0ce5f0-d6ff-4a3c-a471-08d88e02a1a3 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YRqFLxNL2ImIZtgsN7vzVrJCf7TsvDXMR2MQEeAv42B3A2Ox/0lZchl0iaEJrzcocaZHYOo7eUduCD5a5jG8/d7akxZyxBAX1347xzULbonhqxx6AF30UZkMTzxiihmLJQHEwrCiW+jixgRrM+DSZISF9VMcp+1t+e4X1wX5LL8BYSRY42GodKBvfojY2Ng/3biB7FmHTR9S+iWo1YczxLwXTIPTq0e80Kaze+C+LSyP8U4MdLCZy9LJufbwgRRH+/QtR8htGy/1inA7ofWO/HnzO1Vgq7qwe68rdyl00EfLAUsevVzjCi7T9e1+XBnT 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(4744005)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: yFbWCVUkA2y9nWoyx0ylN29+qWQp/pVUsqpCmhMnpeW/aZRNEEh4Z+7noRKvzkKocchN80yrjAIGWlDUH+Ha3JMCpeUS+VVYoVZb3QMvboXyLpd4orPu23uAWAmwOgwgUvWrbt9Sc/BTSRNB7gdXsDWbqIuJqbpdYx1VehonR9g0BMERd0VIz7DH3MmaDCQl+Cx27GQt7G+UYO8eyxCWGgysPfo0+m+jvXrdtASw17JY6HVCqrlsY2yLnZYmCimyo6TVc4sLMVgFkEk1U7nCZt4wX5jCmJ5uosZGeorwVgjdXVlgxaaI80t261zPeQ1yQ5Rw8ZgjunGwG7kaq5K/clkKphxt+5CKiK/jCkJDqeZDMDgRw4VPG5FQq514/uayzs2jomn/VLecr0jVwy8d+Up7NRxy/iGOYJu4l75qdUoUMzqv5wDEPp1G3oI0X62h6316MT4EnrQZ29QOWIoCtx6lMZTCwdxHWoaA1dSiQzKlpQjKhb6bVku+KiTBtRsUu4sDxheZH/m/AuQAtIvBvNnuWhNiNtWa9PZiPll01wh1difG1q+BXIrGF6nUpbeAl7x27o6nI/wwDEn1Q4ZPcVnG1qSLsyie/kexDXlgf3sdq1+6ZPGHlOCSr+7DB8XyAFfpzgQ9YRSUWqNdtjBz/Q== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec0ce5f0-d6ff-4a3c-a471-08d88e02a1a3 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:43.1746 (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: CNNnEJp0NGCOoNPvGAcnk6LY4Wi0sSGl/NM4DIEM7cW8jjyY1SotUykPpNBxEjEB6GPyOPbtvZK5L53lzbpKHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175235_263209_2A179998 X-CRM114-Status: GOOD ( 14.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [68.232.141.245 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 If coldboot HART is assigned to a domain then we should use coldboot HART as the boot HART of the domain. This allows coldboot HART to continue boot sequence even when it is assigned to some non-root domain. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- lib/sbi/sbi_domain.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index ecb098c..1b50604 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -395,6 +395,17 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid) &tdom->assigned_harts); hartid_to_domain_table[i] = dom; sbi_hartmask_set_hart(i, &dom->assigned_harts); + + /* + * If cold boot HART is assigned to this domain then + * override boot HART of this domain. + */ + if (i == cold_hartid && + dom->boot_hartid != cold_hartid) { + sbi_printf("Domain%d Boot HARTID forced to" + " %d\n", dom->index, cold_hartid); + dom->boot_hartid = cold_hartid; + } } } From patchwork Sat Nov 21 09:47:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404392 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=pagGIE/l; 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=WR2trywz; 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=neBgURBm; 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 4Cdpbk5ZfLz9sSs for ; Sun, 22 Nov 2020 09:53:06 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=zjIqxhP6G6m/k55HIGU55MIViqKzvqcSGHcb/TF3+Fk=; b=pagGIE/libwhwu4lHa4im+Gn7 lgl7in8mmWTCkGnU0mNUmibIUb3EECs7m0kerdoBttmUOw+5QBT361f+KAm5e50G+oaAVH0flajTz G5XxKkGeyqWRE+ug7g5M/eVAOZsLqiYiP5EkcnBl5wOr7/LV9AB6leO9q3HCy2N8ItEuGntyaO5// ZmZ6QRAev4rg0bLHvgjftkYm29Hy4dlFotnofG5FU847uFueObnqMWN0AS1m173rjaP0ehd6R+OKy kliQdMuh5/4TUKzR7iaCCWjFBMi2ixZ5aCpWgYNKCOQ8wPqMDxEjuiW5srmMwJS3WoZCqVNmzchAj 5H0IaIzdg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkb-0005u6-C6; Sat, 21 Nov 2020 22:53:01 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkB-0005kg-KN for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:37 +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=1605999155; x=1637535155; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=6wzoOUmASS8jRz6ewOsnRtK4tSr0X8RMvVktq+POCvo=; b=WR2trywz4g7ponbM0LPYLTZjzcHQgHxX+H6TRY7ZMn/D6vagqwwnZf+0 JffT3aKvdr+jzCxSjS/35nWlfxqCcm9NY8jxQUEOiI2km54YDpJrqnJHX +SDNMTAVmvj1vbl2OEfuMl6cU+wGfemAGaHrdSZX/6UaolkwdPwFfbpt4 54ZX+Wbku5CIPtWQ786MSfwzcct/rog9HIzyO+xG4IZb+PytKOO1+NrHg b1KoQQ1dutM87jZUimMA/nbFUCXrKKEm7C/XeuYInXE6z+Q1Ecu7/b2AU uy5MiEgcjpwIJZrk7i+9KFQmxi4aVg2KEaLwMnB+FZ53Wp1yFpHKvfZEe A==; IronPort-SDR: 96NoFVo0S5s3MvBfvjEeaKbl0wJZRqCJQpfuLVDOV4K18zlZdsg41yZVIEwuUEst37aiz6LbSr abIQx5OPumRElB9M6+ZmKpQF33E91ed56O9a3Pvntwzha6DZ3cfDIC4heJsmYlenizJpFuP67L ZJL5TbZvzyYSHLI9ZI/VrDDhTU2b+l06S/lq1Xlx3cxL59b2c+64Zgqb3cqr1w9M/6gKLNEnfg gv+4hM6KTdvCy/+MQlKTr64uVWnvBTk4zOFuaNmnsVB0BgInsUJE4jWphwkGRDOiWNJI8MfksD x/w= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="153218786" Received: from mail-dm6nam12lp2168.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.168]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:47 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mIcYcjZHwWqKPoC31bpxdA4JD1V97Q7rRtyAbZFSAzSIpIOEEsFQ8/yMEuWtdWC8V/EgWo1JNK2yBsZCHXt/p5jUWbYxyLk982Ced2xX8V7ad+S/veFZFimyxJnVJ8BXlHQuwgU28yekLeQmj3XVQgsIz/hAS6lqBsVR6CI5cFaBG2vsFQIxtj8mJC0au5OG8lDqvMQtqz8FdoVkJwmpUKBgI7yK0R4/jIKbdMyGXZc23010w9vrJUzxBblbCB9cSo1KqsSp4GpS7PpZbWQR5upancuUCq0VlewQmVhqaVYwOpi9T98kySYsDieODMXKdQuFVOM1IeJVxmX+WGZjog== 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=sQYVB4IXueW5Jb7ctUhuveOrLbw1HzEYv1TlVzskF+E=; b=hdXkSvEg3TWDYRPB8RFy9k5VsnVWXXEaWOm2r8Woc21qHPQDpA3WL/H79kVhRLOjDOI6zs4ThuwVfp79evsfLOjCOyyCR5RSXdVTW73Mh8maONZ6bJH0VfKB5jsrrDqF2sfOCL93FMDwjB+Xifbw3xJNwmV5iPWVJhZ9T6gfMjqkdVGIZGp1QViVWFnBVeRjqpYacywuenpA8rpIqWHybc5HC8ujqlVHGGjXj6s8HMzNAyw+4obANCOkTzZfI7CThF5AZWiSM4XYpl4MMEHJ5MXmdfdzNLV/c36Ipy1RBjIJHfdccSUjx/B50c/gIKWdrDP8Roe3prD4CPgrxLy3Fw== 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=sQYVB4IXueW5Jb7ctUhuveOrLbw1HzEYv1TlVzskF+E=; b=neBgURBmvrYaIJZVnPXxIR7tn5qMmelfbHZeKCvTtys9VmaHp0g7kJ1YnZiq7AXilQ1vYglg5FuVg6DiTos5KHaiygv7P02E0hyCrw73ZyFKGwSsseDZQeSQ5steFczhEz8yUUp4WAAsOgHKRDBo4zZ6ay2yJ1E5umRVExMnLYQ= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:45 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:45 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 07/11] lib: sbi: Add error prints in sbi_domain_finalize() Date: Sat, 21 Nov 2020 15:17:52 +0530 Message-Id: <20201121094756.4154728-8-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e86b89f6-be1e-4cba-1648-08d88e02a354 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:107; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mmJvX7ZZZFGFmfi/6hTA6CM1isVOr1kGbuPRhBbSm2QKMpRex3oZcjCTbh5TZ+p9CCTHBuSngs4A5W2JfG3hObxIOYxYZ+7queh9CP2sgNHfzVE5IALDIEAidzg/IjC4Y9mO+jUnivMFy5EU2gm3zoX12W7+7RpoUm9tpMf7tn3p8qnZROb5SDXr0RvWadVlbFTwz+i8raWjlXdhkJ6chi50udeS0qYs2ouCPlHuCRZGW8rs5kN+gNTGXl0AEMFtnf1fSPSFKiO3dXBuH1mUkEBm8ocs7iTOq+WAK712jYoCGRr3lT/aM6iGUDMUSRFBoCBO239VJenIZdNS3B3naA== 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: n+bn5yIuFNY/TWWKRODOXgwDQ7hJEI3kMHUmxg6ZAe15R+5XAO6kkUADLCWFfZOtUrtbBVN/LCzf/nizBrKYiUbODW6aKzgoVzRHZ/nOJrTYwT/f4ph9/rtURYMY+Fd1oSLHhgnc1rrZ52S3Z/mcHXyEy/GgHv9mwYL0Az0WfrvCG0dvXXU2kTJIhvS+YnitryFMlsEH8zBr+aEnO0S7/Kq/AJRlbohLbj2FyCvrZjg1u/v4eq1oY20vUcRhl642ZXCwKBsnl6V01YFNq6/htA2FtbQK2wNasLCEtvpBWcFCTKBwOosDXv8Sxp5H5QwUvuqTjYv3DX/RKdMaT0Z/8S/+Yzwfvtzc5QO3YkG9vB0r6aNlXAv5aP7okcXxMGIOWIa1qk7sDx9weUUm4k/cWPBDSXgzCdaFI7344lYcdbWIPc68uM02TpaTAguoIPSVUHBx25RqWrJdtNdkBfQ9AyRj1fM7KizGShoMr5oQ62r0svl/RYKryVemWprsnMdYDIuSsmXIvGhmuejORMD4714IUzO7u140KifxtdfauLu1UrVmbrpbYrGB87h2LgYIG5rwiWlzarrk9HqWzTioDL0dUkhfLHnX0VzGS7Bpi9HvPaVXdZ8OA/YTz5wylUEtPBW/8sB4c4z8EHh02fJ9gg== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e86b89f6-be1e-4cba-1648-08d88e02a354 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:45.5340 (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: B1m38FL7kiWnBQWWMXGjdhNhptztORsus5KYOt98dgW9PjrR3JC5E6r1cCInI4DxHte9qfx8ut+2VMvL+Tvgbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175235_944601_2BCAF324 X-CRM114-Status: GOOD ( 18.23 ) 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.153.144 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 We add error prints in sbi_domain_finalize() and sanitize_domain() to help debug domain configuration issues. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- lib/sbi/sbi_domain.c | 63 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index 1b50604..639e016 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -174,19 +174,33 @@ static int sanitize_domain(const struct sbi_platform *plat, struct sbi_domain_memregion treg, *reg, *reg1; /* Check possible HARTs */ - if (!dom->possible_harts) + if (!dom->possible_harts) { + sbi_printf("%s: %s possible HART mask is NULL\n", + __func__, dom->name); return SBI_EINVAL; + } sbi_hartmask_for_each_hart(i, dom->possible_harts) { - if (sbi_platform_hart_invalid(plat, i)) + if (sbi_platform_hart_invalid(plat, i)) { + sbi_printf("%s: %s possible HART mask has invalid " + "hart %d\n", __func__, dom->name, i); return SBI_EINVAL; + } }; /* Check memory regions */ - if (!dom->regions) + if (!dom->regions) { + sbi_printf("%s: %s regions is NULL\n", + __func__, dom->name); return SBI_EINVAL; + } sbi_domain_for_each_memregion(dom, reg) { - if (!is_region_valid(reg)) + if (!is_region_valid(reg)) { + sbi_printf("%s: %s has invalid region base=0x%lx " + "order=%lu flags=0x%lx\n", __func__, + dom->name, reg->base, reg->order, + reg->flags); return SBI_EINVAL; + } } /* Count memory regions and check presence of firmware region */ @@ -199,8 +213,11 @@ static int sanitize_domain(const struct sbi_platform *plat, have_fw_reg = TRUE; count++; } - if (!have_fw_reg) + if (!have_fw_reg) { + sbi_printf("%s: %s does not have firmware region\n", + __func__, dom->name); return SBI_EINVAL; + } /* Sort the memory regions */ for (i = 0; i < (count - 1); i++) { @@ -208,8 +225,15 @@ static int sanitize_domain(const struct sbi_platform *plat, for (j = i + 1; j < count; j++) { reg1 = &dom->regions[j]; - if (is_region_conflict(reg1, reg)) + if (is_region_conflict(reg1, reg)) { + sbi_printf("%s: %s conflict between regions " + "(base=0x%lx order=%lu flags=0x%lx) and " + "(base=0x%lx order=%lu flags=0x%lx)\n", + __func__, dom->name, + reg->base, reg->order, reg->flags, + reg1->base, reg1->order, reg1->flags); return SBI_EINVAL; + } if (!is_region_before(reg1, reg)) continue; @@ -233,13 +257,19 @@ static int sanitize_domain(const struct sbi_platform *plat, * protect M-mode context and enforce checks on memory accesses. */ if (dom->next_mode != PRV_S && - dom->next_mode != PRV_U) + dom->next_mode != PRV_U) { + sbi_printf("%s: %s invalid next booting stage mode 0x%lx\n", + __func__, dom->name, dom->next_mode); return SBI_EINVAL; + } /* Check next address and next mode*/ if (!sbi_domain_check_addr(dom, dom->next_addr, dom->next_mode, - SBI_DOMAIN_EXECUTE)) + SBI_DOMAIN_EXECUTE)) { + sbi_printf("%s: %s next booting stage addres 0x%lx can't " + "execute\n", __func__, dom->name, dom->next_addr); return SBI_EINVAL; + } return 0; } @@ -371,13 +401,20 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid) * Ensure that we have room for Domain Index to * HART ID mapping */ - if (SBI_DOMAIN_MAX_INDEX <= domain_count) + if (SBI_DOMAIN_MAX_INDEX <= domain_count) { + sbi_printf("%s: No room for %s\n", + __func__, dom->name); return SBI_ENOSPC; + } /* Sanitize discovered domain */ rc = sanitize_domain(plat, dom); - if (rc) + if (rc) { + sbi_printf("%s: sanity checks failed for" + " %s (error %d)\n", __func__, + dom->name, rc); return rc; + } /* Assign index to domain */ dom->index = domain_count++; @@ -437,8 +474,12 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid) dom->next_addr, dom->next_mode, dom->next_arg1); - if (rc) + if (rc) { + sbi_printf("%s: failed to start boot HART %d" + " for %s (error %d)\n", __func__, + dhart, dom->name, rc); return rc; + } } } From patchwork Sat Nov 21 09:47:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404393 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=mebPntwC; 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=kSj6/H9N; 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=ZtRUrlnU; 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 4Cdpbp3NdCz9s1l for ; Sun, 22 Nov 2020 09:53:10 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=xjY+RXPnTaBlouqSBgiG2lFv9Os5hmxe91tD2sgeGlA=; b=mebPntwCoeiRJHQTR9sUQF1rs ZAPKWXd8P78ECxqx+t+bxDJmOnkedpBoP0JFwq45UMWIcypm/xJxEFyGJklnbA0DXogxj9aU605Lr DBwN5G3LqrJzMyK10Y/vPT36sMVYTsrEcz+MH7bYak6YDVdpHZ0vG6J/1QO3mGtdc+AMNB73Csrcc 0wzpNyg2kgb/VHQnPSLqLqRPaFzWgB3NjmQSWg1ny+vY2z3geDfznXql7pLtV7Q35TQJYbPrsT+w0 a7kR3u68V3/KNtHshWfwoMapnXPHjlpVNN4eJh7KSJNio9mtm2H53F5EclGYdJvTrLBRkzMLwnvWP HtcTXc+Lw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkc-0005v5-VK; Sat, 21 Nov 2020 22:53:03 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkD-0005jy-QS for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:41 +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=1605999157; x=1637535157; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=WleLV4IUZNj0ijXoAE0cVFxR9U3Tdc02gk7RUYH1UQ0=; b=kSj6/H9Nanb7F3kRg/vRekPyrKJajHQD5VUKpeuGKNb/0Lec71IpyP0w MAB1z0yB1hbxo1ZSwHmZkLUKmvUXCfQHPB4G8fMiOtKGRoOp/CnrgxF9K 7PfCHA9JUhK2DKTZjBI/u9yxva5kV6DXjgyiDgPgn0ggmqaznfpfmMtd8 pIEbvSHCuZmrgzgt/enE0Vw5V5jJG1dNEAzeAxyVKzNpgVjOpP/RTwrxL aOwPmd1UMYZkJZEK3H8yCCK22h7EuPc2ZUE/r57Yn4k4cYkLr4Jw9VZCW ZZCmUd0OC64bAxFrK3WNoT4zl02rdyapNcOp2VgjZzax6xIWCFvxS4EfU w==; IronPort-SDR: JIHmAKKOzQZULhHou6mgRHPQahwXX9oqXZMYCOr3fCoOZ5AtYeMtqZ2XMxv5K3EugZc2heL5wb CuXN2k1ZCxK3FKTZrjxQHZD27HRSCSf9prdYsj/MkZm2Mf8CfUEBaDZxdxoMqjOFCKW6abP8gK 7zY4q+4Ti4K/cQiTgUenJ37PIMfKdvbLsCCG09ZXFpl/gmLf3zPKjZFaP2sH1GmFhAhIOtSAP2 nQ7Oa3W0RPZ9VvqGVIYF3ZL+l1ceuyHv3bOoZC7XRsEHF3PNkDKKWLa2eHihf+fhyJgz5mGwAu +ao= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="153218789" Received: from mail-dm6nam12lp2176.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.176]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:48 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RO28z18+R+CVnyfjlB/DFnAFCoYPSzTyebE/PURiQrzpSD72UtrIn2TwMVD/t1L+OYqHy4FS/7T8D8Yzwwmd8jGoRYTxMMctP7JANgy+SFJYWVVctbysF/NFUdjD0JvxEnmCPE73i2Lf1wgGLg7M6GVj8IM93I3Mm6BWVqhgdZ/8+m90C1Cf+dTQJK86tdDY6eDiKfxoFoVvXh/AGsk+BdL7MTsqmnBh+4vpRk/klxbbkcH8RA2oQKn+52mZBUH3GIejHISaEr3XZq1hZhk6dV8iBHzlKCxSkGl6znaqGy6wcBm+tL8+GkLGhYVFiOtIaQkGw3v/s8UJD9P+dlSfbA== 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=epL3xSAad9VeY0+jnQ1606AQzGIl2wlkpNpcSwCEyqQ=; b=Fr1Njz46MHO4swbBP4NwLmg3lI+Xb3iCM3o+e+C67Ti+TKVsNdVT3E9tlH4IZdoFekxTcQBHksbM7Oos3ElcLfjuHhsuRuwa5vNcHKkcBakvbiE4TV1Y40Yq9WiG1uKjWtYabLEa3C5My+faU03OZs6kHh0+nVpBUu2V7F4TSr0rIthHs+ySq0AV/n9OmXv5085RMjNz2XelRLxkCScpzUYOHI9hZjgl69QOboeHg9ST1o+NdNJ3tnXKZvIC/s2dUXpuzpe8E1AFuV+5T8qqqHDlsiwPZwq5rSyq/QS6KQmCFLgkNf6gcmlpsFKHitY+zYP1YlFx7LLgmQob18Zfzw== 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=epL3xSAad9VeY0+jnQ1606AQzGIl2wlkpNpcSwCEyqQ=; b=ZtRUrlnU2ok9SG8FW+AUSJqtZVHgCCJSIhwNUM4gIyZVNY3v0pp14KBd9kHRuxWsL+nJwk/qN6ZqEkiKmZ1Dyvz58Wu9IH6GwZqGBJo1U12xLTUhPEJwzh6tR1Mw77xi8uag4y3+Wdy51lc2oqof0xFc1GhO/7Mf+vgssL3drUk= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:47 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:47 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 08/11] include: sbi: Add domains_init() platform operation Date: Sat, 21 Nov 2020 15:17:53 +0530 Message-Id: <20201121094756.4154728-9-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e92ff299-054c-4392-12d3-08d88e02a4ae X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d1FkfzOF7nlolXBW7Det4JlBuSW1Gjlg5ofcdNPhvEd1afsskr+U3j92I+NJ3LqDIIpJWClH12lVi6L4A/Tig5ym3OI+tC+PmTo/22fYYUBH3sWqZ5bMT6adNbGe8mQM5MxoJUgJRkVoBbsNCmawbiFKLfRl7sKMmALuMo+/t/fy6aIoatubRC6tg4mDnCHjlnygpYIBRYWpbWzYi1pECSiJ5Q5YzSpi8rDHs41xSgJ6q+T5eIZnndxJQVaMiJjwwcBjGsXMgPFbfoz/3/8+JipkyZ8hxzBJlvorxAtz50u71iIjobEOS7GCn4L/Cf2ZNYqSIh6boVDYOwo298oiIQ== 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: x7Fcsexl6f+SmKF4jcGOTfbROdYVMTGrSNB0L20aiRwvogyUvbGMd0qf18ryV0xnvSbq11AuiDi6VLaszdv1aBFfKIRIJv7P46qqIt3KP5MqqhTkMZy99jEi5/z6rgBW1M6Q2mdjCNKf/Jvt6DfXRBtfFrS6+lFKUV74WNRcJTmK732GrDvGlYdoT5azS4yMV0tcIZSrGMzvPebZUOAoARmlSwm275qL+syAbAQHoosJMELnB7Ela8VFuiYPqfuA5w3YSfJLlqTmbTL9aptCUqtsngCsT+haJhcsB1LcN00yLzvldbPtq9TEEYU2Cg5BJz03T/Jb6ZwYnbajTD6OvEKoZ19A9k8QDgbP4aoY4Ix0gP3v3qaJwAROnpQ/au1Mj3dL6TroW9nahBN6Moj/iAwh+kkY6rW9lQQBobbHIDx9S6aTTd/Zf4XP6tJGQlwwx6711v1RVc160+Obo3XnhRCQF1JEBVB2n8htY3bbVxgwAatubVSFzabgNqG3bwIChprYNGa7llOWlAva6zRpVoPtOhIkJBoIoOglaOwN15vaVrpNw4VXnG9azWd3PILYjHGwL9blegR3+2OhprMruzY9/odi1wx2gPV0ZhRCXUZNTTwT35Ibe0nkYnOR/g70OhRx8f/iUrXEBaNCsm6jNw== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e92ff299-054c-4392-12d3-08d88e02a4ae X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:47.8454 (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: Dn1NvA1m/EcDT8pDxwLv12177h1+43rgs+DhGrNp6++AB8kiFsyMHVE3353E2JSetbqRP1Pbv1r+EBSwfEda4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175238_859490_9E5F9519 X-CRM114-Status: GOOD ( 19.34 ) 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.153.144 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 We introduce domains_init() platform operation which can be used by platform support to initialize/populate domains in the coldboot path. The domains_init() is called late in the coldboot sequence from the sbi_domain_finalize() so sbi_printf() can be used by platform support to print errors/warings at time of populating domains. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Atish Patra --- include/sbi/sbi_platform.h | 16 ++++++++++++++++ lib/sbi/sbi_domain.c | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index e1355d8..7a8c113 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -90,6 +90,8 @@ struct sbi_platform_operations { */ int (*misa_get_xlen)(void); + /** Initialize (or populate) domains for the platform */ + int (*domains_init)(void); /** Get domain pointer for given HART id */ struct sbi_domain *(*domain_get)(u32 hartid); @@ -451,6 +453,20 @@ static inline int sbi_platform_misa_xlen(const struct sbi_platform *plat) return -1; } +/** + * Initialize (or populate) domains for the platform + * + * @param plat pointer to struct sbi_platform + * + * @return 0 on success and negative error code on failure + */ +static inline int sbi_platform_domains_init(const struct sbi_platform *plat) +{ + if (plat && sbi_platform_ops(plat)->domains_init) + return sbi_platform_ops(plat)->domains_init(); + return 0; +} + /** * Get domain pointer for given HART * diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index 639e016..1a3651b 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -375,6 +375,14 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid) struct sbi_domain *dom, *tdom; const struct sbi_platform *plat = sbi_platform_ptr(scratch); + /* Initialize domains for the platform */ + rc = sbi_platform_domains_init(plat); + if (rc) { + sbi_printf("%s: platform domains_init() failed (error %d)\n", + __func__, rc); + return rc; + } + /* Discover domains */ for (i = 0; i < SBI_HARTMASK_MAX_BITS; i++) { /* Ignore invalid HART */ From patchwork Sat Nov 21 09:47:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404394 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=RjkzvWDE; 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=myOwwC+l; 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=wJrZU26/; 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 4Cdpbp3fpcz9sSs for ; Sun, 22 Nov 2020 09:53:10 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=2mvRm51ZsY/iD0VVF6Yjs5bOA0IxcW+P+DIWt2JXwK0=; b=RjkzvWDEiZN2UP1iOOb+ldeid dBBimYO8lEh7UQ3bj83zCuFWmzBWXrLC6lTi5FJGOyLyqMttz8WoUgdrk7Qb9AQgjYLkPvXn3kZvL EcTcVryBaTfh4sUA1Mr++YsJ2VLBVV4ZWCOlZV/vasV/EqOuqxwRMLS2UsEg0lGiqO6wu2wDpILHO FT02hyqep5awIo9h/BRP3dYXV820z4tTuCIc9eRi7730fQjBu+aIXYzLF2v4NlzDR+EpupKMaOgvc SGJkb+nvaVTm1NmRQnqKy4Mq+MsqXPv9adgejP3jDgIUK/6dVZaOjKk8Nr8LaHa5EAOeH31gl7Wex vGdwvNREA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbke-0005vf-5k; Sat, 21 Nov 2020 22:53:04 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkD-0005kg-R9 for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:44 +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=1605999157; x=1637535157; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=6aLsgK07tZDehX52ygjlWPMaRlIJoItR0Pw7hKP9lUg=; b=myOwwC+liFtlRiKOyxh4NnTFz4y5C7wALF7GVmfGqtH0iRMajvXsGPwY w6UjBv96ZJgSpIvu/NAf76xPiOv04UjK1eZnInzKFOgKnm6/S7xjMfRcC aBVbJhxseQCXy7LumBMlyuKKfS3/yQ2AjvuwmXPmRFaHwVCunKok87FS5 QpdmEvktEFmbPi36+JD3zdpz1JVMXlq1JSFRrWgLqijcuZx9iRezEAz/X 3baWATCG45cuNFllBMFr13f8IJ4yR6MF5l6FTtOMe9JdPI3+zmRfpzv/U ufUdkFiJcqVrN0GXqLkLrNxfoHhuTg3XiGbW4giGM/oQpM6rwqRI4sEM/ A==; IronPort-SDR: TNPN37GwzykIQua8JruB4xE/Cx5CueKorxKvf+3Cy05budiaHUJphT4RO3Nu/lSBribxGF+Uwr 7U/Z3Ue8t6rcxcre9O9+5uvfcGlRnVsOFVkppeGbpyxysE6IQw1fTBWu+UjiO1veNWTwHHEzzG /6c1bo0D31XT8Mo3XsPj+XVxl0HnIu3xIxKBEDBsALsFmi7MXADZAiIzmpqMZyj8rPQIYdA/gS gOGVt9+1ClHY9+bxLesz8jf0imA5Q6fG11w/mdQR/fsJmWmAkJ8Kzc4JmG8HqIwkvb0FBbkh1o HmA= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="153218793" Received: from mail-dm6nam12lp2174.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.174]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:51 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TcFeZL9WT0O1FUcnXuwCVxy1plDmCPgC+9Jg8vjUzQFgaVjH6Uonk4KnXYgCkGqLDyChNppWPJf0XP6tmr6nBP/ZtLN5bankguQLz0Bk5WGF1lBVBczGVw2ensTIbRKHag4zqZa10gRpSpj1jXtxYQdBE66Jhu3zCZA4Vav5gLbqCTP/RCm3lD995XhI3aLEaOdtlD5Yy1wOnL9yNiiuNhUcs4dEAzqA1mVN7T4KEwIlhP+xMKXM0hMWXpDT/+G7Qhu9NRZ020p1TyTcxgoONLzQq48hm59o7240lj8NYJGFVPluZlR8ICA/kq5jgeZJuxyj5suWA8vAbln8MeoZNg== 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=l/jA6XkBbr6SdmZNhYOBDwBQ0lKqnl3HNIhx+x/cTsQ=; b=LwuN3b+X+gfXLq33L3+6hX7Cdygp+SvX2up1jlramBAyNZAgdXBTa/mFTfkAgKFx7jTk3M2tU6R6dqKU6agYEMBPF4zWbDl8SyYy/Yw4uCqgbPYFO8Z3FW/HVTc6QaZo6/G+o7dDld/DaxS/gQriimH1j8xNbW5dJb1bSzFdqWMPbAEys0gOsbvKvfEVyKdGxwdPX94WRxhMtup2FikhE8NwMpgLi/yDdWut/Zo65FOMnO4Fk110deKyX50cnhzwwLB/mf9Kp96iBnw1qLq4i7/SN6qxJ1d1lTdL4AkSwn3ZqwPkyUi4l01uxnYxZk1RQhh6f0wmtImyRCN6Av/VLA== 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=l/jA6XkBbr6SdmZNhYOBDwBQ0lKqnl3HNIhx+x/cTsQ=; b=wJrZU26/N/ioH2jNASjaeiWok0qcBKCYUUr+WN8MUkUY1RAob4y0i6aGrg6hCk4Rb+S10hbi5hFl4Td208I0G4N+E1MBDroKva9keAkzqOnXVlYHP1icUZfZ75WgZRvN14FXUjLb1nFUlljO/OXu6QyKPAUd/SuPnUcsJ9VtuMM= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:50 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:50 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 09/11] docs: Add domain device tree binding documentation Date: Sat, 21 Nov 2020 15:17:54 +0530 Message-Id: <20201121094756.4154728-10-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2d7c9270-11c1-41d0-f6f9-08d88e02a623 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PXdrolXqzTOi6lZwz2Qho+9PgJHIZbno8SsJaEGDDyVZo9AJONIvUtfyAAGZAOl/d4pUJUr5XQLCxR8EatRlBiKMgC1AU+fMnE2dDhmmE7uozJs38AlObXRfRRpOz/leks7/aol7a/mLGGaR8z+vXkKoKBSG3+C1z6P2dQjWOYmHTHsZCIdo1y1DstgcUXKV7rX9kqbIvqAyyy13H7EpkldixjKbinRzNP3Upn5T4XwdV1rzBgT+7KBGdo692G/+DDREyuh8xEb7arkLFKqJMOjvrGaO2Lf6JyxVU0c3O4kyyT/ZbB/i8CaO0Ekv7ERd 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(6666004)(186003)(4326008)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 0DxJo2u3VQt7jihps2IhDlmkBK0N4LfWwYSbwf0ZcSZslgs6BTZ6gyoEfAriwvzljJKSDKzxRGvD2dSJC2Gt/ENFm4fpPnDHl88NzhSKVx8Ur8J6RVDGhIxisnoJIFbUnr76weHf/r04+CrroFh3VXBa8YVTlRx5qnyClHtaZmiuQaCDlr1K6q2rd0WG6AWxX3IP28LRuvM6f6t76dqPEhiniOv9vPbk7GBZXDfbpOqiyNFgVMXFpdx/8R/Re6CvPxnDBmJmRmuibBZtAcIuFY8riVaEYzeyZjHMu6GN8vvFOJevEKp9PnHH4xMAmGnd5mnhB4iL7E1hZWEPd/uB9kUZ24v0tQpP86SMzFB/+kiIHQzWq+gQS5y26cI+ZwDiSZ/OB8ZFoR5xFf7Cz2cJMIW4Qj5jGWEyXqQh6pVSflYNbKvSdadxRgNXiwfPd/kfMyFaNYPpbh6Vlo7h9yIu++5WMR5uyuRXyy3IQHNr5chypcEglcO5nkiivRLrTV58FpSoaNuAyYhGkmo7E8+OKgJgcHbWbdvmSAAWT9ny+nujDBwEU4bnfELNeQysOlo4aZfI1KvUwFPLpLqkahYb6GzTkbCfvjetzbQwjdizStEAsFD0I97Zy7tTa3gRtQWx57PzU/SeZYsnJT4hFBBhcw== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d7c9270-11c1-41d0-f6f9-08d88e02a623 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:50.3577 (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: u4bqGXEkM+4dB9k9QxyZTuF1UToNF9/BnVcJLcQkANjzzWkLCS2StMfu15vQAY3f4kpYbp7PJNsuJ5QsHFpnEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175239_136598_A0EC6E02 X-CRM114-Status: GOOD ( 21.20 ) 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.153.144 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 patch adds domain device tree binding documentation in the OpenSBI domain support documentation. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- docs/domain_support.md | 186 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) diff --git a/docs/domain_support.md b/docs/domain_support.md index 04989df..eae8cdb 100644 --- a/docs/domain_support.md +++ b/docs/domain_support.md @@ -104,3 +104,189 @@ Few noteworthy effects of a system partitioned into domains are as follows: only work if both HART A and HART B are assigned same domain * A HART running in S-mode or U-mode can only access memory based on the memory regions of the domain assigned to the HART + +Domain Device Tree Bindings +--------------------------- + +The OpenSBI domains can be described in the **device tree (DT) blob** (or +flattened device tree) passed to the OpenSBI firmwares by the previous +booting stage. This allows OpenSBI platform support to parse and populate +OpenSBI domains from the device tree blob (or flattened device tree). + +### Domain Configuration Node + +All OpenSBI domain description related DT nodes should be under the domain +configuration DT node. The **/chosen** DT node is the preferred parent of +the domain configuration DT node and it should have **compatible** DT +property with value *"opensbi,domain,config"*. + +### Domain Memory Region Node + +The domain memory region DT node describes details of a memory region and +can be pointed by multiple domain instance DT nodes. The access permissions +of the memory region are specified separately in domain instance node. + +The DT properties of a domain memory region DT node are as follows: + +* **compatible** (Mandatory) - The compatible string of the domain memory + region. This DT property should have value *"opensbi,domain,memregion"* +* **base** (Mandatory) - The base address of the domain memory region. This + DT property should have a **2 ^ order** aligned 64 bit address (i.e. two + DT cells). +**order** (Mandatory) - The order of the domain memory region. This DT + property should have a 32 bit value (i.e. one DT cell) in the range + **3 <= order <= __riscv_xlen**. +* **mmio** (Optional) - A boolean flag representing whether the domain + memory region is a memory-mapped I/O (MMIO) region. +* **devices** (Optional) - The list of device DT node phandles for devices + which fall under this domain memory region. + +### Domain Instance Node + +The domain instance DT node describes a domain instance using following +DT properties: + +* **compatible** (Mandatory) - The compatible string of the domain instance. + This DT property should have value *"opensbi,domain,instance"* +* **possible-harts** (Optional) - The list of CPU DT node phandles for the + the domain instance. This list represents the possible HARTs of the + domain instance. +* **regions** (Optional) - The list of domain memory region DT node phandle + and access permissions for the domain instance. Each list entry is a pair + of DT node phandle and access permissions. The access permissions are + represented as a 32bit bitmask having bits: **readable** (BIT[0]), + **writeable** (BIT[1]), **executable** (BIT[2]), and **m-mode** (BIT[3]). +* **boot-hart** (Optional) - The DT node phandle of the HART booting the + domain instance. If coldboot HART is assigned to the domain instance then + this DT property is ignored and the coldboot HART is assumed to be the + boot HART of the domain instance. +* **next-arg1** (Optional) - The 64 bit next booting stage arg1 for the + domain instance. If this DT property is not available and coldboot HART + is not assigned to the domain instance then **0x0** is used as default + value. If this DT property is not available and coldboot HART is assigned + to the domain instance then **next booting stage arg1 of coldboot HART** + is used as default value. +* **next-addr** (Optional) - The 64 bit next booting stage address for the + domain instance. If this DT property is not available and coldboot HART + is not assigned to the domain instance then **0x0** is used as default + value. If this DT property is not available and coldboot HART is assigned + to the domain instance then **next booting stage address of coldboot HART** + is used as default value. +* **next-mode** (Optional) - The 32 bit next booting stage mode for the + domain instance. The possible values of this DT property are: **0x1** + (s-mode), and **0x0** (u-mode). If this DT property is not available + and coldboot HART is not assigned to the domain instance then **0x1** + is used as default value. If this DT property is not available and + coldboot HART is assigned to the domain instance then **next booting + stage mode of coldboot HART** is used as default value. +* **system-reset-allowed** (Optional) - A boolean flag representing + whether the domain instance is allowed to do system reset. + +### Assigning HART To Domain Instance + +By default, all HARTs are assigned to **the ROOT domain**. The OpenSBI +platform support can provide the HART to domain instance assignment using +platform specific callback. + +The HART to domain instance assignment can be parsed from the device tree +using optional DT property **opensbi,domain** in each CPU DT node. The +value of DT property **opensbi,domain** is the DT phandle of the domain +instance DT node. If **opensbi,domain** DT property is not specified then +corresponding HART is assigned to **the ROOT domain**. + +### Example + +``` + chosen { + opensbi-domains { + compatible = "opensbi,domain,config"; + + tmem: tmem { + compatible = "opensbi,domain,memregion"; + base = <0x0 0x80100000>; + order = <20>; + }; + + tuart: tuart { + compatible = "opensbi,domain,memregion"; + base = <0x0 0x10011000>; + order = <12>; + mmio; + devices = <&uart1>; + }; + + allmem: allmem { + compatible = "opensbi,domain,memregion"; + base = <0x0 0x0>; + order = <64>; + }; + + tdomain: trusted-domain { + compatible = "opensbi,domain,instance"; + possible-harts = <&cpu0>; + regions = <&tmem 0x7>, <&tuart 0x7>; + boot-hartid = <&cpu0>; + next-arg1 = <0x0 0x0>; + next-addr = <0x0 0x80100000>; + next-mode = <0x0>; + system-reset-allowed; + }; + + udomain: untrusted-domain { + compatible = "opensbi,domain,instance"; + possible-harts = <&cpu1 &cpu2 &cpu3 &cpu4>; + regions = <&tmem 0x0>, <&tuart 0x0>, <&allmem 0x7>; + }; + }; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + timebase-frequency = <10000000>; + + cpu0: cpu@0 { + device_type = "cpu"; + reg = <0x00>; + compatible = "riscv"; + opensbi-domain = <&tdomain>; + ... + }; + + cpu1: cpu@1 { + device_type = "cpu"; + reg = <0x01>; + compatible = "riscv"; + opensbi-domain = <&udomain>; + ... + }; + + cpu2: cpu@2 { + device_type = "cpu"; + reg = <0x02>; + compatible = "riscv"; + opensbi-domain = <&udomain>; + ... + }; + + cpu3: cpu@3 { + device_type = "cpu"; + reg = <0x03>; + compatible = "riscv"; + opensbi-domain = <&udomain>; + ... + }; + + cpu4: cpu@4 { + device_type = "cpu"; + reg = <0x04>; + compatible = "riscv"; + opensbi-domain = <&udomain>; + ... + }; + }; + + uart1: serial@10011000 { + ... + }; +``` From patchwork Sat Nov 21 09:47:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404396 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=K2mrdMRm; 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=jNvKIHO4; 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=RGJjEO6I; 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 4Cdpbz1K8Hz9s1l for ; Sun, 22 Nov 2020 09:53:19 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=Pv/mnuTXXy8x4quL8hBuBUVt4yugsRL9MuMqQsrN5GQ=; b=K2mrdMRmI36xnIMRvMDPeP2Oa XLkm+HKlmx6NJp9XCSPLJuKPpX9GjL4V4w5rGuKbAbi4WPKBRFgZ2XPnICxvPhqjAWwZ7D+lyYLO5 iJUMf+eUmCPhKkgrkV1Y7fWvr26w2wuUZB/g0//kwIvkf3GNAIQ0PMmu/6q1bIaHfLy94TlWewNDU UH8pLWIVHQeLv0LeKaNh4cswm8VmMVSw/dQJKxXlPymReVtutpqtJmIjnX2Ill5v36R/AfrgZkTiQ r0ac1KYRb4/5uVcw/UaOg8j9kvLrhCFMc9VZQXgHQ28WueKwb38vugrncGCfy7J+3l+Mgl5F7RgeJ pP1h1oyfQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkl-0005yv-Mn; Sat, 21 Nov 2020 22:53:12 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkE-0005m4-Be for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52:48 +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=1605999158; x=1637535158; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=xMKcZjP3AqtHRn/6oFcKUcreo1FWtvUIp+4qAUKVbDs=; b=jNvKIHO47eml6JRrxGvtyXJF08SbfrGLpFGZiQLeMBY7pf58a2Irc9un LVPWFJHF32ga/Zn2b24dD1S/47KbAxMo++4z4eMeCA0WuN6cnWWSI+0+v anHsxBuZucv3McLdxOOHyAR2rPt9nwQ0MNuxIftdpwnN4JARTzeZWR+Qf 7BotpbXW/gyPk5sQnGG8MeUp3oJx+sM+uEg6tQLYbdi66cnrrhqydm21l 23upfcFuFbymitZDfkSCE6CFdYEwPKs4yRQmvUC5KwjE7Hq4aGmxr8m9/ NbXxB24aaBf8aA2cV5MaTsqQFbXZWlbOkk8L8BPllvc9fO3naiDDwU16P Q==; IronPort-SDR: rr4byo37jCVlJURE3SjqqGZDkG8ZNs5I0zLmcjiWy906VXp7SSkjDt4CWAv1o0SM1qCi9khZlU hgBQgrWSPK2cg6EZc94qmq3xnmpUw9dyEFs7McTJPcM4RCFBnpZ68ZKXoakCc2EZIx71aCR/ya 6pycuQxASaoLBtQ3TKk5OKcsLpBPCm8pcxo5DpwchfPiteD+uXST+3Hh+QIBkHYw3MoQK7az/B NzzcZmLfdrybJkXpm6culqsXCpiccDiPPUhDrxgrYTM60e2LQeU7cPzs4H5GM3aN/sQFX9nbZB 4Pc= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="153218796" Received: from mail-dm6nam12lp2172.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.172]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:54 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OkfD73jjNZnrB1AsYohqrl7ZEvvw5cB0IeTYECaD1pFMm8QNfCN2eqLaM6muhLIK8/5HCl6KJODpUjLKuOJ2CbDm6tfecSkOKvczb3KOiw/6a6oX3wSlNL1ae98xm6C58SX055BitE6+I14xukQL4okKYvqAaZ0gsvVh9+42vfoNPv8bMzCSO3xYeoxfi6JDNw43lTyhMHoBzvZWcpwoiRx5dTTup0iYufHVKTgQ0cQCHH2YV8It8Z+TxfrNZmVYsV4nyi0LeLVL0rCUSFveUhcmRD0KYTSqW0sHiYqb5l4zC/MlPkI4fVbdYTsls+q35qeAVT8wKO1/jVWTMw1jHw== 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=dE2luvcZI7MSxt3tVVeNPo5yNyjk1uG+WryLH9E0HkY=; b=EN2fP/87JOcO8sZXWjs3VGor6E9NUg920C5ZYJNPTHcAhsVlXqsdk8SC1mlNKPvB2qHKFjKBYKF4N52cvs8lRpNdvohmejoBd+Q6vZmKqNKvpJvEP33HB6/doiOkfbdWJqdNH8AvfgguYGqD9fxiPnsW+iobeYzWX1HT0hLZ6eUp4AuPqbDqb57E1b9+l7t0pFej7A05TPDCbQOsMmp/D0Uu152N79Xr/R4CSAQ8d+wOuq4YNLmVLPsMZa5vwd7Mq5L+Y89mOB+3vvNrHUZNQlbkWp31UGAKeBNpAjsEhRIPYDWg4w14fGZYreIdzeJ/wbc0/OoookVyGSnAaDvBaQ== 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=dE2luvcZI7MSxt3tVVeNPo5yNyjk1uG+WryLH9E0HkY=; b=RGJjEO6IQhFEIMnHG3T0v8M5XvjeRK9NWX/8+JxPfpq9IdqKOGGz/miRacBmSYDeUAf1dEZoPKEB8oYX4LymyQ36sx84lyrC44n6bdEKWPsop0gM1C53cgcObBAOcOJZOuytkSAEMU+e83q71EASgDpIVSzK1fn05Mky8WVhI6A= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:53 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:53 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 10/11] lib: utils: Add helper routines to populate domains from FDT Date: Sat, 21 Nov 2020 15:17:55 +0530 Message-Id: <20201121094756.4154728-11-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ddc9659c-8237-4579-b080-08d88e02a792 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oS/8G5rBG+asTRDex0HwyLjv/9ojhG/3X/u9qnSYwPOj5yguW3lGG9xINkjv0/k2wLuD/IHIyaQ1RYDdJUPaycLMycemX94r2Qf8xZ1926oPpbxGnLwMVQP2U9RY77mJF4WHGZkJfbH5SRlhHPO10iTqtkXMtOcm3lhhKx8O5Qw9/kznKiuHTCGXSSIRrdi8l//UWUr4fadYG0WpFg2KM3YxFLOQWzqUV5wny/Jf0Vm/itVnkBbdBfd/SFYhTmGU2Ds74oJvsy129AG04kEfjwqeV7jHh25dPP/ncSD10MbSuhl6rrdDNWmPhVohJNw/UuPuDY4ahnsbdOgPbO+5Gg== 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(186003)(30864003)(4326008)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 4NPwPTr2JwnEX0qCpBf5vNh5B/nVJaPcVIL7uhkSa1+DCCJqOTTp7CTwGOzruRofox8vfMc7mAQF6z4beNcI6s5nNuAYNsF4PqwkF5IzTWSwSbVmwnmL9gZBKmdW04newcSdBjHEZILVdB/iWOSBPmHFQV1BFOWykoJIxvBYLkISrHjQgWM3+lvvxAsIBeHvuC7d0CuljGcu4iSajFh40BcHg8gzJn29q2K0+jUBcGaefzXqwEzoF+2OQNR9WUfizkSF5XXQUC6gmBuIMnC7UuETjTauxUrQby6J7flFCuhoR1mkexes0nTvSwwEB4OGb+PqX+8JTj/Phz5LC4L8CaKrjGwAjghYMPJwJM20x1B+zKy+7xWm8HiXd0id2Z790Yqe+MV4GQ9m40RKrRJiQENjr6pmbWCU0DvyVVRlSc/hrak4bPn/E6PthkbeLpH0M2qCs0SHAdjOUmsvGxiUqHOwprjlpED6Lggth9UVY+uqluVT4D9kroGXbE7tzqQAlQaHXUYUevw6kkLJB9AlXDR5OSWKbFV8kofCthbde2+NhwO0fvvKDSdfqKUNbylaFf5tRZE7NyOc04rqEReoUvf0/2ZvY61FJDEZDfp75QLyWsVqk7fsdAXDQi9LnX5d9N0bAXCwZyoMyFdDSsO5rA== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddc9659c-8237-4579-b080-08d88e02a792 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:52.9979 (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: bAt9ssogeMUg7EwXNkmxwzB55v1kZ0drbdRRslsLhm5hboIj6dEhFOON8mHy9tOjB5ugO1HtJWQ7AjWzUvC4UQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175239_249311_FBB5F31E X-CRM114-Status: GOOD ( 27.34 ) 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.153.144 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 We add various helper routines to populate domains, iterate domains, iterate domain memregions, and parse HART to domain assignment from the FDT. These helper routines can be used by platform support code and FDT fixup code. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- include/sbi_utils/fdt/fdt_domain.h | 80 ++++++ lib/utils/fdt/fdt_domain.c | 444 +++++++++++++++++++++++++++++ lib/utils/fdt/objects.mk | 1 + 3 files changed, 525 insertions(+) create mode 100644 include/sbi_utils/fdt/fdt_domain.h create mode 100644 lib/utils/fdt/fdt_domain.c diff --git a/include/sbi_utils/fdt/fdt_domain.h b/include/sbi_utils/fdt/fdt_domain.h new file mode 100644 index 0000000..2c874e5 --- /dev/null +++ b/include/sbi_utils/fdt/fdt_domain.h @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: BSD-2-Clause +/* + * fdt_domain.c - Flat Device Tree Domain helper routines + * + * Copyright (c) 2020 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel + */ + +#ifndef __FDT_DOMAIN_H__ +#define __FDT_DOMAIN_H__ + +#include + +struct sbi_domain; + +/** + * Iterate over each domains in device tree + * + * @param fdt device tree blob + * @param opaque private pointer for each iteration + * @param fn callback function for each iteration + */ +void fdt_iterate_each_domain(void *fdt, void *opaque, + void (*fn)(void *fdt, int domain_offset, + void *opaque)); + +/** + * Iterate over each memregion of a domain in device tree + * + * @param fdt device tree blob + * @param domain_offset domain DT node offset + * @param opaque private pointer for each iteration + * @param fn callback function for each iteration + */ +void fdt_iterate_each_memregion(void *fdt, int domain_offset, void *opaque, + void (*fn)(void *fdt, int domain_offset, + int region_offset, u32 region_access, + void *opaque)); + +/** + * Fix up the domain configuration in the device tree + * + * This routine: + * 1. Disables MMIO devices not accessible to the coldboot HART domain + * 2. Removes "opensbi-domain" DT property from CPU DT nodes + * 3. Removes domain configuration DT node under /chosen DT node + * + * It is recommended that platform support call this function in + * their final_init() platform operation. + * + * @param fdt device tree blob + */ +void fdt_domain_fixup(void *fdt); + +/** + * Get domain instance for given HART + * + * Note: Domains should to be populated before using this function. + * + * @param hartid the HART for which domain instance is needed + * + * @return pointer to domain instance on success and NULL on failure + */ +struct sbi_domain *fdt_domain_get(u32 hartid); + +/** + * Populate domains from device tree + * + * It is recommended that platform support call this function in + * their domains_init() platform operation. + * + * @param fdt device tree blob + * + * @return 0 on success and negative error code on failure + */ +int fdt_domains_populate(void *fdt); + +#endif /* __FDT_DOMAIN_H__ */ diff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c new file mode 100644 index 0000000..3027b39 --- /dev/null +++ b/lib/utils/fdt/fdt_domain.c @@ -0,0 +1,444 @@ +// SPDX-License-Identifier: BSD-2-Clause +/* + * fdt_domain.c - Flat Device Tree Domain helper routines + * + * Copyright (c) 2020 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel + */ + +#include +#include +#include +#include +#include +#include +#include + +void fdt_iterate_each_domain(void *fdt, void *opaque, + void (*fn)(void *fdt, int domain_offset, + void *opaque)) +{ + int doffset, poffset; + + if (!fdt || !fn) + return; + + poffset = fdt_path_offset(fdt, "/chosen"); + if (poffset < 0) + return; + poffset = fdt_node_offset_by_compatible(fdt, poffset, + "opensbi,domain,config"); + if (poffset < 0) + return; + + fdt_for_each_subnode(doffset, fdt, poffset) { + if (fdt_node_check_compatible(fdt, doffset, + "opensbi,domain,instance")) + continue; + + fn(fdt, doffset, opaque); + } +} + +void fdt_iterate_each_memregion(void *fdt, int domain_offset, void *opaque, + void (*fn)(void *fdt, int domain_offset, + int region_offset, u32 region_access, + void *opaque)) +{ + u32 i, rcount; + int len, region_offset; + const u32 *regions; + + if (!fdt || (domain_offset < 0) || !fn) + return; + + if (fdt_node_check_compatible(fdt, domain_offset, + "opensbi,domain,instance")) + return; + + regions = fdt_getprop(fdt, domain_offset, "regions", &len); + if (!regions) + return; + + rcount = (u32)len / (sizeof(u32) * 2); + for (i = 0; i < rcount; i++) { + region_offset = fdt_node_offset_by_phandle(fdt, + fdt32_to_cpu(regions[2 * i])); + if (region_offset < 0) + continue; + + if (fdt_node_check_compatible(fdt, region_offset, + "opensbi,domain,memregion")) + continue; + + fn(fdt, domain_offset, region_offset, + fdt32_to_cpu(regions[(2 * i) + 1]), opaque); + } +} + +struct __fixup_find_domain_offset_info { + const char *name; + int *doffset; +}; + +static void __fixup_find_domain_offset(void *fdt, int doff, void *p) +{ + struct __fixup_find_domain_offset_info *fdo = p; + + if (sbi_strcmp(fdo->name, fdt_get_name(fdt, doff, NULL))) + return; + + *fdo->doffset = doff; +} + +#define DISABLE_DEVICES_MASK (SBI_DOMAIN_MEMREGION_READABLE | \ + SBI_DOMAIN_MEMREGION_WRITEABLE | \ + SBI_DOMAIN_MEMREGION_EXECUTABLE) + +static void __fixup_count_disable_devices(void *fdt, int doff, int roff, + u32 perm, void *p) +{ + int len; + u32 *dcount = p; + + if (perm & DISABLE_DEVICES_MASK) + return; + + len = 0; + if (fdt_getprop(fdt, roff, "devices", &len)) + *dcount += len / sizeof(u32); +} + +static void __fixup_disable_devices(void *fdt, int doff, int roff, + u32 raccess, void *p) +{ + int i, len, coff; + const u32 *devices; + + if (raccess & DISABLE_DEVICES_MASK) + return; + + len = 0; + devices = fdt_getprop(fdt, roff, "devices", &len); + if (!devices) + return; + len = len / sizeof(u32); + + for (i = 0; i < len; i++) { + coff = fdt_node_offset_by_phandle(fdt, + fdt32_to_cpu(devices[i])); + if (coff < 0) + continue; + + fdt_setprop_string(fdt, coff, "status", "disabled"); + } +} + +void fdt_domain_fixup(void *fdt) +{ + u32 i, dcount; + int err, poffset, doffset; + struct sbi_domain *dom = sbi_domain_thishart_ptr(); + struct __fixup_find_domain_offset_info fdo; + + /* Remove the domain assignment DT property from CPU DT nodes */ + poffset = fdt_path_offset(fdt, "/cpus"); + if (poffset < 0) + return; + fdt_for_each_subnode(doffset, fdt, poffset) { + err = fdt_parse_hart_id(fdt, doffset, &i); + if (err) + continue; + + fdt_nop_property(fdt, doffset, "opensbi-domain"); + } + + /* Skip device disable for root domain */ + if (!dom->index) + goto skip_device_disable; + + /* Find current domain DT node */ + doffset = -1; + fdo.name = dom->name; + fdo.doffset = &doffset; + fdt_iterate_each_domain(fdt, &fdo, __fixup_find_domain_offset); + if (doffset < 0) + goto skip_device_disable; + + /* Count current domain device DT nodes to be disabled */ + dcount = 0; + fdt_iterate_each_memregion(fdt, doffset, &dcount, + __fixup_count_disable_devices); + if (!dcount) + goto skip_device_disable; + + /* Expand FDT based on device DT nodes to be disabled */ + err = fdt_open_into(fdt, fdt, fdt_totalsize(fdt) + dcount * 32); + if (err < 0) + return; + + /* Again find current domain DT node */ + doffset = -1; + fdo.name = dom->name; + fdo.doffset = &doffset; + fdt_iterate_each_domain(fdt, &fdo, __fixup_find_domain_offset); + if (doffset < 0) + goto skip_device_disable; + + /* Disable device DT nodes for current domain */ + fdt_iterate_each_memregion(fdt, doffset, NULL, + __fixup_disable_devices); +skip_device_disable: + + /* Remove the OpenSBI domain config DT node */ + poffset = fdt_path_offset(fdt, "/chosen"); + if (poffset < 0) + return; + poffset = fdt_node_offset_by_compatible(fdt, poffset, + "opensbi,domain,config"); + if (poffset < 0) + return; + fdt_nop_node(fdt, poffset); +} + +static struct sbi_domain *fdt_hartid_to_domain[SBI_HARTMASK_MAX_BITS]; + +#define FDT_DOMAIN_MAX_COUNT 8 +#define FDT_DOMAIN_REGION_MAX_COUNT 16 + +static u32 fdt_domains_count; +static struct sbi_domain fdt_domains[FDT_DOMAIN_MAX_COUNT]; +static struct sbi_hartmask fdt_masks[FDT_DOMAIN_MAX_COUNT]; +static struct sbi_domain_memregion + fdt_regions[FDT_DOMAIN_MAX_COUNT][FDT_DOMAIN_REGION_MAX_COUNT + 2]; + +struct sbi_domain *fdt_domain_get(u32 hartid) +{ + if (SBI_HARTMASK_MAX_BITS <= hartid) + return NULL; + return fdt_hartid_to_domain[hartid]; +} + +static void __fdt_region(void *fdt, int domain_offset, + int region_offset, u32 region_access, + void *opaque) +{ + int len; + u32 val32; + u64 val64; + const u32 *val; + u32 *region_count = opaque; + struct sbi_domain_memregion *region; + + /* Find next region of the domain */ + if (FDT_DOMAIN_REGION_MAX_COUNT <= *region_count) + return; + region = &fdt_regions[fdt_domains_count][*region_count]; + + /* Read "base" DT property */ + val = fdt_getprop(fdt, region_offset, "base", &len); + if (!val && len >= 8) + return; + val64 = fdt32_to_cpu(val[0]); + val64 = (val64 << 32) | fdt32_to_cpu(val[1]); + region->base = val64; + + /* Read "order" DT property */ + val = fdt_getprop(fdt, region_offset, "order", &len); + if (!val && len >= 4) + return; + val32 = fdt32_to_cpu(*val); + if (val32 < 3 || __riscv_xlen < val32) + return; + region->order = val32; + + /* Read "mmio" DT property */ + region->flags = region_access & SBI_DOMAIN_MEMREGION_ACCESS_MASK; + if (fdt_get_property(fdt, region_offset, "mmio", NULL)) + region->flags |= SBI_DOMAIN_MEMREGION_MMIO; + + (*region_count)++; +} + +static void __fdt_domain(void *fdt, int domain_offset, void *opaque) +{ + u32 val32; + u64 val64; + const u32 *val; + struct sbi_domain *dom; + struct sbi_hartmask *mask; + int i, err, len, cpu_offset; + int *cold_domain_offset = opaque; + struct sbi_domain_memregion *regions; + + /* Sanity check on maximum domains we can handle */ + if (FDT_DOMAIN_MAX_COUNT <= fdt_domains_count) + return; + dom = &fdt_domains[fdt_domains_count]; + mask = &fdt_masks[fdt_domains_count]; + regions = &fdt_regions[fdt_domains_count][0]; + + /* Read DT node name */ + sbi_strncpy(dom->name, fdt_get_name(fdt, domain_offset, NULL), + sizeof(dom->name)); + dom->name[sizeof(dom->name) - 1] = '\0'; + + /* Setup possible HARTs mask */ + SBI_HARTMASK_INIT(mask); + dom->possible_harts = mask; + val = fdt_getprop(fdt, domain_offset, "possible-harts", &len); + len = len / sizeof(u32); + if (val && len) { + for (i = 0; i < len; i++) { + cpu_offset = fdt_node_offset_by_phandle(fdt, + fdt32_to_cpu(val[i])); + if (cpu_offset < 0) + continue; + + err = fdt_parse_hart_id(fdt, cpu_offset, &val32); + if (err) + continue; + + sbi_hartmask_set_hart(val32, mask); + } + } + + /* Setup memregions from DT */ + val32 = 0; + sbi_memset(regions, 0, + sizeof(*regions) * (FDT_DOMAIN_REGION_MAX_COUNT + 2)); + dom->regions = regions; + fdt_iterate_each_memregion(fdt, domain_offset, &val32, __fdt_region); + sbi_domain_memregion_initfw(®ions[val32]); + + /* Read "boot-hartid" DT property */ + val32 = -1U; + val = fdt_getprop(fdt, domain_offset, "boot-hart", &len); + if (val && len >= 4) { + cpu_offset = fdt_node_offset_by_phandle(fdt, + fdt32_to_cpu(*val)); + if (cpu_offset >= 0) + fdt_parse_hart_id(fdt, cpu_offset, &val32); + } else { + if (domain_offset == *cold_domain_offset) + val32 = current_hartid(); + } + dom->boot_hartid = val32; + + /* Read "next-arg1" DT property */ + val64 = 0; + val = fdt_getprop(fdt, domain_offset, "next-arg1", &len); + if (val && len >= 8) { + val64 = fdt32_to_cpu(val[0]); + val64 = (val64 << 32) | fdt32_to_cpu(val[1]); + } else { + if (domain_offset == *cold_domain_offset) + val64 = sbi_scratch_thishart_ptr()->next_arg1; + } + dom->next_arg1 = val64; + + /* Read "next-addr" DT property */ + val64 = 0; + val = fdt_getprop(fdt, domain_offset, "next-addr", &len); + if (val && len >= 8) { + val64 = fdt32_to_cpu(val[0]); + val64 = (val64 << 32) | fdt32_to_cpu(val[1]); + } else { + if (domain_offset == *cold_domain_offset) + val64 = sbi_scratch_thishart_ptr()->next_addr; + } + dom->next_addr = val64; + + /* Read "next-mode" DT property */ + val32 = 0x1; + val = fdt_getprop(fdt, domain_offset, "next-mode", &len); + if (val && len >= 4) { + val32 = fdt32_to_cpu(val[0]); + if (val32 != 0x0 && val32 != 0x1) + val32 = 0x1; + } else { + if (domain_offset == *cold_domain_offset) + val32 = sbi_scratch_thishart_ptr()->next_mode; + } + dom->next_mode = val32; + + /* Read "system-reset-allowed" DT property */ + if (fdt_get_property(fdt, domain_offset, + "system-reset-allowed", NULL)) + dom->system_reset_allowed = TRUE; + else + dom->system_reset_allowed = FALSE; + + /* Increment domains count */ + fdt_domains_count++; +} + +int fdt_domains_populate(void *fdt) +{ + const u32 *val; + int cold_domain_offset; + u32 i, hartid, cold_hartid; + int err, len, cpus_offset, cpu_offset, domain_offset; + + /* Sanity checks */ + if (!fdt) + return SBI_EINVAL; + + /* Find /cpus DT node */ + cpus_offset = fdt_path_offset(fdt, "/cpus"); + if (cpus_offset < 0) + return cpus_offset; + + /* Find coldboot HART domain DT node offset */ + cold_domain_offset = -1; + cold_hartid = current_hartid(); + fdt_for_each_subnode(cpu_offset, fdt, cpus_offset) { + err = fdt_parse_hart_id(fdt, cpu_offset, &hartid); + if (err) + continue; + + if (hartid != cold_hartid) + continue; + + val = fdt_getprop(fdt, cpu_offset, "opensbi-domain", &len); + if (val && len >= 4) + cold_domain_offset = fdt_node_offset_by_phandle(fdt, + fdt32_to_cpu(*val)); + + break; + } + + /* Iterate over each domain in FDT and populate details */ + fdt_iterate_each_domain(fdt, &cold_domain_offset, __fdt_domain); + + /* HART to domain assignment based on CPU DT nodes*/ + fdt_for_each_subnode(cpu_offset, fdt, cpus_offset) { + err = fdt_parse_hart_id(fdt, cpu_offset, &hartid); + if (err) + continue; + + if (SBI_HARTMASK_MAX_BITS <= hartid) + continue; + + val = fdt_getprop(fdt, cpu_offset, "opensbi-domain", &len); + if (!val || len < 4) + continue; + + domain_offset = fdt_node_offset_by_phandle(fdt, + fdt32_to_cpu(*val)); + if (domain_offset < 0) + continue; + + for (i = 0; i < fdt_domains_count; i++) { + if (!sbi_strcmp(fdt_domains[i].name, + fdt_get_name(fdt, domain_offset, NULL))) { + fdt_hartid_to_domain[hartid] = &fdt_domains[i]; + break; + } + } + } + + return 0; +} diff --git a/lib/utils/fdt/objects.mk b/lib/utils/fdt/objects.mk index b860a83..d9f1eae 100644 --- a/lib/utils/fdt/objects.mk +++ b/lib/utils/fdt/objects.mk @@ -4,5 +4,6 @@ # Copyright (C) 2020 Bin Meng # +libsbiutils-objs-y += fdt/fdt_domain.o libsbiutils-objs-y += fdt/fdt_helper.o libsbiutils-objs-y += fdt/fdt_fixup.o From patchwork Sat Nov 21 09:47:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1404395 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=rJ+Jzzah; 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=dJjoMhax; 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=aHEOVIT5; 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 4Cdpbv66wDz9s1l for ; Sun, 22 Nov 2020 09:53:15 +1100 (AEDT) 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:References:In-Reply-To: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:List-Owner; bh=vSCwL4LH/zmXwe57QFSo9GfIwZKkqcUP6TPC85wC2hU=; b=rJ+Jzzahls4Q7Us4r0kb1wTpm R3dP3NAEXEOH7OlHH+sAoHEydY73betmEeYcPydvMhRKvGkv+vQHUkcvGdB42sAvEB62/M2hKM+14 xT9yVx1Cd1Yhxt2wx4m1tCjap9+Y3eeu3wzIFsx5TJwwvYchDhlrfC7qAZqMkmd/6sdmKi1lk3S3r arLvYGponydk/o8WzSurzpNgMRHco9CD/HwdxdM4RnRo/V0c2CrdRpPUO8DocniqneHNo7U6Y9EB0 9oHEtU6QBBUBIorhXtKp3e7WzRJdELokNCmdJTPd5/w9CHskiVaZgm1AkUHMwjOo4liasFDCGnTz2 cdZrhicHw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkh-0005wY-Of; Sat, 21 Nov 2020 22:53:07 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgbkI-0005jy-3f for opensbi@lists.infradead.org; Sat, 21 Nov 2020 22:52: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=1605999162; x=1637535162; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=SfkKDlobwhdVFLTTRt/KkOElNQD0wmQ49CSIRrUErVA=; b=dJjoMhaxCPASFgabTjBrL+rX299o0GbvMFPJxeQMoEbrDSauBEIBp/bO bAocXniOaP+WGTjJlLxf+q5k9+uREE9THBZtjsU+H7G8y9ZvceQw6WTb8 quvX1ZNETt7KT/HrOFEVAqF0CGQsrzPfmSdLmsAM8RkELpM5S6PQtSoaB jurEJh0W46dcAk76twpkpKtUvnh4LhpXeHWSOJaTk/6Zjfd1lG2KxODWf rmbsuptl28PLsEeF3WDbYnaBpzL3AIGSAFPXdQweKx3BXWtZcEzzqn/FF GZnaaP4prFYwI3RZEfep+AA9LHwHyJsdbdfTt7YfGlH++FdfiPKOGqTfm A==; IronPort-SDR: fSMlW7S3//yx6uG9RSzA3Q13Gzzav8KD3KNteUp5sbmnN5ZR+dLzi4/dWBANvXxow/V9ezUG8n cnNkqiossyi2wg+I1lMLskC8VPE87TFrHO5aBW9YDkk0rTT06k79L5iuvH+rCiJjnPWBTcXtfX MOgc0f900iT0r489Bc5dgvkHjY8SIL3GurJrU/KkK2yIt3HxD5WuI02mBqK0/95znDgQJMkRg8 uL11kzP+QFfkiv6mgzNWJ6XQxfLclya1ulup219YrM1lftQnAG+TumwLm9FVRU8MEzA7mA7m23 C20= X-IronPort-AV: E=Sophos;i="5.78,359,1599494400"; d="scan'208";a="153218799" Received: from mail-dm6nam12lp2177.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.177]) by ob1.hgst.iphmx.com with ESMTP; 21 Nov 2020 17:48:56 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kzQvKkvU4b8UCfHhizMHIaxBMMvfISMrtJ2Jp3kaXMSQ6d3DoM/P/4VTX9NWMpVuRxDzy9PgC037SAN7Ij32KKi55ot+ZXjUwoJmv6iznMc6Olvw/JmQk5QMFkIulSx6tP71X2vNl1cAtf1zTCxYLCBZ5x2cgq2fC6i2tzt/qwZsNLXUSvzRRsCjkMBC0mslNMQkgmaM0x2xzfzhBwoILhKTo6QZy9yZ9aORowrLwFjR9nVUfwEoInJ5DiW04wUFvvQKW1bZmLmtsqvbiv03lq5T2EEOnURm+nOJsPMaq+oSAG8kADRLKGafHZig1YMPhPsk6tplvXccP45SzyVAYQ== 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=KFYrll9toRnvqDrfyNJkk3zjFbjXR8ft7UJG6FWE+II=; b=WxuOmaFBpZ+bjL08ZFxh141PIGIZU2zdAZxu13huQQk/yCSTvJi6FJGgEE2U/SIwL3HoJin4HRT8Ik4vTH8HSTZ/UjbElunxUPBrh+Thm9ORVET/SM8zoZgmV93WIPi/pq5laHQFDUqJ1+FhDFAVjvDpIdm131v4iURz20g76Zxq1r571s0I8I3ivTIpEcCC5ztcRQBZDFng3lxn7QID+PqI/CUIfm+AunvQKrrwxhlvXcQtBcU9LalSv+g0OzCuoDj+4tuLW98VfqsOzRkWf2N98vTM6cWXMgb0844VQIJM8R04f0Gxx4nUNcomPzemmsLpSmh4SeG/oFdR12pRAg== 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=KFYrll9toRnvqDrfyNJkk3zjFbjXR8ft7UJG6FWE+II=; b=aHEOVIT5RdJeNfIEZQ/vTDMOQY9z4SQlaiDe/4goo6kX30vNYJNIo/ReDQ7kPkSdhX5HZc7fXIjX+qFShntUQdzT8p2St40qs+25RINxVrtEhqPV6Kabw5UEP7/s7HLlnRoiO0NUHyzRhYoMIjb+G4/3oOb2q+e/r6q91Fm9rxg= 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 DM6PR04MB6361.namprd04.prod.outlook.com (2603:10b6:5:1e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sat, 21 Nov 2020 09:48:55 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::d035:e2c6:c11:51dd%6]) with mapi id 15.20.3589.025; Sat, 21 Nov 2020 09:48:55 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH 11/11] platform: generic: Populate domains from FDT Date: Sat, 21 Nov 2020 15:17:56 +0530 Message-Id: <20201121094756.4154728-12-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201121094756.4154728-1-anup.patel@wdc.com> References: <20201121094756.4154728-1-anup.patel@wdc.com> X-Originating-IP: [122.179.16.120] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) 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.16.120) by MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 09:48:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 62702cfb-5fe0-48c2-0e92-08d88e02a932 X-MS-TrafficTypeDiagnostic: DM6PR04MB6361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lp0IyOcRL8usWSVM273abhtwnBvXGRW7vXz5fCF6/6vj8HDJxzyXNtUOTy0mBQHO0GmITDHWcrt6tr8K/vP4/TkwA2gzJ73JvY87E+xjp1OdzzmPXwP9Fu5lp3+U/8MNBD78WakVO43EeEqAgNMSuFnrT2pODnxbOgb+dfPBN0A+ZGWhGJQjr/XIxFbkLSLtpzFgfFXC4SJ2AceRhqhZnKQluQPvP/dDLFisD6m4FvRcWFfhEhwrKo+sa/AjAed364t3lCEHFBIOkYgH4WSG0VoOfEXxcdTutMtcY3aJlKKn2/cfp1coPWfuU4aWDTPrRhID3RR6yEV2R0kKlhcHp8Tfg8xHtYC87Y2yekdNfYhgyUX7ACK22EK7rO7XA0e9 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)(136003)(366004)(346002)(396003)(376002)(39860400002)(44832011)(83380400001)(478600001)(66556008)(8936002)(8886007)(1076003)(55016002)(36756003)(54906003)(66946007)(316002)(66476007)(26005)(110136005)(6636002)(52116002)(2906002)(16526019)(7696005)(86362001)(8676002)(956004)(186003)(4326008)(5660300002)(2616005)(41533002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: HQa/bPqEl/RZMHmptYPNR4Rosls6oohfcZhkcspZBBcq2aq9WFKUdoYOt3BCDluebZ+niO7kx4sXMDrnmwxJMwXsxdht79We0yBoUz+jEe7ddNSwZv1InWbst4LShdLhXCyHkNyPlPSnD7WQOjNpe3YSBVnQqIxIqnlZ/VmL2/HusoE1MfFdzoMuHbZwQNf+iOpCN9JIJii1xI7lSzUUdGaGIHPLKP9yztt/KONUdjovklB7GvB5+Xsr5Q98FQKIEDd7f1cdjC0B4gf4gmS6xj91BqBSlUB/JmM/+FDA5XJSpCZbObYPePHaTEI5++RjBe+m0dzp4aEER6x5p8PixVpAf+C8QXFA8oJgqH+0+9LpT4GO9We6CPV5n4nA/Y8dzJuF92xcFeQFWqeiv2QYXwgeUH6hGyONevzAd4PJ8DBUePcX+5d6b9yvGs4KrRVLrDhd48Q3TSXx/jsLYKRZoAfT4tuv+0n6B9PyGGOpGLPdC3aaJWsrSzofnn2odqhr9C4joeQxi8pykOicI3171Vou8lhveIquuWWrWhzsPBbd7q7zpbvWvRPYfYqLd9LWy/fKlx8pt1KZGipgJpC3F1ra2mtI2nyrW2/+yvUacWoJ93VcUgM5EkVk4hxI5lpPR95y5Fr+ERHLvWayTLGkmw== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62702cfb-5fe0-48c2-0e92-08d88e02a932 X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 09:48:55.4882 (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: lP+A79mAcL5LkbrC/lAizN3vY5l6wKQ1S5b1sDd0k2iBz1u4/DqYJT028XbDB54jbkCHUKwMMwlndxEissewZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201121_175242_532877_58B8F70A X-CRM114-Status: GOOD ( 14.96 ) 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.153.144 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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.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.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 The generic platform should populate domains from FDT using the domain FDT helper routines. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- platform/generic/platform.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/generic/platform.c b/platform/generic/platform.c index d902e71..63c405a 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -148,6 +149,7 @@ static int generic_final_init(bool cold_boot) fdt_cpu_fixup(fdt); fdt_fixups(fdt); + fdt_domain_fixup(fdt); if (generic_plat && generic_plat->fdt_fixup) { rc = generic_plat->fdt_fixup(fdt, generic_plat_match); @@ -170,6 +172,11 @@ static void generic_final_exit(void) generic_plat->final_exit(generic_plat_match); } +static int generic_domains_init(void) +{ + return fdt_domains_populate(sbi_scratch_thishart_arg1_ptr()); +} + static u64 generic_tlbr_flush_limit(void) { if (generic_plat && generic_plat->tlbr_flush_limit) @@ -190,6 +197,8 @@ const struct sbi_platform_operations platform_ops = { .final_init = generic_final_init, .early_exit = generic_early_exit, .final_exit = generic_final_exit, + .domains_init = generic_domains_init, + .domain_get = fdt_domain_get, .console_putc = fdt_serial_putc, .console_getc = fdt_serial_getc, .console_init = fdt_serial_init,