From nobody Wed Sep 11 08:44:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X3Yyz2P4fz5W7dW; Wed, 11 Sep 2024 08:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3Yyz1LMRz41Qn; Wed, 11 Sep 2024 08:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726044267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uExEfhzA4My9WuFp2ahPeNhgAjvhLyr77PqJQk0Oohc=; b=ZTcJKoLZDr9//xax3KEs0BvQUCtHss1wgfyQa+TgHGv0k9bgddIbMDEPoh+Fi1m/rlQ2mE UJmdZo6QCQ3V417RmwVc7m6sOkCirQs9aCfm518b6ka6b6EVGPwwK7LJIJyFfQSSS2f7wZ +Pc1OTWsgPe8d3NbHpyBNxelCG2xsZGDtY+1WuHWIP4vnhEF7DPHi6gePYAOhnHNA49940 lpF3KQzntjxvUXHr3CtD3IbTHPqiQIlj3B4ejk3tHwbVzBcvrNOYxZFUTf3B4ROZGB8DVZ 80kbj7aqtY+cKOqVr0gvq3kobKevRD/ieDThDINnebeDtvqJYpo+7+V0oiqjHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726044267; a=rsa-sha256; cv=none; b=lilrdUedev55EI4gE2XOxwlM3iBNIhXFcabXzfzhpW/Zx8eIFuAvZgZ9TTTOeDsgNz7gAk DpqLW1krjUxJ+O17MUWpx8YOm7iliD56+01rj4DEkyn6Hd/HHVMgwpCQxHtXVTqzRMZPuK q5YI5MP4qHJl+5+N1A4dbnn1NoysJYW4jm3M//mMomukqxT7cuFscdyF2UWeL8DWg2XWOC ou20mCCoRpBtlxpSWK3+TZYcykbN/r+OZx6MsqNAnpJ6QkKDi4zu9/pMy+C/oF0dFmC+cD 2ODlDq1xWDYlmpZN69FfET4eQByuJhx3doou4lQ7uHjhxOElci6s0mA+Vx59VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726044267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uExEfhzA4My9WuFp2ahPeNhgAjvhLyr77PqJQk0Oohc=; b=N1DWtctzT8DySMCA8lHoTXA+DyqWv7g6q6EluOOx6i9WW3M0pzat071LYtZb9aRey5V4zO IAV9BNjlgIvlUlpDFzKJx7FoKu4+KFbX1IfdtwRB7SypwgQQewxWcGrXAsr/THM66H4xVG ceKSgf/hJ/lB/S1GpB7PlM/iiaIRbt+LwQTT+I+21BpucfClfe0xLfLWJ9VwFldT5YAQ2/ 3t1YT7Wn7orXIkBkEhZ+iUu9U17bz14OTUP+BCguDD4ga9xCNXZH4G1m8VlzQu//Dr0RHG KbcVVv1DXTtonr0rC2yPjh72BUMkRiMkmHU1z+vmPAmKYSRW1EEhFoXj8HX2VA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X3Yyz0x3TzPYJ; Wed, 11 Sep 2024 08:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48B8iRX8007601; Wed, 11 Sep 2024 08:44:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48B8iRrw007598; Wed, 11 Sep 2024 08:44:27 GMT (envelope-from git) Date: Wed, 11 Sep 2024 08:44:27 GMT Message-Id: <202409110844.48B8iRrw007598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: eed2b98a2e0c - stable/14 - x86 iommu x86_unit_common: expand hw completion write-out area to 8 bytes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eed2b98a2e0c9d3ac07e91efba99dab09caf56bd Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eed2b98a2e0c9d3ac07e91efba99dab09caf56bd commit eed2b98a2e0c9d3ac07e91efba99dab09caf56bd Author: Konstantin Belousov AuthorDate: 2024-06-09 14:08:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-11 08:43:59 +0000 x86 iommu x86_unit_common: expand hw completion write-out area to 8 bytes (cherry picked from commit fc8da73b93be3f5cc50f7607dbcfc1edb911de65) --- sys/x86/iommu/intel_drv.c | 4 ++-- sys/x86/iommu/x86_iommu.h | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 9fa1b3f98dc6..66d99748888f 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -1302,7 +1302,7 @@ dmar_print_one(int idx, bool show_domains, bool show_mappings) db_printf("qi is enabled: queue @0x%jx (IQA 0x%jx) " "size 0x%jx\n" " head 0x%x tail 0x%x avail 0x%x status 0x%x ctrl 0x%x\n" - " hw compl 0x%x@%p/phys@%jx next seq 0x%x gen 0x%x\n", + " hw compl 0x%jx@%p/phys@%jx next seq 0x%x gen 0x%x\n", (uintmax_t)unit->x86c.inv_queue, (uintmax_t)dmar_read8(unit, DMAR_IQA_REG), (uintmax_t)unit->x86c.inv_queue_size, @@ -1311,7 +1311,7 @@ dmar_print_one(int idx, bool show_domains, bool show_mappings) unit->x86c.inv_queue_avail, dmar_read4(unit, DMAR_ICS_REG), dmar_read4(unit, DMAR_IECTL_REG), - unit->x86c.inv_waitd_seq_hw, + (uintmax_t)unit->x86c.inv_waitd_seq_hw, &unit->x86c.inv_waitd_seq_hw, (uintmax_t)unit->x86c.inv_waitd_seq_hw_phys, unit->x86c.inv_waitd_seq, diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index eb1bbafbeb77..966a13c19b6e 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -101,8 +101,14 @@ struct x86_unit_common { vm_size_t inv_queue_size; uint32_t inv_queue_avail; uint32_t inv_queue_tail; - volatile uint32_t inv_waitd_seq_hw; /* hw writes there on wait - descr completion */ + + /* + * Hw writes there on completion of wait descriptor + * processing. Intel writes 4 bytes, while AMD does the + * 8-bytes write. Due to little-endian, and use of 4-byte + * sequence numbers, the difference does not matter for us. + */ + volatile uint64_t inv_waitd_seq_hw; uint64_t inv_waitd_seq_hw_phys; uint32_t inv_waitd_seq; /* next sequence number to use for wait descr */