From nobody Sun Dec 14 08:05:49 2025 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 header.i=teddy.astie@vates.tech; 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=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1764606690; cv=none; d=zohomail.com; s=zohoarc; b=g3Ui2o35DeJXqtuLbGnFB9ALmmrwvFrhYUS4/Up9s4ZfKSxP5wgbE6WNdGdRddhgOrNhzrd2+BFxdBlOt/4DKjV8h555fmIiJi0zl6gEVn/wUSCu9vjYqxc4nTypIyCFpFKL50QlCWmSd6X7DjYxWglK9J9b7BPulQp6xJ75kA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764606690; h=Content-Type: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=cbgGDfe5Uty0mkLvZGLz7aA/6b3AGgLC+44Q+TaBA9M=; b=NuDC3rZ7NrMOvGW5oM3gSXk71bhU4ZWMB36KazJZKJReQuOpia9L3VZ8amTZAhwLO4WA3moLqPE4kKc8WFwoUsqFuzzlA2lzLqwZdr82OecOJIYU2z2ADwOtonb0QJvTEtaYtizTTyUvLUXyxfOfSMD0hXmGfg01OaS8GpryQgM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; 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 1764606690146474.0932021515499; Mon, 1 Dec 2025 08:31:30 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1175900.1500490 (Exim 4.92) (envelope-from ) id 1vQ6ma-0007Ki-8P; Mon, 01 Dec 2025 16:29:48 +0000 Received: by outflank-mailman (output) from mailman id 1175900.1500490; Mon, 01 Dec 2025 16:29:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vQ6ma-0007Kb-5W; Mon, 01 Dec 2025 16:29:48 +0000 Received: by outflank-mailman (input) for mailman id 1175900; Mon, 01 Dec 2025 16:29:46 +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 1vQ6mY-0007KV-4e for xen-devel@lists.xenproject.org; Mon, 01 Dec 2025 16:29:46 +0000 Received: from mail132-18.atl131.mandrillapp.com (mail132-18.atl131.mandrillapp.com [198.2.132.18]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ed0357a6-ced2-11f0-980a-7dc792cee155; Mon, 01 Dec 2025 17:29:37 +0100 (CET) Received: from pmta09.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail132-18.atl131.mandrillapp.com (Mailchimp) with ESMTP id 4dKq9q3nXdzCf9K7K for ; Mon, 1 Dec 2025 16:29:35 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 8bb66142feb44fe79911fc12e1f26070; Mon, 01 Dec 2025 16:29:35 +0000 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: ed0357a6-ced2-11f0-980a-7dc792cee155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1764606575; x=1764876575; bh=cbgGDfe5Uty0mkLvZGLz7aA/6b3AGgLC+44Q+TaBA9M=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=Iy5aa1NzVqh0R/JA4uvymMRZRJqb+cc/sD76sTXzohFhzAf3aJgyFtcWoT9/FyLL1 10k+Tx2+G+iZEg+/usmpRqRU29uUOR/vde/ch3V1Y7yvimiz+2vsW+hMRXW9DdYQoQ gL9R4jiOT08X+8bh2lhvBuf8aLpMfBXpI5WVonY1ess4Mi0z963yV+dwBupan/wQEg c44IHg2aiWTA1ITxq9DdRG89xQ5sSIsG1Obge/bEgGoDsO4qxiCL8XhkIFPB+1l+9e k4xjpWYS1d2mpxGSKpNlQEirKPP2xoz4cPV9klCChOND6LyhVnaV/u/CY1xEg8gHWs ItfGnzmSqj+jw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1764606575; x=1764867075; i=teddy.astie@vates.tech; bh=cbgGDfe5Uty0mkLvZGLz7aA/6b3AGgLC+44Q+TaBA9M=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=bqorIooo7KSFgFxt3J53k70ILYwPC5ABqHLaa3Z9MOe92fLJ9HmagaHFPNY59gHBy ugtdbuHOhfwKLk17h04Gy6fw/1IDcGrxV2I+JeeDbA6pSrTS+cExWqjXbBNyfEOVFP hYFJzMQQtlpQEgvZxoVTTufwppDUT6AC11/0D4tw42MYMONYxbibW3RRus9k9HBFse dALxiXEKgSupywD6thRJeKccnNPla8ejFrizbXP9DgraJ4Jn3k9dUledGqkKJteKFB qRXLyBDVB9miCytI3Rcv0ft/Tel1iBElxDa6ekqhZeU3CI6wjPQe+sAt3vpzJVobFR 3gckdHcbe1Wmw== From: "Teddy Astie" Subject: =?utf-8?Q?[PATCH]=20viridian:=20Fix=20bank=20count=20counting?= X-Mailer: git-send-email 2.51.2 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1764606574403 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Paul Durrant" , "Jan Beulich" , "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" Message-Id: <5e38608b45ad25e6582163700edd3f232b6d2325.1764606368.git.teddy.astie@vates.tech> X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.8bb66142feb44fe79911fc12e1f26070?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20251201:md Date: Mon, 01 Dec 2025 16:29:35 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity teddy.astie@vates.tech) (identity @mandrillapp.com) X-ZM-MESSAGEID: 1764606693654019200 Content-Type: text/plain; charset="utf-8" hv_vpset_nr_banks() incorrectly counts the number of bank by using hweight6= 4() instead of flsl(). This for instance problematic in case only the second ba= nk is selected (i.e >64 vCPUs, where here hweight64 gives 1), causing only the= first bank to be checked (non-valid) and the second (meaningful) one to be skippe= d. Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush = hypercalls") Signed-off-by: Teddy Astie --- xen/arch/x86/hvm/viridian/viridian.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridi= an/viridian.c index 90e749ceb5..f5e526241d 100644 --- a/xen/arch/x86/hvm/viridian/viridian.c +++ b/xen/arch/x86/hvm/viridian/viridian.c @@ -601,7 +601,7 @@ static DEFINE_PER_CPU(union hypercall_vpset, hypercall_= vpset); =20 static unsigned int hv_vpset_nr_banks(struct hv_vpset *vpset) { - return hweight64(vpset->valid_bank_mask); + return fls64(vpset->valid_bank_mask); } =20 static int hv_vpset_to_vpmask(const struct hv_vpset *in, paddr_t bank_gpa, --=20 2.51.2 -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech