Message ID | 20210303115512.470786-8-anup.patel@wdc.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> 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:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) 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=desiato.20200630 header.b=NVWVPar6; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=Ficmit/Q; 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=ozorK/CG; dkim=neutral header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-sharedspace-onmicrosoft-com header.b=hSXrPzSy; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (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 4DrNQn3ZLjz9sCD for <incoming@patchwork.ozlabs.org>; Thu, 4 Mar 2021 05:52:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zQcf3L2zmEEsw9Q/wizXITOC3pzzIDl5lJRipfa8Ku4=; b=NVWVPar6M55AWhhhzQdjtzbQV B9FHFMlRIDq5cl7eKdt/vCwBTR3H8G+p2bVANTF8NVNRckwHEEe4H1qQX9oW+60dVeVACuq+f5Eo+ QX3MfElulJuAs4pjIyfXrsm5WzqWQ6eWgwScUhNITHJQgZEHHwVKgSrJArVQLkmzJGEOFjr3ab7GA JGPDzOItFDjX4ez7qjZs59fCnzqZHkxw+dUhsh928TGDfrwjUZssJ3FPhOdyevX9+nTsrarmGgNpL YY9XrSpDfHloO6RwYfeqrE9iz0RypukJrwDniseADm02izJyukRqisaKzpMsacNHnrjxP1Mh8kzlE Q79POFN3w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHWbT-006652-6u; Wed, 03 Mar 2021 18:52:11 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHT1p-005HUF-NY for opensbi@desiato.infradead.org; Wed, 03 Mar 2021 15:03:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=2Bo9iEvdcJyRIqYGwp8RBTHrb5Fr2GYVPb3TIiWEBgU=; b=Ficmit/Q3h79Dm7rpLGCLyUWGc gvGODMOpIB4ApMYiL6oVj399yaiLW5eAGR7SxTW5onkCzVhvxkEtrLrPtdzp6KA3iHTAtFYskaHR3 daWWHlzb+ICl07ThJrrZL71T+yf6eEyBVQauKPETUVXQwHCe7zyJMcEyenrePmfC2cal6mfUQKu6G Zip6P/Q2VZxGAgettbIQxekwvJYM1Yu7y+aqARclVTvqziFdsJPUyR4SnB1KGtvfo+wqlODwGosN6 6+Ez7MdLipy2IvbWE0eEEevWA1Vspvp3FryF/E2rO5xCD7toLf/ngvwbxVu28Twq/wsicLeBzGC4k XexOXPiQ==; Received: from esa3.hgst.iphmx.com ([216.71.153.141]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHQ7R-002Rai-1h for opensbi@lists.infradead.org; Wed, 03 Mar 2021 11:56:52 +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=1614772605; x=1646308605; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=1wf6dPXty6Hxk2YLJQCVPKvJIjVh8bygVgYSalnH39Q=; b=ozorK/CGnhy/XEEl/WRkEQeUR8qFSoG/OilxNip7S6RuZzov/iyxPfxZ RiqGdFdaP8UyG5n2JR525Xklbtvv1sfDt9e+UE20fN7Dgsjsjt+FJXD0X QrnIVqqLnbZRT0s2Dj0ll2MTw64XDAVAnlhlWFL3w5vUtqX0Z65H2misa fuGwQ0fAKCXEAXo/xuC0vDyq6lp99gZLgerJF24uOXikUW3dJnB7LXySo uaq7dnmQxTgqN43q2gonXtOz+ohJgwcNsYGsgnGjtzXI3PD2W95nOX6hM g4icrSAo1p24hJlxGYuV9ZoLNUm22WFIb6XX2M2PBaFC90Vln35wPWGHP A==; IronPort-SDR: kBEqSxlakcpkpzchBSU9xZDg7Fh3l/8ZI7YHhxoZzgX4T1jmN1eFtt4UR71YcnVK+62yTirIsY NkwwwkBosjxamGo8tqsQgcTshcAMPWHurNJzNvl8a7AzXojl6RDFpVC9DXbi5gUvUxHPvFnXXG aWQ/Wq+RDXF0LIXeZkZ/lnkOkXVMPMtrAnEHkZIeMBO6zyL2Bq+XqlHQgXMhaK0ks5nW74ZsAk P51pGfLbuO4X+bR27eZ8ZDV2dAn9IlAM6A/e3T5eF3Njh3ejwUbStL48LKg8zKfZU+Z3fHiWyx m6c= X-IronPort-AV: E=Sophos;i="5.81,219,1610380800"; d="scan'208";a="165729506" Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169]) by ob1.hgst.iphmx.com with ESMTP; 03 Mar 2021 19:56:38 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LAQP4oDsf0dofZwDN1UzDhQtn9HKMWsyT9EUk9ReCGz32YVDSLGn6WFhXNZVFfxzTWH7lRtu7Y/WnIX7regyqq63y8AEQFVV54YyxEkqBUFDNxbhVXKS7WX4hT6G9UdJvGwEXiDGQem9E+NRqHrrDSsGaBV1Ugkf4wE0NPRNhaAeUYQlbHTsarxYXVMi0BvvtOhZ8OjKQ6NQiaAy/adNIa2ckeXAWLQAzr2dJR5NOHCKhkwZmMm4MtqvaQFpnK64WXV46Few81l087IGiIk77Er50Hgcl94wPcskzByi7jvuYBniR0k+j+GE3B/7SBj4Jof2fuCADwLMN2T/2UCihQ== 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=2Bo9iEvdcJyRIqYGwp8RBTHrb5Fr2GYVPb3TIiWEBgU=; b=VUfuwb/vC3Zhf1E+xUQFwB6Ay41oZk1N78zHTQXphGS+aAyhSn5weGWru+2N8mfXvtQjX43Lxxui+PIs2LdzCCC2Q+OcnW1jznxwC8cD9tZUWc2VJL5HVLss+k+jrzhFyIDKwsvCrKcIS26k8AaUPUJ1rjcP08w9udHptIMHMuYCactsMLNsKUiF2VDoV1qJKa0k4mGIZJ/xWQwtH+AVknKpEoDSVFcYWbL44dIZ75q8LX1FDpAxyHbhrDASYX9rvGbmnI+lhqwUDsH7k0n9MU4a/9lzjm+Pyn8RM+Krsq2g3Y0AbfGeGX9KfiImSZchlHdNm1JmDQgdyxJrGd27Mg== 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=2Bo9iEvdcJyRIqYGwp8RBTHrb5Fr2GYVPb3TIiWEBgU=; b=hSXrPzSyJkhLnmhOJh5i/xov7UBFc9/qHOiY+JEySyT+NTUVlE9iN637XiNhkQ+TcasEQSfc4XheBPKnD+WxXj2ynIMOTqdzcL1Rsn/JeCglmybCvz3+0zXCSbnkeJBOIdxxsKOFWrIKY9q+TKVq4NxXjDMjTjswmfh+Wd6WShc= 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 DM5PR04MB1148.namprd04.prod.outlook.com (2603:10b6:3:a7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 3 Mar 2021 11:56:36 +0000 Received: from DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::38c0:cc46:192b:1868]) by DM6PR04MB6201.namprd04.prod.outlook.com ([fe80::38c0:cc46:192b:1868%7]) with mapi id 15.20.3912.018; Wed, 3 Mar 2021 11:56:36 +0000 From: Anup Patel <anup.patel@wdc.com> To: Atish Patra <atish.patra@wdc.com>, Alistair Francis <Alistair.Francis@wdc.com> Cc: Anup Patel <anup@brainfault.org>, opensbi@lists.infradead.org, Anup Patel <anup.patel@wdc.com> Subject: [PATCH v3 07/11] lib: sbi: Add sbi_hart_reinit() function Date: Wed, 3 Mar 2021 17:25:08 +0530 Message-Id: <20210303115512.470786-8-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210303115512.470786-1-anup.patel@wdc.com> References: <20210303115512.470786-1-anup.patel@wdc.com> X-Originating-IP: [122.171.215.70] X-ClientProxiedBy: MAXPR0101CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::26) 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.171.215.70) by MAXPR0101CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Wed, 3 Mar 2021 11:56:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ac5f0144-4d21-4886-eb48-08d8de3b652f X-MS-TrafficTypeDiagnostic: DM5PR04MB1148: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DM5PR04MB1148BA62285048744D7FC59B8D989@DM5PR04MB1148.namprd04.prod.outlook.com> WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:1728; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h0gz++GxknmkriDHBRThkGKR9TKtH8GQsO0V0JqSTKsOCgGjYtRYWozjO9tF69vNT7LVKzGZJuqz7tQzoZqQQutExt+SHTVdjMA3f6D7bgAbQKTy3tWDoLs6u9ac50tbiPlNk0wGcIxvpJG9pN31rF4g6txtoc3ONT5yo7QqWEMhLpNEVP+2Om/tBNl9GQTCSJiQCb0pxvhdYyBXAIOIwyInji4T29yUCOQNor5YZYT+u5GIUiQGn4+jQ7OQqpnUZJraK8csDV21q0ohEmraiQFNZkT8w5MFPIsPr4NjAcdnHBAXI5YDKFuY6EtSmSNVhgiq0dbpOeg7ZjG5YS2pb+n4TzQSjRCAPscyELKHPY6PJKdmkWVAv2IQC2N3m8eZZJi63zg5xObf+90dHgHkU8WOjyPnrO+TC33CaSQvjaO0DwCGVi4Z4DnQfFomipfxHHUrzkwceW6nxQCldt/9Mf9lEcEwln+5096K0f5wfFcR/wRGy5h6qj4VZTk4qz6NbiUNbhwavA2ARSPdWKjAfQ== 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)(39860400002)(366004)(396003)(376002)(346002)(136003)(7696005)(8676002)(8936002)(1076003)(86362001)(316002)(478600001)(55016002)(52116002)(26005)(54906003)(36756003)(6666004)(8886007)(110136005)(83380400001)(66476007)(66556008)(66946007)(5660300002)(2906002)(16526019)(186003)(956004)(4326008)(2616005)(6636002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: tuFIEhaSyw9mVlT1mJlioTu7bugde/POgMm6vdCkEGwVJajCDtz9wu5UdM1tu1J20OZoH3bnSEis1W9ma0xpLguLFp7ru1PAJos9JJzeWHx3v6ZsIKSqeVQ2mAl1FEDuqIgFhUOYIRMdKTo3+syzomzlAPF8L2MzyXkXael8m8I0mj9ir/2I7UTXWpz1N8/Fc4v4HdTpjyPWNgvsLNWUtVJbKErxNIJrnJ/tr44KK+/jcemIt5l3I/en6xviAd7fU79EKJCTMqGrgzxBLEmUamYm7GO5ZgZg0Cz0OTUlJzGONBLRdMvqPKEf+D48AkMAHAsrYRfxXuKyNAiwhIjQjhmmaq9d/TyvVTc32YyKog2mOpiQs9egL/9Gtl6qhOjj8cN43nAprd42vucVPaiBupqsCKo/0O6EgApl3pyLwXXskA0Bjb+ZJ2U+WDbUQn9Qef5zCTm1ZpOFK50NRaWCBV0sRiFKNdEciZ5AkDGaTnsymtSexfzserzsFORv5bx4TTZGtYMBhh1if7x+wdYE0p1NfWwfJkgKRh0fFuL3nD2KDjh+0syyVlwHa3hvAUkS+7TgR8QB1LduAuUFEFmiGcIE260sp+wHI0rwt4dQGP+vj/BmacAsCB7uVHNIUeSi6WRn7BZYFisyujQ7rs/qDSQ/7hFQm7PDYGDLxhbfRGuSh+cIoByah0TAUIovJcTTTSIbRqxJZrGUtM76+7V1qqkSHhoRfxxqYyYwli9NycQYo3h5Ef00RCoW3xaxdv63a75RkZazI65rq2PjxuerfB8M3IIlf/2EyRAgpyc7zhLqHs5GnaU4C8y4efq3QqKR0TA18Gg8vS4TMWHRoeymcjLZdyvbU1+Q5SPpgIsJi/Dgxu34VCu61udhs7bQXYS80icFsSTGqD1jf8M5gp/wPB2b5Dg230KXJTQxyX3M+/SlweTZfbiSUP2bpeo/SGsRcneQ3bNHR5tL2W5A0tXT8zU6N9X6/ffc84tshGthu9OgzuxtNb6rwVrpg0693+p9QsXepMHx03e137NFk8WY/U9wxuiCz+hqy42X2NB0PpiSrphdxB0TXaO5pbydQOfqtMrhMbSwTKB0QPF742pzKHUEzo/TYQXqY90dl2dxXTR3T5kLohcvNrjNv057Z1cQSNz0rt3lnErrQJOduVAF6PwwxFTm69iK5dzu1aORim3UZvjq+zQB9yq55BCVD4RYxVpzPfKE46hkK1uCUHEaOUlCk3RUQQxy/mA35Fjm5qjvSDoVB/TgiR3wjKbt2Vx/NT0HcO4wYlqNSW0f/cxMU0NdKG99PykWkInQFYNa54kgqY5HSxVg9BTR05zPlNss X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac5f0144-4d21-4886-eb48-08d8de3b652f X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2021 11:56:35.8958 (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: xHRKNkPOZqnOuzu6q5HsGCcqNi5aEVwjW0BNzL59SLQeE8uFFBgmo36szHCSxaaIi7nZt9/35So6djv+cKN8wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR04MB1148 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210303_115652_263361_3A32A7BF X-CRM114-Status: GOOD ( 14.87 ) X-Spam-Note: SpamAssassin invocation failed X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <opensbi.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/opensbi>, <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/opensbi/> List-Post: <mailto:opensbi@lists.infradead.org> List-Help: <mailto:opensbi-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/opensbi>, <mailto:opensbi-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "opensbi" <opensbi-bounces@lists.infradead.org> Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
SBI HSM suspend implementation
|
expand
|
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index ec9e30f..031c7b0 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -27,6 +27,7 @@ enum sbi_hart_features { struct sbi_scratch; +int sbi_hart_reinit(struct sbi_scratch *scratch); int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot); extern void (*sbi_hart_expected_trap)(void); diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index fc86e9f..d91b08c 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -430,10 +430,25 @@ __mhpm_skip: hfeatures->features |= SBI_HART_HAS_TIME; } -int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot) +int sbi_hart_reinit(struct sbi_scratch *scratch) { int rc; + mstatus_init(scratch); + + rc = fp_init(scratch); + if (rc) + return rc; + + rc = delegate_traps(scratch); + if (rc) + return rc; + + return 0; +} + +int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot) +{ if (cold_boot) { if (misa_extension('H')) sbi_hart_expected_trap = &__sbi_expected_trap_hext; @@ -447,17 +462,7 @@ int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot) hart_detect_features(scratch); - mstatus_init(scratch); - - rc = fp_init(scratch); - if (rc) - return rc; - - rc = delegate_traps(scratch); - if (rc) - return rc; - - return 0; + return sbi_hart_reinit(scratch); } void __attribute__((noreturn)) sbi_hart_hang(void)