From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEA041F76DE; Tue, 3 Dec 2024 15:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238862; cv=none; b=CPyUJpVDpfIyBTAq5AdwpyCNUWhsE4eepcLGx/1uc9yOVRLIEidq8+GqyX+oEOzFyYOj/QL7QutGr/BQrIPtymPOuchPgfY5YJBjQ3AP2A2qQ/+FJfdFkv8UhUOpJqDoXIo3dV9IpUq6IR4pSY31BFze5bqm61BhLH4OTgy3vyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238862; c=relaxed/simple; bh=S/tIqSVhJvLYfnRXc9psqzeQGqH3vTB19+oB44n50AY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UD62698d1KCFK9IhWQ1KSoD/yM7ynmaFE2MoNcq2lYSJ4TVX41FEqYDz47vbsGFCGSe/FtGsmriJUgcrFxfYOtHO6ZNglmkCOT+pqqcslyukotZAK2sKLparIZxEW/xT4xShAKZgWsrISUZq6CY3uceeRpp/oWZ67ythygDtZZw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J/MLjv4d; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="J/MLjv4d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 377C8C4CECF; Tue, 3 Dec 2024 15:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733238862; bh=S/tIqSVhJvLYfnRXc9psqzeQGqH3vTB19+oB44n50AY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/MLjv4dHYzpHi7/YPR35wV3goAXT4n2p4f81GfUKTed0rlwfaGwXLKDtyDol4vz1 0mSQTV4zuoyr1Dv2Jyfn9mkm0plZsvoZwdkEwFOIDO7OYN0If/UkQoOI4vTu3TQhX8 phq2ma1ip00yjXfuv4Q83oHo7EwkGBg/UEajLHso= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yong-Xuan Wang , Vincent Chen , Anup Patel , Sasha Levin Subject: [PATCH 6.11 423/817] RISC-V: KVM: Fix APLIC in_clrip and clripnum write emulation Date: Tue, 3 Dec 2024 15:39:55 +0100 Message-ID: <20241203144012.397493109@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203143955.605130076@linuxfoundation.org> References: <20241203143955.605130076@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yong-Xuan Wang [ Upstream commit 60821fb4dd7345e5662094accf0a52845306de8c ] In the section "4.7 Precise effects on interrupt-pending bits" of the RISC-V AIA specification defines that: "If the source mode is Level1 or Level0 and the interrupt domain is configured in MSI delivery mode (domaincfg.DM = 1): The pending bit is cleared whenever the rectified input value is low, when the interrupt is forwarded by MSI, or by a relevant write to an in_clrip register or to clripnum." Update the aplic_write_pending() to match the spec. Fixes: d8dd9f113e16 ("RISC-V: KVM: Fix APLIC setipnum_le/be write emulation") Signed-off-by: Yong-Xuan Wang Reviewed-by: Vincent Chen Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20241029085542.30541-1-yongxuan.wang@sifive.com Signed-off-by: Anup Patel Signed-off-by: Sasha Levin --- arch/riscv/kvm/aia_aplic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kvm/aia_aplic.c b/arch/riscv/kvm/aia_aplic.c index da6ff1bade0df..f59d1c0c8c43a 100644 --- a/arch/riscv/kvm/aia_aplic.c +++ b/arch/riscv/kvm/aia_aplic.c @@ -143,7 +143,7 @@ static void aplic_write_pending(struct aplic *aplic, u32 irq, bool pending) if (sm == APLIC_SOURCECFG_SM_LEVEL_HIGH || sm == APLIC_SOURCECFG_SM_LEVEL_LOW) { if (!pending) - goto skip_write_pending; + goto noskip_write_pending; if ((irqd->state & APLIC_IRQ_STATE_INPUT) && sm == APLIC_SOURCECFG_SM_LEVEL_LOW) goto skip_write_pending; @@ -152,6 +152,7 @@ static void aplic_write_pending(struct aplic *aplic, u32 irq, bool pending) goto skip_write_pending; } +noskip_write_pending: if (pending) irqd->state |= APLIC_IRQ_STATE_PENDING; else -- 2.43.0