Message ID | 20231212095926.13371-7-apatel@ventanamicro.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@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=fqDGwt98; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=GIB1rqAw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SqDd03NKcz20H3 for <incoming@patchwork.ozlabs.org>; Tue, 12 Dec 2023 21:00:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=CKDNkTlYC9dhmRinU0YntuLdYF6bMOcF20lm6Rr+fpE=; b=fqDGwt98D8/5th k+Mu7pxh7FLMUuXSyYBDhJ6m8YHWPyxIxm+bLEfCL4L8hxrCIPy30pMdyF5QvrqqPCeiCvwdUEINx DctJIGL3qfh6+nBiZQs0ov5bG4OBxRcuNV47gqKKfE7QKyfFqYHRriCyFhpwa5vH0IKnRe1E0ZY4F 4/2GudMpLHS0emAcn3kQbX56xYDcSCbhEbGWHPss052S+dJu+29Y9XHGdqY8LSesFhEidzeirbCDS 2tNU6qmrHBa/XFOxfBgiKaHQrMOs3DTbHTKadNJF3WleflXtwXOR5p18DEfQjUthpgc7jz77Uz3cb ej/JLnWsrSJQV4IH9CQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rCzYe-00BFpw-1n; Tue, 12 Dec 2023 10:00:08 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rCzYb-00BFnl-1l for opensbi@lists.infradead.org; Tue, 12 Dec 2023 10:00:06 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1d0c4d84bf6so31106905ad.1 for <opensbi@lists.infradead.org>; Tue, 12 Dec 2023 02:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1702375204; x=1702980004; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sB9FoMpSryIwuuyJgBXFkOWHIC1fwKc5eCW8Ra0xEUo=; b=GIB1rqAwj3F7qMGbKbSSK/FOMvZ5ODJxZtC5xiNxh62G0XDm2XMPoDfDFbbjBOpgJm VLUM/q+eq3zcchnmmXekF1K2JyxTqGbJYGoNOCYV/8ifaznOSUs9eE1FpSJg/5ChA1yx EmSu2isRDeG29/p+CDOe0B6tEggMxtiFD5vrv3Evx8ASMyyngZTD9bE3v+c7vjlhs16g PM+8CGDAKQhnHPc60NXl4SLSZOTTFXLudUPUApskpx8eCiaorZVVcF5QbBbUNGoCWnUr WjxPaTJYVamdBuW7m6WvwGBklQbL/R/+HcNo8sUidMw+55RbdfcOpGrvTHjIpBmcKduX 9kdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702375204; x=1702980004; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sB9FoMpSryIwuuyJgBXFkOWHIC1fwKc5eCW8Ra0xEUo=; b=clhgDqP/vHI8TBA5yc7IwWSi8rHMp9q95JAZoYvz8X03l+P4wCZ4kQD0TJBVCezjb5 la5ly2paPmSs3daND+L7657EFGUjGpafGHEw8Tpw2hi8m3p6Jdoh7JhwlvxN8+lwyYFm +3n8kmNTOrJKvd78uWeYjx3kT4C60/K4z7GtflH+L7fBSc5eFI9IfQzmfqKZ9V1UIvlb /qQmEHpInYl0QtCgynO7/iRexAsLmnuA4NxlvR3FzwqCp+ogPzAxWef4ypuzkYuyrzLg TTkcuZjvACCOLH0N7lYE8mqHZWsrPkkOjd6bxK2E9Ds9OtOIILa6CiE+wICR1N6sMCwG pJvA== X-Gm-Message-State: AOJu0YzWjLG/I8CTThUlmpx6jcWu3XgK4glOiGsVkR8d1cfyZ+l15Z3w tbzZ8L1KLWngzR6QpXQ302P6QQ== X-Google-Smtp-Source: AGHT+IFZKn8AFwhJjrWjlgZTVadHxq4tBG/X+em7WpYcyBvL3Xbek1M5wlDi3saySgbK7HCOCeQ7bg== X-Received: by 2002:a17:902:db0c:b0:1d0:69d9:f391 with SMTP id m12-20020a170902db0c00b001d069d9f391mr3303205plx.40.1702375204237; Tue, 12 Dec 2023 02:00:04 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id g24-20020a170902869800b001c3f7fd1ef7sm8186133plo.12.2023.12.12.02.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 02:00:03 -0800 (PST) From: Anup Patel <apatel@ventanamicro.com> To: Atish Patra <atishp@atishpatra.org> Cc: Andrew Jones <ajones@ventanamicro.com>, Anup Patel <anup@brainfault.org>, opensbi@lists.infradead.org, Anup Patel <apatel@ventanamicro.com> Subject: [PATCH v2 6/6] lib: sbi: Do not enter OpenSBI with mseccfg.MML == 1 Date: Tue, 12 Dec 2023 15:29:26 +0530 Message-Id: <20231212095926.13371-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231212095926.13371-1-apatel@ventanamicro.com> References: <20231212095926.13371-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231212_020005_609111_540F9E93 X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On platforms with Smepmp, the previous booting stage must enter OpenSBI with mseccfg.MML == 0. This allows OpenSBI to configure it's own M-mode only regions without depending on the previous booting s [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 |
Assorted improvements
|
expand
|
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 6acff37..16da38d 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -975,6 +975,16 @@ __pmp_skip: /* Mark hart feature detection done */ hfeatures->detected = true; + /* + * On platforms with Smepmp, the previous booting stage must + * enter OpenSBI with mseccfg.MML == 0. This allows OpenSBI + * to configure it's own M-mode only regions without depending + * on the previous booting stage. + */ + if (sbi_hart_has_extension(scratch, SBI_HART_EXT_SMEPMP) && + (csr_read(CSR_MSECCFG) & MSECCFG_MML)) + return SBI_EILL; + return 0; }
On platforms with Smepmp, the previous booting stage must enter OpenSBI with mseccfg.MML == 0. This allows OpenSBI to configure it's own M-mode only regions without depending on the previous booting stage. Signed-off-by: Anup Patel <apatel@ventanamicro.com> --- lib/sbi/sbi_hart.c | 10 ++++++++++ 1 file changed, 10 insertions(+)