From nobody Wed Dec 4 09:07:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1724454085; cv=none; d=zohomail.com; s=zohoarc; b=RXgGI6kwptx/7j+vkWhQ452/6373a/XV7oHHK1DpXsWa39KDCK5H0jKWv2yf/BaP/ijU4TzWu+xIA5EYFmz20BcubREV4PfmjMT922doV3z48pll9xYeJotGQvj3vOOirydqCZiG6Mfs8nkwrV/fBP0LSScmGRjzmA2kKgtZ9B8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724454085; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fda7N1Br5ezyCfM5MwoAp8juHmekzl5QKklpSKyKJu8=; b=bKkZOr9p3NelN7sJLRDqHanTS8sEdKIkRbE5eh/ZJxQNl6S/s4wrMlR9KNMgjZID07347iRy3/GA/ycNBgS2dhVb6Agjdr6yMT/vo3XTiu9W98IrBuvUmo76pybz7eY5ErvJMOR1L3OnohAZ6hCXd6YDcmYeIaWD1ZMIZsOBYJM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1724454085410789.8839278435844; Fri, 23 Aug 2024 16:01:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.782737.1192243 (Exim 4.92) (envelope-from ) id 1shdH2-0001sC-PK; Fri, 23 Aug 2024 23:00:52 +0000 Received: by outflank-mailman (output) from mailman id 782737.1192243; Fri, 23 Aug 2024 23:00:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1shdH2-0001s5-Mm; Fri, 23 Aug 2024 23:00:52 +0000 Received: by outflank-mailman (input) for mailman id 782737; Fri, 23 Aug 2024 23:00:51 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1shdH1-0001rz-Te for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 23:00:51 +0000 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [2a00:1450:4864:20::52b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 89f1d7a1-61a3-11ef-8776-851b0ebba9a2; Sat, 24 Aug 2024 01:00:49 +0200 (CEST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5bf009cf4c0so2816532a12.1 for ; Fri, 23 Aug 2024 16:00:49 -0700 (PDT) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c04a4c72a7sm2600603a12.65.2024.08.23.16.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 16:00:47 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 89f1d7a1-61a3-11ef-8776-851b0ebba9a2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1724454048; x=1725058848; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fda7N1Br5ezyCfM5MwoAp8juHmekzl5QKklpSKyKJu8=; b=ERlfBL7Mdr8myHspr8rOTPDoR6QKsBomeT3t5EiqOKV4+Brvx9WbflHWMPxWzB/3nS WVgV3ZosWejLmHh5zpD4pIug/Dlg3XJdyM2XZnjLnFIENMEh+EAHGKimzYUldktjaaGx 9gXWXUKpgW5k7ykJF+MfdMxwkKrddblhtgCyY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724454048; x=1725058848; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fda7N1Br5ezyCfM5MwoAp8juHmekzl5QKklpSKyKJu8=; b=qqYBGqeAWAIJQx7ATDV+D3YPTA53zsY1GmJ0C/3pCGEfUtHRCMi1dxPCjqvM/qtg3i pieGLTtCM2zhDDNL14pHmEJFRSikkB1yiD8EVw8SvRc1XPRSm5GU5b0b+CftwunC/d4H GZzvavBi2aQOPbT+uCwF2uRf2sChhN2QnDiqYiMOap+yJar2/uWCRXP8XbZBZ/5on/Bt LxOJHak1fn+Vib/KK1hWo172Nfc/QJyRiXLdcAKjZEVxDQvFvZoVqhZjaeGh7JKepzi6 i3xq4X8VSqMChhjTWvKAzzwGPYOGBSV9nlHTJD2mhyUzEhuJG2LtzjjITeVjoaygx1S9 A/qw== X-Gm-Message-State: AOJu0YxeQExVvLT8F/iO7LepMZpwkEr541Y1/0IgIixPs4w3Tjhg8voO DcS3LwnWLNJRFwjzZrV89Y5G1SDg7R3tSv/BlCLV2Uw/b+6QAljpphBiYump8zYU3sFNQHjYodn 9 X-Google-Smtp-Source: AGHT+IGCSjlVk2CgMvpJzo+u8GqW5WGhLP6XBUjxEWiqvo/qWerGMfxCeKRGtNIKX4FpsIUHgAUx8w== X-Received: by 2002:a05:6402:2115:b0:5be:de37:80dc with SMTP id 4fb4d7f45d1cf-5c0891ac3b1mr2199484a12.37.1724454048154; Fri, 23 Aug 2024 16:00:48 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel Subject: [PATCH] ARM/vgic: Use for_each_set_bit() in vgic_check_inflight_irqs_pending() Date: Sat, 24 Aug 2024 00:00:45 +0100 Message-Id: <20240823230045.1581050-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1724454085925116600 Content-Type: text/plain; charset="utf-8" ... which is better optimised for scalar values, rather than using the arbitrary-sized bitmap helpers. Additionally, unlike other vgic helpers, this takes both a domain and vcpu pointer. The domain parameter isn't used, and the callers pass v->domain. Strip out the domain pointer. Signed-off-by: Andrew Cooper Reviewed-by: Michal Orzel --- CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel --- xen/arch/arm/include/asm/vgic.h | 2 +- xen/arch/arm/vgic-v2.c | 2 +- xen/arch/arm/vgic-v3.c | 2 +- xen/arch/arm/vgic.c | 8 ++------ 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgi= c.h index 79b73a0dbb58..e309dca1ad01 100644 --- a/xen/arch/arm/include/asm/vgic.h +++ b/xen/arch/arm/include/asm/vgic.h @@ -315,7 +315,7 @@ extern bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode, int virq, const struct sgi_target *target); extern bool vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned = int irq); -extern void vgic_check_inflight_irqs_pending(struct domain *d, struct vcpu= *v, +extern void vgic_check_inflight_irqs_pending(struct vcpu *v, unsigned int rank, uint32_t r= ); =20 #endif /* !CONFIG_NEW_VGIC */ diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c index 0aa10fff0f10..a19d61017861 100644 --- a/xen/arch/arm/vgic-v2.c +++ b/xen/arch/arm/vgic-v2.c @@ -483,7 +483,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmi= o_info_t *info, rank =3D vgic_rank_offset(v, 1, gicd_reg - GICD_ICPENDR, DABT_WORD= ); if ( rank =3D=3D NULL ) goto write_ignore; =20 - vgic_check_inflight_irqs_pending(v->domain, v, rank->index, r); + vgic_check_inflight_irqs_pending(v, rank->index, r); =20 goto write_ignore; =20 diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index cc3832770181..2eaa48fadbb0 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -820,7 +820,7 @@ static int __vgic_v3_distr_common_mmio_write(const char= *name, struct vcpu *v, rank =3D vgic_rank_offset(v, 1, reg - GICD_ICPENDR, DABT_WORD); if ( rank =3D=3D NULL ) goto write_ignore; =20 - vgic_check_inflight_irqs_pending(v->domain, v, rank->index, r); + vgic_check_inflight_irqs_pending(v, rank->index, r); =20 goto write_ignore; =20 diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 905e5eeb66d4..7b54ccc7cbfa 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -720,13 +720,9 @@ unsigned int vgic_max_vcpus(unsigned int domctl_vgic_v= ersion) } } =20 -void vgic_check_inflight_irqs_pending(struct domain *d, struct vcpu *v, - unsigned int rank, uint32_t r) +void vgic_check_inflight_irqs_pending(struct vcpu *v, unsigned int rank, u= int32_t r) { - const unsigned long mask =3D r; - unsigned int i; - - bitmap_for_each ( i, &mask, 32 ) + for_each_set_bit ( i, r ) { struct pending_irq *p; struct vcpu *v_target; --=20 2.39.2