From patchwork Thu Aug 22 06:50:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Gupta X-Patchwork-Id: 1975276 Return-Path: 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=xUHkV4Nt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=uoXw2ko1; 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 4WqDPT40Twz1ygv for ; Thu, 22 Aug 2024 16:51:09 +1000 (AEST) 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: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=ULRjgCUMwAIfL18Z58RYf78OT1+G/ev+3AMDpOMtW3M=; b=xUHkV4NtwcQ6ki KVzvLmgiF2ZgZIhycADlpK1UIkaF8toYQxRZ84GxFlB1F6OLW5Ahj3RjW8wGGt5ABqFwtghERFCE5 hGJsFYWwT5fzQzA6UN4fUmMi/Rp8Leb9CQPzBQdNmdXHwVS3Qt8vtnLvekevHz8Hi2s1nuLqR0HRV wpUNe5Sx+x62y7KACfNrDB57bEc7TPAHrwqISfEGMLZ7QC9fNjW39c/gL7rBSOGZBP57hlxydroP4 9YsihWhvZzKuClnq163OdyfGEJTVZ0CApdwsONiHqyhHVBO/V144xQOmsIwsN91gb/iGAyCza+SgB Jja7o0+XCTTAquynmotg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh1ex-0000000BhHJ-10i0; Thu, 22 Aug 2024 06:51:03 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh1eu-0000000BhFb-1pSX for opensbi@lists.infradead.org; Thu, 22 Aug 2024 06:51:01 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-713eeb4e4a9so394205b3a.0 for ; Wed, 21 Aug 2024 23:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1724309459; x=1724914259; 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=Dc0OZFeSdfhIKvQi3Bq4JJVWhLtpZPp9oEUW0NgbPtw=; b=uoXw2ko1IaSQjeNvN2KPd4aBH6oHNXlwsFxXwNgAHQoM2Qtujb04X8K+s1b4uK02q4 LHWcyQ/Z5E0f1v3l2CvKr4aHaeEggt9RC62KAZqmZtY1QfoFQg7brAcKr4xlG9QMlEJx woVTQ3OJl2cOK1ld/bAjRYDUvDVkxpDoAuFdnoHRQghfSkReoD0L02AtFPqTEBOxvaj5 KiyKhZbbVKMDsJTafjqqG3KkoPcSI5ohxG2rfMTC/BO906BJwRpoLuDMyNx8HasYyLFD HgBETW1BTO/AE4dg0IY0BVwr0RzeygjTzg2ENJa7UWuCoTXFgleYHEJDQCQtAFFtgbns FclA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724309459; x=1724914259; 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=Dc0OZFeSdfhIKvQi3Bq4JJVWhLtpZPp9oEUW0NgbPtw=; b=TfVlJJ6I8AAGgmel9U3tROnlsJcUMNqqxVAGXDmMu4uOKoKY6VKZEMjmIxvoqeGA94 E3pw8029YsXoi8B/zg1xIAmrXRPaL7CtWIKKNw/K9q1PRVTFcv7rS2cB7sAxdWos6uo1 hr3Ps/5qrKVY8c43CH0yV0sR9oVd3YnQrnCLf5XiGG9MiMkDS+nuacOfm+bwoIqTVd52 VD7gP79oC8OLdqwacfuDualC3H/3RU2bigwfEe2vam71/W8Q4FFV8fP4Tkcxf0HtvSkL QTzc2b5CFHWAEyAl8IPJsYgXHZOJNzg78UFVe+kRK9WsedgZtvVSZwmzECfXhA81KLMZ lIzQ== X-Gm-Message-State: AOJu0YwgHUj0SaBxPOdX8I/+GNNLewHLmczEwkh51aMDtlT2612aod03 gNutRR0BZnU7kpYxGZ3fAFx6klU+nainnC/E8/o0T1KnB/JwOzFA3MA94IOSPxVV02cslRhbs/D a X-Google-Smtp-Source: AGHT+IEZh4it2TSrljt7VPCHpMlWQPJPOWMbpJcUl9WmQzYnvsKm9tovijNMb0XDtRNbZIlroKPrIg== X-Received: by 2002:a05:6a00:810:b0:714:1e28:da95 with SMTP id d2e1a72fcca58-7142346a0ffmr5703061b3a.7.1724309459040; Wed, 21 Aug 2024 23:50:59 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-714342e02basm699769b3a.125.2024.08.21.23.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 23:50:58 -0700 (PDT) From: Deepak Gupta To: opensbi@lists.infradead.org Subject: [PATCH v2 3/3] lib: sbi: sw check exception delegation Date: Wed, 21 Aug 2024 23:50:49 -0700 Message-ID: <20240822065049.3923308-4-debug@rivosinc.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240822065049.3923308-1-debug@rivosinc.com> References: <20240822065049.3923308-1-debug@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_235100_500154_1A9E21AF X-CRM114-Status: UNSURE ( 8.90 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) 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: zicfiss and zicfilp introduces new exception (cause=18). Delegate this exception to S mode because cfi violations in U / S will be reported via this exception. Signed-off-by: Deepak Gupta Reviewed-by: Samuel Holland --- lib/sbi/sbi_hart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Content analysis details: (-1.9 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:436 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: apatel@ventanamicro.com, Deepak Gupta , atishp@rivosinc.com Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org zicfiss and zicfilp introduces new exception (cause=18). Delegate this exception to S mode because cfi violations in U / S will be reported via this exception. Signed-off-by: Deepak Gupta Reviewed-by: Samuel Holland --- lib/sbi/sbi_hart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 0636021..1f6c4c8 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -207,7 +207,8 @@ static int delegate_traps(struct sbi_scratch *scratch) if (sbi_platform_has_mfaults_delegation(plat)) exceptions |= (1U << CAUSE_FETCH_PAGE_FAULT) | (1U << CAUSE_LOAD_PAGE_FAULT) | - (1U << CAUSE_STORE_PAGE_FAULT); + (1U << CAUSE_STORE_PAGE_FAULT)| + (1U << CAUSE_SW_CHECK_EXCP); /* * If hypervisor extension available then we only handle hypervisor