From patchwork Thu Oct 15 13:26: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: 1382675 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=usofDJk2; 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=fzuulRol; 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=qRKv71RK; 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 4CBqps3Y7Vz9sRk for ; Fri, 16 Oct 2020 00:28: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=nLLNu2lPs1NUH1lVgjoRiJqQMIlIDHofWsDxX5NLgsI=; b=usofDJk2+G+nrWhXr2zsalL1O joUkHChb76QBkDozLVWAVlOo5jrm0h2lj6f/N6S3fz1uzGdCfmbDIyIlFCju3lc3P7JiKaUo8Ol8C +5Cv8AEesiCdXYvB55zO0HTEo8R050zR9/NMJN0IpHgLWhBn4s/81P2R3y3h6EEZIfsff9gVuk5iu 23kWzp/iMrXpAusRAUpN7eaJDJpV2bu1cc5ILkAMq6zS+1PiVIJ4spL5j3X+boJaHswGzvPRFY2pi 4rMHlaKSFn3QtsqJL/JLs7QR4pSZiYRDwf1of4RlIZnKRrYugcNyw42wh23xlqAxjFKUk+w59Tqd6 5yj2elqNQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT3IV-0004Ri-GR; Thu, 15 Oct 2020 13:27:59 +0000 Received: from esa3.hgst.iphmx.com ([216.71.153.141]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT3IS-0004PA-LA for opensbi@lists.infradead.org; Thu, 15 Oct 2020 13:27:57 +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=1602768476; x=1634304476; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=xLbjfDdIP577KiMB+jJ1KmvjY4xaFeuK12Z/jgXtFSI=; b=fzuulRolinLWHAIrj1ktt72QReCDafVCt7robrlwyGWonXyyZot+/nJd 6CRvkwTG0j+SuLoMuUu3UiA9qg6/ht7rW3ZC2Dc3U8gINty6gUS9o4dU1 AjknQNIx7jdFp3GZdfcHn2evwzn4FxrXA67SsAJNcxzzP6/JBl3+Oecp2 Axqu1n28qYudu2VZfbreoJcwxQ8xk2qrA7+MDFYd8Kvkss1Aj9sclJP+p h4B053qGY2UaJxcZWe8Nlgt52z9TZJJ3H7qMMhEXQR8udpjPE5C9d8OK7 5Vrdmf2SqvdMrhhnDp1iJKFV91xpLbCAkfSj0yKDn+qhf+Dh7ig1bVWt9 g==; IronPort-SDR: WMe5252vIHFeeCOLrl33jA5qxnwaAxNmjOZIE0WXxtk3Bch77eDVBc9qXi16OMtvHgnqd1w+X5 +WJ/SQM17V7pua0yPcs+Ku/o3qUgp4eKRjQ+zKOZmR08B+zSSoTM3ookL+4MmU4+0U7fNULgCV gRNA5X7h2dSEVn57yZEocYQMHK2hcmEeb6T0+EEVAcEu6X4TBiRlqZhR1uu+OJGHxXvyr+V34s y1A11+/HqhQ5IEwJZYOmSaDXRpEJOrXiKKj0L781Hgw4VXoyhV6nhLGO//zWgHpjN2XyJHvJBU Wts= X-IronPort-AV: E=Sophos;i="5.77,379,1596470400"; d="scan'208";a="154457486" Received: from mail-cys01nam02lp2051.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([104.47.37.51]) by ob1.hgst.iphmx.com with ESMTP; 15 Oct 2020 21:27:56 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E3/C8dBQWxkHQQg5GyzvuMh5KNjHirlwSDG8FVRXNkqtW955vhhjRe6KrRw1ldwxs1W7zGKssfGzmNad+ud/M60AWXBiv4NE7xyp8PJApDnL0Ph2IKw7NGWN/BAmr0feB5ReZNVmB/BQdB341UeC3+VxxpJ5WsT38Sf9zird2FvYdRA1pVOoH/xLuEC+aCI98vY2HUkVL1NXkoYFiBEmX4SSeAbjj9CQWog2BCinNeUPCb2clToUNQMD+Tgx0m3pgVn9bXvI9FIVzsh1Tv5JvAWpS2lUPuwMVYsZiMtv0WZ2+Szt0TNoUk7rh72kgLHnTS5F6jxiNBTdJhH3Xjsj8A== 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=QP4+bUEUkUgkkRytG7N2xL96h+D5rTdenRYgGfN4gvg=; b=lhquqY/RCoudoFUGReh2bL9jfa17N//9LVdLX1SWNerkfl/LNl+uxkrNvIyEtc0I4XCMiqGIrJhj6OaVo5hAuJaNHZl2y1f7x6Emiu/ATPzXbWQQ5CruLFbTBvLgeZywo+Ou3B0BDqSKD5P2wR4FqqplA5xFCVFLz495+meu1xD0EkQYKtQGsk/MuiU+IuXvRlp8+HWYjw1Kw3tkuZWhXE7B5KeriDQM0tId1gT6X+RUmB8lp68ezk73SUNgZlMZn8KwelLoYiCtzldjCgX0VFHQitqReNuTyYTzRno1nAlD7RcyI7njDb3dbWK6GYmCi7hH1L77WACTCkStnPngdw== 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=QP4+bUEUkUgkkRytG7N2xL96h+D5rTdenRYgGfN4gvg=; b=qRKv71RK9Wlt1PUtadN/fJOKshNk1SXf6ody90AN7dovZ66h3XF38pIKzPuHMhf6lvTpLt8fn9kYetW0jgoiJt5OP6ayGSU/7B4f08LN4mG2WYELcxinnSDMeteVHEH/8wchd/Rt3iHIzmdpluLHB4nqcHsmRG5o4xHiI4cjhy8= 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 DM6PR04MB6624.namprd04.prod.outlook.com (2603:10b6:5:1b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Thu, 15 Oct 2020 13:27: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.3477.021; Thu, 15 Oct 2020 13:27:55 +0000 From: Anup Patel To: Atish Patra , Alistair Francis Subject: [PATCH v2 10/16] lib: sbi: Extend sbi_system_reset() for domains Date: Thu, 15 Oct 2020 18:56:54 +0530 Message-Id: <20201015132700.2232820-11-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201015132700.2232820-1-anup.patel@wdc.com> References: <20201015132700.2232820-1-anup.patel@wdc.com> X-Originating-IP: [122.167.44.151] X-ClientProxiedBy: MAXPR0101CA0065.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::27) 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.167.44.151) by MAXPR0101CA0065.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22 via Frontend Transport; Thu, 15 Oct 2020 13:27:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 087a846d-29fc-402e-9977-08d8710e1f8c X-MS-TrafficTypeDiagnostic: DM6PR04MB6624: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:270; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IXpyfw2uFiAzAIOfl2IcLoSuJGEFBOYaLfrElaHqJTdLPIEYwsCwVe95wiIl2/PqgGEnhNMn5K+13dPTUZ9Kl+43SDfnhyOzXKJR4ri3lsLcSAXplkbgR7GrbOeqVeLdiu2qqIiKd4kNHlOCJLkzcbeJZMSt9RnwhXkQDfJkIp5etx84i94o2T1tIlqXNIcHTYcHIBzNneSrZFDeMeQAzONWW5Q39Ukr8yKEqiQud/4SlGG81rpFkDR6xpCPpVGj+tRfW6LITA7XUucpAZfwQ7tzTQSKKstoUZLGz6JiK6xfqTOjceg2baWq6hkoGg+fF5LTESm0BM35QK7xt6fpc7xpEQQkFza+N5Uyw11scp52B9KwdtiqLhoyBElOFLXa 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)(396003)(376002)(39860400002)(136003)(366004)(346002)(2906002)(66946007)(110136005)(66556008)(5660300002)(44832011)(66476007)(36756003)(316002)(54906003)(8886007)(8676002)(8936002)(86362001)(34490700002)(4744005)(1076003)(52116002)(26005)(16526019)(186003)(55016002)(83380400001)(478600001)(956004)(2616005)(6636002)(4326008)(7696005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: kY/az/QpJoJD0p55DerS047mI4Zs342VId02wl4QRw3SrKzRj3RZSK4No/Kez+ssU3o8X69qWP1lJE/nP7AxPZoar3b4Za+CrDYAuWI59bporBUxJl6PJzsts/pxPIBLmzYGHEh3Slfn4JMsF2w6JWpuqpEzqmnSC/9w1DBkeRjQ1w769KI7JQqF9almxJqJWry/hMlFSRF3QmtMpr6PHsEuv+T7Qus4VRQYcSHF7GOy1swsiYmS6zfbQCxMOgpZzSkDmWhw4Mbt6RHSHXRHdnoK1e2TEP9ZVvL/tI5cKsagOX9heOVG7p165LbcEzlctXjGC+rhbK4iFsv/7uWgbpBuCp9LINO4tMSbcT7BgO7agLBi+2izwrnKWz/LLZFwuJzv60doJmd5Erepay/m78q8LjArCXDDR/xfTaxjKqxgPd83JtFuOEZwG4t8RdUkEYqstDp56SI5IuJWR/rFyZoLZS4LrHzNxlm4rjB9bFzSEKUyh1qQYrEgpVdHF7Ec1078SKSLf5M2mxbrEj+uzYI/dNvZ0zcaUjk1hIzQnAr1MhiHFJoqOJGM0xL7rtQD8IdLGiaA3pywescieQ96f/fS7pOcTfBcGY12TjUbn77vak4k6cefj9Apg4qv6eSXTaxcCG7jI5JK9Gf0FgyeLA== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 087a846d-29fc-402e-9977-08d8710e1f8c X-MS-Exchange-CrossTenant-AuthSource: DM6PR04MB6201.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 13:27:55.1630 (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: wTuy4auGC7K2V/w1cSAYEjknoVVSLjSzRrJt5aS9QjhMZkDotOGbDNDe/g1+LG4Hn1ZLkxKZq4FiPbfmKZIjUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6624 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201015_092756_864340_1F556F96 X-CRM114-Status: GOOD ( 13.83 ) 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.141 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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_system_reset() should issue platform system reset only if domain of current HART is allowed to do system reset. This patch extends sbi_system_reset() as-per above. Signed-off-by: Anup Patel --- lib/sbi/sbi_system.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index a938003..96290b3 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -37,9 +37,10 @@ void __noreturn sbi_system_reset(u32 platform_reset_type) /* Stop current HART */ sbi_hsm_hart_stop(scratch, FALSE); - /* Platform specific reset */ - sbi_platform_system_reset(sbi_platform_ptr(scratch), - platform_reset_type); + /* Platform specific reset if domain allowed system reset */ + if (dom->system_reset_allowed) + sbi_platform_system_reset(sbi_platform_ptr(scratch), + platform_reset_type); /* If platform specific reset did not work then do sbi_exit() */ sbi_exit(scratch);