oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org, Hao Chen <970353908@qq.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:OLK-6.6 9538/9601] arch/arm64/kvm/vgic/vgic-mmio.c:266:38: warning: variable 'is_pending' set but not used
Date: Sun, 12 May 2024 04:31:39 +0800	[thread overview]
Message-ID: <202405120422.ZROC7rNv-lkp@intel.com> (raw)

tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   15bef328224e70041aba4aaa6b23977efba191a9
commit: cb0003ae0500bb69eefa2275722d08bc39a0f157 [9538/9601] irqchip: gicv3: Add workaround for hip09 erratum 162200806
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240512/202405120422.ZROC7rNv-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240512/202405120422.ZROC7rNv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405120422.ZROC7rNv-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/arm64/kvm/vgic/vgic-mmio.c: In function '__read_pending':
>> arch/arm64/kvm/vgic/vgic-mmio.c:266:38: warning: variable 'is_pending' set but not used [-Wunused-but-set-variable]
     266 |                                 bool is_pending;
         |                                      ^~~~~~~~~~


vim +/is_pending +266 arch/arm64/kvm/vgic/vgic-mmio.c

   230	
   231	#define VIRTUAL_SGI_PENDING_OFFSET	0x3F0
   232	static unsigned long __read_pending(struct kvm_vcpu *vcpu,
   233					    gpa_t addr, unsigned int len,
   234					    bool is_user)
   235	{
   236		u32 intid = VGIC_ADDR_TO_INTID(addr, 1);
   237		u32 value = 0;
   238		int i;
   239		struct its_vpe *vpe = &vcpu->arch.vgic_cpu.vgic_v3.its_vpe;
   240	
   241		/* Loop over all IRQs affected by this read */
   242		for (i = 0; i < len * 8; i++) {
   243			struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i);
   244			unsigned long flags;
   245			bool val;
   246	
   247			/*
   248			 * When used from userspace with a GICv3 model:
   249			 *
   250			 * Pending state of interrupt is latched in pending_latch
   251			 * variable.  Userspace will save and restore pending state
   252			 * and line_level separately.
   253			 * Refer to Documentation/virt/kvm/devices/arm-vgic-v3.rst
   254			 * for handling of ISPENDR and ICPENDR.
   255			 */
   256			raw_spin_lock_irqsave(&irq->irq_lock, flags);
   257			if (vgic_direct_sgi_or_ppi(irq)) {
   258				int err;
   259	
   260				if (irq->hw && vgic_irq_is_sgi(irq->intid) &&
   261				    (kvm_vgic_global_state.flags &
   262				     FLAGS_WORKAROUND_HIP09_ERRATUM_162200806)) {
   263					void *va;
   264					u8 *ptr;
   265					int mask;
 > 266					bool is_pending;
   267	
   268					mask = BIT(irq->intid % BITS_PER_BYTE);
   269					va = page_address(vpe->vpt_page);
   270					ptr = va + VIRTUAL_SGI_PENDING_OFFSET +
   271					      irq->intid / BITS_PER_BYTE;
   272					is_pending = *ptr & mask;
   273				}
   274	
   275				val = false;
   276				err = irq_get_irqchip_state(irq->host_irq,
   277							    IRQCHIP_STATE_PENDING,
   278							    &val);
   279				WARN_RATELIMIT(err, "IRQ %d", irq->host_irq);
   280			} else if (!is_user && vgic_irq_is_mapped_level(irq)) {
   281				val = vgic_get_phys_line_level(irq);
   282			} else {
   283				switch (vcpu->kvm->arch.vgic.vgic_model) {
   284				case KVM_DEV_TYPE_ARM_VGIC_V3:
   285					if (is_user) {
   286						val = irq->pending_latch;
   287						break;
   288					}
   289					fallthrough;
   290				default:
   291					val = irq_is_pending(irq);
   292					break;
   293				}
   294			}
   295	
   296			value |= ((u32)val << i);
   297			raw_spin_unlock_irqrestore(&irq->irq_lock, flags);
   298	
   299			vgic_put_irq(vcpu->kvm, irq);
   300		}
   301	
   302		return value;
   303	}
   304	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-05-11 20:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202405120422.ZROC7rNv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=970353908@qq.com \
    --cc=kernel@openeuler.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).