From patchwork Wed Oct 21 00:57:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1385266 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=y264mgxl; 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=KMb+6dwT; 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 4CGBtp6N5Vz9sSG for ; Wed, 21 Oct 2020 11:58: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=GESolum5+7amxUS8sYGvUf2X9+EjuCsgZmEeroNYSK8=; b=y264mgxlnY7Uaxue1LgbzAUeV QvfpiQik/0tZUBT2wwcHGZHfRfe5WlBx+CnIZI/nNVmgYGirbKWqINN2xh0W4U7Sq1HM1pNl1Tc8P O6bTIlcYMzYflZVN2MQ7h6ZmFomzQDSbor7BPG7URDa+trO/khzZzhplS4OgpCKmupp9BPfkNPoxi FK6xj64fDl7UkdAbpGTp9A6jyUWVhyvv/Lmlw1EwIwWdfVuYXl7LcXVnNxCrqrWRExDVZXFrDqNF+ wEjRymTfcqignjKiQIckd44qWh095pZMqub4KSVzHZj92I3mheMJBxcMO3Z6Q2cq4AWHFmerTHUvi w34Uv31+w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kV2S3-0007dJ-6f; Wed, 21 Oct 2020 00:58:03 +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 1kV2S1-0007bh-0J for opensbi@lists.infradead.org; Wed, 21 Oct 2020 00:58:01 +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=1603241880; x=1634777880; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fY1F84Uc0tibfywy3EEwkLPXJjuJgcQmdfytITBiNTc=; b=KMb+6dwTv1TODTg0ACuLM39MJFdSO+Ltyo0gBblekcSntdkuof7MTAgC NqjRmjVz8wMHxUsGK9YBfx/thKZ9GLuZVO7DHStB/9Jd74eUnXaMnVn9x zInSvgZcZuUnECjwzfLackCu3BXBI//LkXlNr08QdTzmi7jEuHCMR/E/e 5f0/6xOgw82lq+Vv8d42Y94LH2Q31AaSaCJi4E/LFzWvpHl+7OindrIQN l4NXCRo1hOeR3qcDUDkcR+/mLKDtdUzLDfflv+0hW5uP0M7q8DaZSHqVZ 0GEYa3hdqjtJW6rxkZAYESdxsn6GxLVcwvNjHexcZq7J+ZwYVesn1teRq Q==; IronPort-SDR: nZI4JYThRlvHNcXFKFiJksSyuJff8EDjhRSSXDy07xvHMuF1vKpXlzV2fdx99TzzgRrP29hzyN xs2XmhQ7yRxVKtZFp/JFXSSSLHH64f0CnR9pUyMdCggvIvZLgYRRcZ56U3FJHrDPPzd66wlu5C 5T9DNGHo+so+FddQMTJjmKP3BkXdO8BTlyoHXhFHFnDRjX8XhGcHYd85wosMMQ/q0DUNJuMxRM w8uXJn3ud+Gme0fMNr2/9Un0OyJGJKyYBrrd6jweWgPiu7AO3av253LyQPD6SEz8eLTOMrvLDh EA8= X-IronPort-AV: E=Sophos;i="5.77,399,1596470400"; d="scan'208";a="260357388" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 21 Oct 2020 08:57:56 +0800 IronPort-SDR: tpdYCQeh9EK8UyaI4z3qbO34tP5PbLjarcvNjWiII10vza1cDAdTUiJvs4dDgEJkxpYw+3crOY R5XbDRvf69Cjzm2vORdcY368LQWb1OdHjTSxgDRgwzS2BYN6axIMiEbtyPEesmj8sSV5vwwDoi Nbq/etgYBJw/18G73+t+CXN3nycOlhoPzNyn6dlSo4XyXjWqSAJZ38m6gMRyLA76boaScT87Kt RmtYRlV/FtsLb/4NU25FjFJFCQw4bxtHOEwPgN/KKoe3vVLc+HDrdyf1bINfc6vT+TMP5LzI01 CgEKDj/WvWQnMy/mjzMyooK3 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 17:44:22 -0700 IronPort-SDR: CQK9wXyb7RrP0o1pdltCcj7uuF7ORch6KUpRB0cXGkCQAqC/HBwmww+XOQygjRy59auON5YsdK 8S0BTs+VkJWjfbZJ/lV3IXYvcYLZ0LZlkYBRD6n3X/YcAvp7L7xi+T+Ah5tnxG0+dC9cSbQn+U K/aOgNdMegArHefEE+H5E9VoAJMXtIw4fwJeEE3HTvrTXbk6vxCr+QotS+wGi2AyIG4lvRJwaV FnixzkWlazR8Q/A+i/jC9lNQlIMXFbbugM8hQoq/BpYlJL/wD8Abu60FDF4LHFNDM4/W+OGaLG mtI= WDCIronportException: Internal Received: from usa003000.ad.shared (HELO jedi-01.hgst.com) ([10.86.60.38]) by uls-op-cesaip02.wdc.com with ESMTP; 20 Oct 2020 17:57:57 -0700 From: Atish Patra To: opensbi@lists.infradead.org Subject: [PATCH v2 1/2] lib: sbi: Check pmp range granularity and size before setting pmp Date: Tue, 20 Oct 2020 17:57:53 -0700 Message-Id: <20201021005754.2386272-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201021005754.2386272-1-atish.patra@wdc.com> References: <20201021005754.2386272-1-atish.patra@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201020_205801_180608_288CFB6D X-CRM114-Status: GOOD ( 16.08 ) 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 [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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Atish Patra , anup.patel@wdc.com Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org As per RISC-V privilege specification, a platform may choose to implement a coarser granularity scheme for PMP addresses. In that case, we shouldn't allow any pmp region size smaller than the platform supports. A platform may not also implement all the bits for a PMP address specified in the priv specification. The pmp range granularity and size is dynamically detected while detecting pmp support. Any pmp modification request beyond these values will not succeed. Signed-off-by: Atish Patra --- include/sbi/sbi_hart.h | 2 ++ lib/sbi/sbi_hart.c | 56 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index 3ac150036c79..c1baae57d898 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -39,6 +39,8 @@ unsigned int sbi_hart_mhpm_count(struct sbi_scratch *scratch); void sbi_hart_delegation_dump(struct sbi_scratch *scratch, const char *prefix, const char *suffix); unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch); +unsigned long sbi_hart_pmp_gran(struct sbi_scratch *scratch); +unsigned int sbi_hart_pmp_sz_bits(struct sbi_scratch *scratch); int sbi_hart_pmp_configure(struct sbi_scratch *scratch); bool sbi_hart_has_feature(struct sbi_scratch *scratch, unsigned long feature); void sbi_hart_get_features_str(struct sbi_scratch *scratch, diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 8ded82841d82..5acb02aecc11 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -30,6 +30,8 @@ void (*sbi_hart_expected_trap)(void) = &__sbi_expected_trap; struct hart_features { unsigned long features; unsigned int pmp_count; + unsigned int pmp_sz_bits; + unsigned long pmp_gran; unsigned int mhpm_count; }; static unsigned long hart_features_offset; @@ -159,16 +161,36 @@ unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch) return hfeatures->pmp_count; } +unsigned long sbi_hart_pmp_gran(struct sbi_scratch *scratch) +{ + struct hart_features *hfeatures = + sbi_scratch_offset_ptr(scratch, hart_features_offset); + + return hfeatures->pmp_gran; +} + +unsigned int sbi_hart_pmp_sz_bits(struct sbi_scratch *scratch) +{ + struct hart_features *hfeatures = + sbi_scratch_offset_ptr(scratch, hart_features_offset); + + return hfeatures->pmp_sz_bits; +} + int sbi_hart_pmp_configure(struct sbi_scratch *scratch) { struct sbi_domain_memregion *reg; struct sbi_domain *dom = sbi_domain_thishart_ptr(); - unsigned int pmp_idx = 0, pmp_flags; + unsigned int pmp_idx = 0, pmp_flags, pmp_bits; unsigned int pmp_count = sbi_hart_pmp_count(scratch); + unsigned long pmp_addr, pmp_gran_log2; if (!pmp_count) return 0; + pmp_gran_log2 = log2roundup(sbi_hart_pmp_gran(scratch)); + pmp_bits = sbi_hart_pmp_sz_bits(scratch); + sbi_domain_for_each_memregion(dom, reg) { if (pmp_count <= pmp_idx) break; @@ -183,7 +205,9 @@ int sbi_hart_pmp_configure(struct sbi_scratch *scratch) if (reg->flags & SBI_DOMAIN_MEMREGION_MMODE) pmp_flags |= PMP_L; - pmp_set(pmp_idx++, pmp_flags, reg->base, reg->order); + pmp_addr = reg->base >> PMP_SHIFT; + if (pmp_gran_log2 <= reg->order && pmp_addr < (1UL << pmp_bits)) + pmp_set(pmp_idx++, pmp_flags, reg->base, reg->order); } return 0; @@ -282,11 +306,26 @@ done: sbi_strncpy(features_str, "none", nfstr); } +static unsigned long hart_pmp_get_allowed_addr(void) +{ + unsigned long val = 0; + struct sbi_trap_info trap = {0}; + + csr_write_allowed(CSR_PMPADDR0, (ulong)&trap, PMP_ADDR_MASK); \ + if (!trap.cause) { + val = csr_read_allowed(CSR_PMPADDR0, (ulong)&trap); + if (trap.cause) + val = 0; + } + + return val; +} + static void hart_detect_features(struct sbi_scratch *scratch) { struct sbi_trap_info trap = {0}; struct hart_features *hfeatures; - unsigned long val; + unsigned long val, msb, lsb; /* Reset hart features */ hfeatures = sbi_scratch_offset_ptr(scratch, hart_features_offset); @@ -332,8 +371,15 @@ static void hart_detect_features(struct sbi_scratch *scratch) __check_csr_32(__csr + 0, __rdonly, __wrval, __field, __skip) \ __check_csr_32(__csr + 32, __rdonly, __wrval, __field, __skip) - /* Detect number of PMP regions */ - __check_csr_64(CSR_PMPADDR0, 0, 1UL, pmp_count, __pmp_skip); + /* Detect number of PMP regions. At least PMPADDR0 should be implemented*/ + val = hart_pmp_get_allowed_addr(); + if (val) { + lsb = __ffs(val); + msb = __fls(val); + hfeatures->pmp_gran = 1 << (lsb + 2); + hfeatures->pmp_sz_bits = msb + 1; + __check_csr_64(CSR_PMPADDR0, 0, val, pmp_count, __pmp_skip); + } __pmp_skip: /* Detect number of MHPM counters */ From patchwork Wed Oct 21 00:57:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1385264 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=QAcNKbq3; 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=MUh4EMFj; 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 4CGBtm4WCbz9sPB for ; Wed, 21 Oct 2020 11:58:08 +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=aoPJMtMim0MfLFooCjaKpG2XoVfaeEPZxho5EhpIVo4=; b=QAcNKbq3wW1XkCjUDELnNWbUQ AxCVJPsqIVBOvrTJey1ptSaRUe8HYno9FpoUrhdw9sLixmM/yykG0rJFHkTP+ijnra2f+6VEuiYCX DDaV8gFshUuxKM65MMEczlyA/N1J5rZgKoCvURo0HFH7nibi2w7uOQOn9C5/WBZJa7rh5q+BSEcv9 EBp6FpC3M8sEKyq8KcBnlvaKjViS3Dv6GSacKK1ja5+CLbjxcGCvFDAtgcB5+Rc5ZUiJ2s86THIH+ aGOfWwiOwznj/mEu3WoPPDucyGI/ZYdfEsDaYNYIbzgf0mOiNpH3opyZSoJlHEoa5avzUtvPE+W6G 2utFCNzGg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kV2S3-0007dc-RS; Wed, 21 Oct 2020 00:58:03 +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 1kV2S1-0007cO-Ev for opensbi@lists.infradead.org; Wed, 21 Oct 2020 00:58:02 +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=1603241881; x=1634777881; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A+aZ8Kn5dolxUI46stREvZaHJ6c12yqwH+/ZJAVWCpQ=; b=MUh4EMFjc62BDXUIBhqZmgd/B+1zup24PLDpMu86t07jp/LvM5XE2yTy iUEKCnQ9FzLmRW1iIudYavgnPHommUSVeUw6PTPFg3pnjMHYCFgBkKrpn ziI0Ev08yWnr8WggP/gs8fgiXp5QDUDwFY5Tg+Bz66osDK4pcBvLMyTUL gBNkr4iQvr7e7Rasn/idmijBrXm3qMey4kFEy9icnrE99cPlP+VgSgC4w bWHPp8ZLprb0IxRcXrrETvOgErwSTJ7ztGm+PzXm/nXJLLvsoG9sdCOQt 34+3v9IMfPKDNdGv+V7mACvqRNhG+zmLjoXNJet7PgEnk/KKzbkRlRNpm Q==; IronPort-SDR: eGcZ/mMPcjsrnYjM7MJTN2r/uMVW5F1ca8s5T37wu6EdCeYhpGPtlZuQL4ZBCrLQmooN00pOlh m5cy9tWt+OSPYzOuPm2hLKlUvoM3b6QqbdxfmVzE0eZxygU960usKYScdxlf64+EYVXzHXao/G KZrP+JR8y2pzEXBPXF9vRA5Kp38PSwBfaX3rySkY7s0XxHY5u9s/u6QsQMKCTKoMmXoFKws0M7 uAKRyfGHjU1Dij9BlfyxsEtP4iEqjAgm9ZaKOtHymYq7Cp50A4DiKQ8sqyd0Dp9Jgt7R47AeQH dsk= X-IronPort-AV: E=Sophos;i="5.77,399,1596470400"; d="scan'208";a="260357389" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 21 Oct 2020 08:57:56 +0800 IronPort-SDR: qMMHyTERHLstw7hudWDfIf65wMsuh7DG+ZtzWriD6MhLZFmGPIjATSkZsACMpAArFqjZY8l+Af udOkmd+8gAepa71BFdqyOiP9IpceaqhLdjPEIZwCu4GghZ3FvwxS0V9FwRAk/Af1CLoT04l5G4 ca83MxoNvbVJYeH0S3+VrG2vdEuhkQ4MH0cTHaVpPHtJHrOMRO2Y2cRe16X6+7GxNEfZmBP3b1 9SKm1X4/rByqnQhVqxP/y1Bx4yYwWDt/zYI6h7UV1qZ+TOr7NTkTiC3gIPAOBYB0rJkFzv3S+J Ej7h3cguU22HwRmwX8IGdSMT Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 17:44:22 -0700 IronPort-SDR: Ejg3aXYk6W7cOwnEgMLDpi4E/3mFycU2SbGtnLa+uzUG9N7cQHj9gmBpwA0C++M6JYj8a0nTUM SnpvvVCM/hrpMqkqM0/74RPRvcmYVTqVwiXjwLdXn0o3bRYkxWFTtSg7CanNX1crBsJkXIVocf lhr/h0NWn/IqK326hiOC3WnyEhm3wOLQ6T4TdaDQVe7wR6gZNv2H0L3lwZo7Aw9SaxdWVFRLKX EYhA5aF3fvEjEqJvv4rpC8KZJ1UBF07rtrD4XGBmmt4RTptp10ACvcCv+NNwyThBZc97LMi5qb UWA= WDCIronportException: Internal Received: from usa003000.ad.shared (HELO jedi-01.hgst.com) ([10.86.60.38]) by uls-op-cesaip02.wdc.com with ESMTP; 20 Oct 2020 17:57:57 -0700 From: Atish Patra To: opensbi@lists.infradead.org Subject: [PATCH v2 2/2] lib: sbi: Improve boot time print with additional PMP information Date: Tue, 20 Oct 2020 17:57:54 -0700 Message-Id: <20201021005754.2386272-3-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201021005754.2386272-1-atish.patra@wdc.com> References: <20201021005754.2386272-1-atish.patra@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201020_205801_646990_08BC16FE X-CRM114-Status: UNSURE ( 9.68 ) X-CRM114-Notice: Please train this message. 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 [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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Atish Patra , anup.patel@wdc.com Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We know about pmp granularity and number of bits supported by PMP. Show those information in the boot time info print Signed-off-by: Atish Patra Reviewed-by: Anup Patel --- lib/sbi/sbi_init.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index 318163602e4a..bd9a3a88b655 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -79,14 +79,17 @@ static void sbi_boot_prints(struct sbi_scratch *scratch, u32 hartid) sbi_domain_dump_all(""); /* Boot HART details */ - sbi_printf("Boot HART ID : %u\n", hartid); - sbi_printf("Boot HART Domain : %s\n", dom->name); + sbi_printf("Boot HART ID : %u\n", hartid); + sbi_printf("Boot HART Domain : %s\n", dom->name); misa_string(xlen, str, sizeof(str)); - sbi_printf("Boot HART ISA : %s\n", str); + sbi_printf("Boot HART ISA : %s\n", str); sbi_hart_get_features_str(scratch, str, sizeof(str)); - sbi_printf("Boot HART Features : %s\n", str); - sbi_printf("Boot HART PMP Count : %d\n", sbi_hart_pmp_count(scratch)); - sbi_printf("Boot HART MHPM Count: %d\n", sbi_hart_mhpm_count(scratch)); + sbi_printf("Boot HART Features : %s\n", str); + sbi_printf("Boot HART PMP Count : %d\n", sbi_hart_pmp_count(scratch)); + sbi_printf("Boot HART PMP Granularity : %lu\n", sbi_hart_pmp_gran(scratch)); + sbi_printf("Boot HART PMP Address bits: %d\n", sbi_hart_pmp_sz_bits(scratch)); + sbi_printf("Boot HART MHPM Count : %d\n", sbi_hart_mhpm_count(scratch)); + sbi_printf("Boot HART MHPM Count : %d\n", sbi_hart_mhpm_count(scratch)); sbi_hart_delegation_dump(scratch, "Boot HART ", " "); }