From patchwork Thu Nov 27 11:21:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 2169643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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 4dHDXh5pPyz1yDd for ; Thu, 27 Nov 2025 22:21:52 +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=zW1h8gH11c/uFkL2ONBBjpo+jbXDjzwdiqX//c1VHGU=; b=xP0tdM8c28+I08 33z09nF66AK6N/2Q/+N+gGvfy1aBmQ49o0tYfViuSruuyRpWicx/PxGDHpfJkLj97knekPsX04R61 Fab32wh9lMP+M/8uDgyjCwaef5pw/RDp8bDPdg4Z8gxqZ++TXJR1C8Gx1bWqHCSehOnF8lmFoQIOT B+aMroEBHgFU2UWgQ4XAxrU3Y4tEotOMT3FgVM8OCsWp/GtUgy88j5ze8hryOv9EWYrxlXcgcbRlF 0HyOCuCgqGhGrWa4ecM6uHH6ZNi4QZMZeDjC9WjFO8Subjt+QxkPnyQmLoZiKLo+2YnwH19Ild4Su DpbDXZMJumL6LKemVesw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOa4C-0000000GRmY-03jH; Thu, 27 Nov 2025 11:21:40 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOa49-0000000GRlr-3H93 for opensbi@lists.infradead.org; Thu, 27 Nov 2025 11:21:38 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2953ad5517dso7740735ad.0 for ; Thu, 27 Nov 2025 03:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1764242497; x=1764847297; 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=mcGaV2Qp3mVBKvcAYADC0hiCzv6wdTA1uoCwpxgnwVE=; b=oVXfedjoHNmZrlJlesZ3z+4i/tcwxf07U/3dGJAKQoJW2Dz/6bqxsy0Vvn2areYnqU IOzJu97u8w2zCI0e/fTtaa8nk9PTjJuW+bx/fjMsdprTG7pdaxnYju1BB4PaePnG9Dii NimBDFeRHtRTgs5pWSt/6uXhbGeEFeM94lYyvcdcjniErEW7WYMCuHS/6/cciGuuULJ1 MChKeyGb/NWw4BG5aiMFP00Bi6GBeUWgFMQpkEQY8/rSNIUsL3DQCNKKSU26yHNZ/bUI ocLU3G+f6Bh4zshsmwK5jbO6kbJCY/koJ2XehluQY1wcGh6LLDzf1s0AxxTHZO6sZ1Wo KYYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764242497; x=1764847297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mcGaV2Qp3mVBKvcAYADC0hiCzv6wdTA1uoCwpxgnwVE=; b=OU/jrjGYEPR5tIo19z/THFHaHrI3bPf+7NrWgtN33QfmLoEU6TihB27ILtV1eb2PS/ VHGfnUu8dcJnhQUmHsjovoGu00+GMG4Ai3et5/AWkfvjTegrvvlkOTE039bN82BWUrwB cwFqYwja4q88NQneKI0j/c7Uw1i7NlcgJ1ONoiPFJWlflUp7eOri54F4u4j0Ybv1H3IN OG3a00cieMvE/38WcTIQ5p838uIm/4QNdGEo2f4FySV9R+mwHzJQQHakEhgijOzdMMei MLFq/XuivPKWMfm/np8FgGknWvVEXQh/MXOcnFvl+2qQ73ulZ7Hic/iowjYBTMpNffUJ 6+og== X-Forwarded-Encrypted: i=1; AJvYcCW/50oAEJAe2apZtEhfbuEL626msbBpyFZi2A4B6nRYot23TzKj/y6TljMVz35cQx+dOLhUzcFS@lists.infradead.org X-Gm-Message-State: AOJu0YwCHzH2UaKVtLOqVlM6hUo2My9kgF+hSOnDJibMc9IHqHQYAXPT VJjOr5P6Lqe++0Plwm6NdodYN8JS+T5KY/nV+Bw3hpWEmLGMjMrm5/lGYHo/tPgTgnE= X-Gm-Gg: ASbGncs1dty4gQvpdGxtaoowCUt16l6EPtWoqaz6f0e9puTFAWR/FL8m4Xe7DDtvRhk uCcUcI3q8o3fk82lC5XFOuwg5RXZ3hWES5UEZAjQGvzGht7Vu6cpg4R1W2QDp258BeO+qTRtuQF 7k920sUEz4+ZJGxU5L68GraPD7nOAgvemjH26iZP+vI/8SnImwFvx4iPIXHENB6v5EbtugSzQPz kDbUNprxstODDFrhEEIlsC/ggp+riR5W7hFsIaOfk047KG5LUVAPitS7wWsieGV24yeLjfdNV+5 0qiFi8OKGKiDp/uqTelyzxr8UEU4PtNM0Q7LWkphGRZje8RV5T7RjVp0NdrbbvsE4RkBptYBd12 +c9NOLvF0wzT18wSep2L5clPlgT9Xuv1W0eyRKxD633FR7Ovzihcwyg9RWGSM7yKfPDeynPcLmh gFPk9ftXb4ongDepYZygh6HgJK0Jdo3nWmsceUQEWZ8Q== X-Google-Smtp-Source: AGHT+IEIFQ229/GxdE7CA5hETI/7OAHUhE5iSHtQTHML+R1y9J9svCg/YdPWAP5STdh8w+k9edLuEg== X-Received: by 2002:a17:902:daca:b0:295:59ef:df96 with SMTP id d9443c01a7336-29baaf8aa2fmr109357035ad.13.1764242496861; Thu, 27 Nov 2025 03:21:36 -0800 (PST) Received: from localhost.localdomain ([122.171.21.60]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29bceb27598sm15194125ad.62.2025.11.27.03.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Nov 2025 03:21:36 -0800 (PST) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Andrew Waterman , Anup Patel Subject: [PATCH 1/2] lib: sbi: Expose __sbi_sfence_vma_all() function Date: Thu, 27 Nov 2025 16:51:20 +0530 Message-ID: <20251127112121.334023-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251127112121.334023-1-apatel@ventanamicro.com> References: <20251127112121.334023-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251127_032137_829585_A883F6C3 X-CRM114-Status: GOOD ( 13.04 ) X-Spam-Score: 1.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: From: Andrew Waterman The __sbi_sfence_vma_all() can be shared by different parts of OpenSBI so rename __tlb_flush_all() to __sbi_sfence_vma_all() and make it global function. Signed-off-by: Andrew Waterman Signed-off-by: Anup Patel --- include/sbi/sbi_tlb.h | 2 ++ lib/sbi/sbi_hart_pmp.c | 3 ++- lib/sbi/sbi_tlb.c | 4 ++-- 3 file [...] Content analysis details: (1.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:634 listed in] [list.dnswl.org] 3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [122.171.21.60 listed in zen.spamhaus.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_EF Message has a valid DKIM or DK signature from envelope-from domain -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 -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Andrew Waterman The __sbi_sfence_vma_all() can be shared by different parts of OpenSBI so rename __tlb_flush_all() to __sbi_sfence_vma_all() and make it global function. Signed-off-by: Andrew Waterman Signed-off-by: Anup Patel --- include/sbi/sbi_tlb.h | 2 ++ lib/sbi/sbi_hart_pmp.c | 3 ++- lib/sbi/sbi_tlb.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/sbi/sbi_tlb.h b/include/sbi/sbi_tlb.h index 2c50fe85..3936e857 100644 --- a/include/sbi/sbi_tlb.h +++ b/include/sbi/sbi_tlb.h @@ -54,6 +54,8 @@ do { \ #define SBI_TLB_INFO_SIZE sizeof(struct sbi_tlb_info) +void __sbi_sfence_vma_all(); + int sbi_tlb_request(ulong hmask, ulong hbase, struct sbi_tlb_info *tinfo); int sbi_tlb_init(struct sbi_scratch *scratch, bool cold_boot); diff --git a/lib/sbi/sbi_hart_pmp.c b/lib/sbi/sbi_hart_pmp.c index ab96e2fa..1655d87c 100644 --- a/lib/sbi/sbi_hart_pmp.c +++ b/lib/sbi/sbi_hart_pmp.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* @@ -74,7 +75,7 @@ static void sbi_hart_pmp_fence(void) * conditions. */ if (misa_extension('S')) { - __asm__ __volatile__("sfence.vma"); + __sbi_sfence_vma_all(); /* * If hypervisor mode is supported, flush caching diff --git a/lib/sbi/sbi_tlb.c b/lib/sbi/sbi_tlb.c index 01b31f4e..ada60c32 100644 --- a/lib/sbi/sbi_tlb.c +++ b/lib/sbi/sbi_tlb.c @@ -29,7 +29,7 @@ static unsigned long tlb_fifo_off; static unsigned long tlb_fifo_mem_off; static unsigned long tlb_range_flush_limit; -static void tlb_flush_all(void) +void __sbi_sfence_vma_all(void) { __asm__ __volatile("sfence.vma"); } @@ -86,7 +86,7 @@ static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo) sbi_pmu_ctr_incr_fw(SBI_PMU_FW_SFENCE_VMA_RCVD); if ((start == 0 && size == 0) || (size == SBI_TLB_FLUSH_ALL)) { - tlb_flush_all(); + __sbi_sfence_vma_all(); return; } From patchwork Thu Nov 27 11:21:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 2169645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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 4dHDXj2831z1yZ0 for ; Thu, 27 Nov 2025 22:21:52 +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=0a4MWonPl+xnOBAvB3lxdvbrkeE+Ju9Tmqj2jHl3vCw=; b=ehZKzYzaD84LrP LCxr7DAtcZiR7+7PROGzMaaIKoIj7rMzk1LhinhHpFg24g9/nEBKt63OPXsF3h8g5dDvVXyWdhKqD siGXDLMb6P12jysg/nBP59bcQdk65UkTr3xIyA/nVQADmxRpOP4bUDJOIIHeZ0j35HMTdk4MZIjxX lCSG1XEQVQ6ukP/XdNEFegYTn3vOGyXodS+xZ30jFKMA0XvDaibdjBEF58k5k7sFOpiC7nGAlv+Uj oEDLfQ9baKFTw8djU7jrVBWYNfGWNQLjm1Tp+l7bFMGeootAhqL0WFBw4llrjFy+7Lw2Uwh6keNFb PWX9AdF7jECxIYiHgMLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOa4E-0000000GRng-1n9D; Thu, 27 Nov 2025 11:21:42 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOa4C-0000000GRmq-2V5R for opensbi@lists.infradead.org; Thu, 27 Nov 2025 11:21:41 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-29558061c68so10697755ad.0 for ; Thu, 27 Nov 2025 03:21:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1764242500; x=1764847300; 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=nSuWCCNaBBQN5d+PiGRxMZNhJaccHTwC/uwm54t0YBs=; b=SSDzsYk8SHNWp4JdlXmCMl1ZMHKLFWtjLQB5k57UQbCXg8lltZkFraacp1Y74QUVHJ 5hsww8Nofm1dnVYBJHPGd7kG4+6p8Z3XVg3RlJGSnyPiVk12fWtXUB901P1LW8YirwDi bDjUaqQA6B5IIpZOJ4ZvhA/9DHhJ0fkQnfmf3x6qia9ojGQrHbixEBzVaOvzoyMYMw2o UTYDAbR6nJ15mRmaCzAdpMvn7Oq09AjLZhte8pzjLYHuXTwM8GbOy6YCWfhSLWic1bZN m1FxGQxxnziSyHY6uYcXPa3oi8UVpnwOBddhZvqwfL3RK70Cdg9fjjw7tubbr7DE8URj tUdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764242500; x=1764847300; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nSuWCCNaBBQN5d+PiGRxMZNhJaccHTwC/uwm54t0YBs=; b=kcjx5Izt3VZR0l5JUNiOF7DTLiL9n+pBFbCU31NnmcVGEznuFqRU15NaqJLb0YTkQB tcCOq3TYeg9Ob52YGYrt9j1SuT9NrYSHje6cmkKogKKZF+OEbAcnxvt0AMxrFmoqFBzx SWXJiBn0cuLBbVRLd0syM/m9Sgug/Ehfi1LNIJT0k3iPI8CvyAGFlmHsDJKAj+F8Yw3+ RrRFNCxxTSyJC5SsSxe0jnc4Uh0QN4FMTk8HZKVun9Fox8BFW8RAAtLXd46Z2wr7Z4ID cwodzXLqk0RgZHbDaF88/zh/sg4AyWMOHZCvxhRKfr6qwQuTVWnxfG9FUvz7VKQog0Xv pUxw== X-Forwarded-Encrypted: i=1; AJvYcCWlWlUJiSLazx7SIrTY96ZSKWZjbEYJu9bO0C/H7y4sOMUeGLVEJLJe5XgNRlsIdp8qbnDSTWpz@lists.infradead.org X-Gm-Message-State: AOJu0YxhDKEf1MdF9dzO/7O5PukxQHlhqPn4Ae+C3BhKtsncctQ7bJKB TYOx3KmOCLJF0pSf/8qAP1d5TOtWL0L5CZ6zjEK3mpOIRtLDSkhbSFnTrvmPM6PqSHE= X-Gm-Gg: ASbGncvVlC7nJiofNmqJ/87xuozcLPTS5AjidII8Z5TzhuNUTo8Epu8Io3bj7sgXERH 3wTUnkvMC3zH6y7MBTfs90rGKb5RxiWXmnPnlbYBknWXAAld2Ooy2sB9HzsE7dAFUxPfAkFrpP3 HmRLND4krA6IfM2fuicQShLi1yutnWJG7uxdAD7KSMlyx6Seh1SjECCrXyHaNIxKOcM60/N3QPf Jmhf9Gc9hmOCiV3b0ryKatYT3zcILR2So/mSr2Cmj7CPzdSupJu3EqWXh4pWm8dNn2w+pBteOT0 B07wWibERkGuDmxWj8WbTk/tbQ8id9i0mlzxUVcY2Ta1ivL/gqYE8b1gcmnTyia1Rf8zGb6/2zB J1DCNa0mEf6G+3VPBQ2fKxRsx4o7pmudCYmVpHw35CfQ/qtih+caANNnc2OP4MfG0qC9gg5uBEh PVxnk95q4LhODfHJ+RAbZJKrWu9EBxHObnSXwIYMttmQ== X-Google-Smtp-Source: AGHT+IHA3kQdaJQmDSbXii7Z+jNEncddlyOVsJ/0s1mdRBEFQ6cHfxLKXKNMT/9l3iIN45ZxbjeN8g== X-Received: by 2002:a17:903:11c5:b0:298:1422:510d with SMTP id d9443c01a7336-29b6bf7c9e5mr247990905ad.48.1764242499617; Thu, 27 Nov 2025 03:21:39 -0800 (PST) Received: from localhost.localdomain ([122.171.21.60]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29bceb27598sm15194125ad.62.2025.11.27.03.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Nov 2025 03:21:39 -0800 (PST) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Andrew Waterman , Anup Patel Subject: [PATCH 2/2] lib: sbi: Flush TLBs upon FWFT ADUE change Date: Thu, 27 Nov 2025 16:51:21 +0530 Message-ID: <20251127112121.334023-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251127112121.334023-1-apatel@ventanamicro.com> References: <20251127112121.334023-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251127_032140_737800_F0D090BF X-CRM114-Status: GOOD ( 12.25 ) X-Spam-Score: 1.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: From: Andrew Waterman A clarification has been added to the RISC-V privileged specification regarding synchronization requirements when xenvcfg.ADUE changes. (Refer, the following commit in the RISC-V Privileged ISA spec h [...] Content analysis details: (1.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:62f listed in] [list.dnswl.org] 3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [122.171.21.60 listed in zen.spamhaus.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_EF Message has a valid DKIM or DK signature from envelope-from domain -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 -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Andrew Waterman A clarification has been added to the RISC-V privileged specification regarding synchronization requirements when xenvcfg.ADUE changes. (Refer, the following commit in the RISC-V Privileged ISA spec https://github.com/riscv/riscv-isa-manual/commit/4e540263db8ae3a27d132a1752cc0fad222facd8) As-per these requirements, the SBI FWFT ADUE implementation must flush TLBs upon changes in ADUE state on a hart. Signed-off-by: Andrew Waterman Signed-off-by: Anup Patel --- lib/sbi/sbi_fwft.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/sbi/sbi_fwft.c b/lib/sbi/sbi_fwft.c index a2aefb9a..373140b7 100644 --- a/lib/sbi/sbi_fwft.c +++ b/lib/sbi/sbi_fwft.c @@ -13,8 +13,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -167,7 +169,16 @@ static int fwft_adue_supported(struct fwft_config *conf) static int fwft_set_adue(struct fwft_config *conf, unsigned long value) { - return fwft_menvcfg_set_bit(value, ENVCFG_ADUE_SHIFT); + int res = fwft_menvcfg_set_bit(value, ENVCFG_ADUE_SHIFT); + + if (res == SBI_OK) { + __sbi_sfence_vma_all(); + + if (misa_extension('H')) + __sbi_hfence_gvma_all(); + } + + return res; } static int fwft_get_adue(struct fwft_config *conf, unsigned long *value)