Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: BillXiang <xiangwencheng@lanxincomputing.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2] RISC-V: KVM: Serialize and atomize the IMSIC's TOPEI read-and-clear operation
Date: Wed, 23 Sep 2026 09:04:45 +0000	[thread overview]
Message-ID: <20260923090445.7A6791F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260923085631.1384021-1-xiangwencheng@lanxincomputing.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] riscv: kvm: build error due to undeclared 'eflags'
--

commit 216b97a6c827bbe2a6897aa0efd6984c531cf514
Author: BillXiang <xiangwencheng@lanxincomputing.com>

RISC-V: KVM: Serialize and atomize the IMSIC's TOPEI read-and-clear operation
    
This commit adds synchronization to the IMSIC TOPEI read-and-clear path to
ensure it remains atomic with respect to interrupt injections.

Link: https://lore.kernel.org/kvm-riscv/20260923070332.1376132-1-xiangwencheng@lanxincomputing.com/

> diff --git a/arch/riscv/kvm/aia_imsic.c b/arch/riscv/kvm/aia_imsic.c
> index c1af23e79ae06..490c55419eb22 100644
> --- a/arch/riscv/kvm/aia_imsic.c
> +++ b/arch/riscv/kvm/aia_imsic.c

[ ... ]

> @@ -912,12 +911,15 @@ int kvm_riscv_vcpu_aia_imsic_rmw(struct kvm_vcpu *vcpu, unsigned long isel,
>  	struct imsic_mrif_eix *eix;
>  	int r, rc = KVM_INSN_CONTINUE_NEXT_SEPC;
>  	struct imsic *imsic = vcpu->arch.aia_context.imsic_state;
> +	unsigned long flags;
>  
>  	/* If IMSIC vCPU state not initialized then forward to user space */
>  	if (!imsic)
>  		return KVM_INSN_EXIT_TO_USER_SPACE;
>  
>  	if (isel == KVM_RISCV_AIA_IMSIC_TOPEI) {
> +		raw_spin_lock_irqsave(&imsic->swfile_extirq_lock, flags);
> +
>  		/* Read pending and enabled interrupt with highest priority */
>  		topei = imsic_mrif_topei(imsic->swfile, imsic->nr_eix,
>  					 imsic->nr_msis);

[ ... ]

> @@ -934,16 +936,20 @@ int kvm_riscv_vcpu_aia_imsic_rmw(struct kvm_vcpu *vcpu, unsigned long isel,
>  					  eix->eip);
>  			}
>  		}
> +		if (wr_mask)
> +			__imsic_swfile_extirq_update(vcpu);
> +
> +		raw_spin_unlock_irqrestore(&imsic->swfile_extirq_lock, eflags);

[Severity: Low]
Does this cause a build failure? The local variable is declared as flags at
the top of kvm_riscv_vcpu_aia_imsic_rmw(), but this unlock path attempts to
use eflags instead, which appears to be undeclared.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923085631.1384021-1-xiangwencheng@lanxincomputing.com?part=1

      reply	other threads:[~2026-09-23  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  8:56 [PATCH v2] RISC-V: KVM: Serialize and atomize the IMSIC's TOPEI read-and-clear operation BillXiang
2026-09-23  9:04 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260923090445.7A6791F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xiangwencheng@lanxincomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox