From nobody Mon Feb 9 10:58:22 2026 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=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1617266731; cv=none; d=zohomail.com; s=zohoarc; b=Zn8cWBHOYjDR50MjKbry7LTatVwMEbipvJY3wVxLD0/KSj9NVrTUMfVn1cCGeAKHw6LwkHcTn3GT0nGhgBXOoqaoqr1Qs4MmecF6icCu+kuWZ35oc9DQQLIpTBfcC0zgc28IRJ2m/epcqeey84cEwMQrSXFaLM8NjDs4b5+SIYM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617266731; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Oa+4GqEAwgAdkWZtpOQ4w42vy8M9iwn2JbhahcRbFHk=; b=Fy02ru1lnflCFE0mvIN2PXq2Uau9jT75YzKyfhY0jC7FkQzmphntmrbjJk+rZCr68/KinWUKB5vgZKyy5tiQAAQ0xUZU0nCIvJuxEMtJ+Qbjhb9dXt0rHSRaEMV8LjXBMcsf9lp5BLQxPCwDugz+LJF0kVDL8LmCEnFmOLTYk6A= 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=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1617266731470983.9556064716202; Thu, 1 Apr 2021 01:45:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.104184.198960 (Exim 4.92) (envelope-from ) id 1lRsx3-0006Y1-62; Thu, 01 Apr 2021 08:45:17 +0000 Received: by outflank-mailman (output) from mailman id 104184.198960; Thu, 01 Apr 2021 08:45:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lRsx3-0006Xu-2S; Thu, 01 Apr 2021 08:45:17 +0000 Received: by outflank-mailman (input) for mailman id 104184; Thu, 01 Apr 2021 08:45:16 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lRsx2-0006Xi-Cq for xen-devel@lists.xenproject.org; Thu, 01 Apr 2021 08:45:16 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f0586108-a1c4-4fbc-976c-8edaee73635d; Thu, 01 Apr 2021 08:45:15 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DE21BAF28; Thu, 1 Apr 2021 08:45:14 +0000 (UTC) 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: f0586108-a1c4-4fbc-976c-8edaee73635d X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1617266715; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Oa+4GqEAwgAdkWZtpOQ4w42vy8M9iwn2JbhahcRbFHk=; b=p4bdMQfAUysFNQynw9wXfroabi+6rKY/aIIN+h8kgvJbfnyKUolIWMUHub1Stm3KeUKcQn zYBbTrL+x61AgBP/SOdhOY0NZhTcNBYA6CtEUfgt5F8LNTHgez5osoN0kGfcAWSN7CF+S6 ZLISuj2XfJnjNEY3S3KdqcpJVh0RKN8= Subject: [PATCH 4/6] VT-d: qinval indexes are only up to 19 bits wide From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Kevin Tian References: <157e4a65-6d0b-7ea8-1c23-cd393c8c0d7f@suse.com> Message-ID: Date: Thu, 1 Apr 2021 10:45:14 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <157e4a65-6d0b-7ea8-1c23-cd393c8c0d7f@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" There's no need for 64-bit accesses to these registers (outside of initial setup and dumping). Also remove some stray blanks. Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/vtd/qinval.c +++ b/xen/drivers/passthrough/vtd/qinval.c @@ -42,14 +42,13 @@ static void print_qi_regs(const struct v =20 static unsigned int qinval_next_index(struct vtd_iommu *iommu) { - u64 tail; + unsigned int tail =3D dmar_readl(iommu->reg, DMAR_IQT_REG); =20 - tail =3D dmar_readq(iommu->reg, DMAR_IQT_REG); tail >>=3D QINVAL_INDEX_SHIFT; =20 /* (tail+1 =3D=3D head) indicates a full queue, wait for HW */ - while ( ( tail + 1 ) % QINVAL_ENTRY_NR =3D=3D - ( dmar_readq(iommu->reg, DMAR_IQH_REG) >> QINVAL_INDEX_SHIFT )= ) + while ( (tail + 1) % QINVAL_ENTRY_NR =3D=3D + (dmar_readl(iommu->reg, DMAR_IQH_REG) >> QINVAL_INDEX_SHIFT) ) cpu_relax(); =20 return tail; @@ -57,12 +56,12 @@ static unsigned int qinval_next_index(st =20 static void qinval_update_qtail(struct vtd_iommu *iommu, unsigned int inde= x) { - u64 val; + unsigned int val; =20 /* Need hold register lock when update tail */ ASSERT( spin_is_locked(&iommu->register_lock) ); val =3D (index + 1) % QINVAL_ENTRY_NR; - dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << QINVAL_INDEX_SHIFT)); + dmar_writel(iommu->reg, DMAR_IQT_REG, val << QINVAL_INDEX_SHIFT); } =20 static int __must_check queue_invalidate_context_sync(struct vtd_iommu *io= mmu,