From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 9B6A1803F7 for ; Tue, 10 Nov 2026 19:19:57 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AAJIeSC018367; Tue, 10 Nov 2026 22:18:41 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAJIeSC018367 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1794338322; bh=12b3kYt7P/4fVb0j5DXdp/mHfiRBI4HQBbdsO45Re2w=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=SO4cenWAOETUPLCikMsZslo+1EG5KYfJmLBcfr6Ri4sp2CSTu6m7aD9s7PEU27G3a nJfopt0Sb/NldqvBggkioGyufNWGkYi9EqPu2LrA9HPh3pI8/s4L6yq9CfdvPn5oEm kG3SLmpbsWWTaFcO9BI0XNujzzipxQ+2KNWndSM8w0yUJAaVnpYn2ftfM1oug0Af95 cZeAqrG5OUbMXUfnuH5RNNaahMljmKPfyk3b/KRNDXXMn8ZD9GT/jpeBQsoSfDJL1y /0QhRijO+Jo/xyX/1Gpe//v3JV4e1cSeIJQkVGKEAo5qn7JicYDxYWe8u0NO821Kzj CPnSFrr0jrf6Q== Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AAJIdQU018363 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 10 Nov 2026 22:18:39 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAJIdQU018363 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="ngY5O/FF" Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4a027f2e364so18144355e9.3 for ; Tue, 10 Nov 2026 11:18:39 -0800 (PST) X-Gm-Message-State: APuU4Z+3NzpQJR0SkNDIteo/InSswGO9GB0HzsNqO1Tu0eyjbBEmcgqn oUW9c7ivlWotra5fLimVJS+E1NhCITibX72xGN08E1ksRAQSZbgHwHKUqL1HLSRwfyTyo/LKAma TH7Vs8CWMCh6qUMBymH051DcT8TO2n5DWhLVWThSKJ0iLQBvoa8cffw== X-Gm-Gg: AYBFou2vFzxTxPzlqwI17Y7V/vwW0QLh8Fcai7kN8uCEVHc+QyPgxShCQgtHzhdavgp vN7LyWnMYVgI9j18OmfsnohfEJ2Eiw8sjaLL3icEG61rIC117HMpy2oY3bqTjoqMH5G8j3jcxNJ gjZJ/TjhfZdwvbB4nRAd1nQc2TyTEgS2SiZS7AbKUoS0O2k1nQvN5rTe/536Q5O8Wgg4cME+KCq 9rfjIGTlKT6By9YhxA/nSrBN3YJfUXG3n+FpE0G66Q5bTuHqLUn0M/suF4H6nW/7/3rCGGyZOxu UqA/HrtKPA== X-Received: by 2002:a05:600c:b86:b0:4a1:dfaf:f465 with SMTP id 5b1f17b1804b1-4ba0931efefmr2459525e9.4.1794338319526; Tue, 10 Nov 2026 11:18:39 -0800 (PST) X-Received: by 2002:a05:600c:b86:b0:4a1:dfaf:f465 with SMTP id 5b1f17b1804b1-4ba0931efefmr2459285e9.4.1794338319126; Tue, 10 Nov 2026 11:18:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794338319; cv=none; d=google.com; s=arc-20260327; b=ONf1w0QAD6tVh7Jkr+gVZNddALLjf7BA/YT4C6fz8UTW1Mxx5BK/YKnxpMJzy0zx6D F+L/gvF0bIyC1cABfCaYFq+vd1Vf+LetdYIiX0EUNTYGyX6nv1cQjsDksWdmGiBl1NmG ADbrVXflBBfdZrej5R8qlikbDsdZFNW3YzkR8mv9/5DMdixPMGLurqCEQY08o//DRVYa +pDbvQcxeu2dCoGxvIa+ydL33ah8ulu5TJHhj2Nkc+YgG+ZwqomtvrBUd5HzANtzRd4W KKxtA7zQBNSfq8vFggZTZvbsHamVYpBEqV3QFPw2q8AFqWKJIDrDk5Z5tVzIcphE5BmD y/7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=cZKLmBxZgLKs8eI999hPu8OlO5m4IlvZEkSPaqBdpII=; fh=ozrYJQ1t3QIP6s65KBq5xgJxiFM2qf+5wwn3ABTusyU=; b=M1IBCESlOXDR9+QOQMeoDacKhBvdL3njfaZzAh4SMGk3orrFvngDQ+50YklOo/YFXe Cbc4jNUFnbWvFqN33dYanpX625PKZAaV8wug1z9RIfkMsaYKXktiJokMJtSe2e8L9MLt ah7fBCNisOG8OvetfgCJ1kh9T1AmrkbkumgPZ7chrnSmW0jIsv/Y6vROEdzWk/kkNf+A ZRlPNBKXLgaWsIu2cRMsO2I1pXh/B1jXkL8Mba8PZYDayM/ppyXIiWd9pKBD6Rgq7/08 UjZZYLMikArBdnhYepp21p037Q6Q/6lm9XtrQTFUW9Bs+OLYvL6A4cB45xkjNXbYGw6z 2Kng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b="ngY5O/FF"; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4ba01fcad31sor6151285e9.2.2026.11.10.11.18.39 for (Google Transport Security); Tue, 10 Nov 2026 11:18:39 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af as permitted sender) client-ip=2a06:5b06:b600:300:4f78:6441:d0f1:22af; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b="ngY5O/FF"; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1794338319; x=1794943119; darn=openvz.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=cZKLmBxZgLKs8eI999hPu8OlO5m4IlvZEkSPaqBdpII=; b=ngY5O/FFChtuGqLjZKfFVeH6MhZ/h8leZBREjqXwT/9vNv2WWriXigWB9UNJEwQMHR cQ5T9QpIpPIXbg6AlsGwiI77FXmw11pZHu4FKLAKksSR91aUiVURlrV1l8bznQohsJD3 yM2wfUYA5WnmY9fCyZdk6o8Q22q+2KEtvNP2QCEB6TTF4byd/Qn4sFwj2Bj/LQwldzbZ e0irVQCZmLPV8pnHz/XH/D25zGrzZrL3JOLAKuPHM9GUrxmQUUDi5r2fJ77001Bu8uEO gTyOhlTu0/FrW2Vt2kYORNuvoyR1MhynpbeFnGEyT4yN0Z++ABu1xFJrcBdrLIsAlEW1 VYkg== X-Received: by 2002:a05:600c:6214:b0:49c:fa20:cbfd with SMTP id 5b1f17b1804b1-4ba09375bb4mr1566245e9.20.1794338318595; Tue, 10 Nov 2026 11:18:38 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:4f78:6441:d0f1:22af]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba01fea745sm80156815e9.10.2026.11.10.11.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2026 11:18:38 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com Date: Tue, 10 Nov 2026 20:18:33 +0100 Message-ID: <20261110191836.3000352-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 0/3] iommu/amd: make iommu_completion_wait() wait for flushes queued by other CPUs X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org iommu_completion_wait() checks iommu->need_sync without iommu->lock and returns at once when it is clear. A completion wait queued by another CPU clears the flag before the IOMMU has executed the commands in front of it, so the caller can return while its own invalidations are still pending. After an unmap that lets an IOVA or a page table page be reused while the IOMMU may still hold the old translation. It also leaves a hole in "iommu/amd/pgtbl: fix DMA faults on IOVAs mapped while the table grows": the DTE flush done before the new page table level is published can return before the IOMMU has dropped the old DTE. Patch 3 is the mainline fix 1e75a8255f11c. It waits for the last allocated completion sequence number, which relies on the model introduced by patches 1 and 2, also from mainline: the wait moves out of iommu->lock and the sequence number is allocated under it. vz10 still had the old model, an atomic increment outside the lock and the wait under it. 6.12.y carries the same three commits. Patch 2 needed a context fix only: vz10 has no cmd_sem_paddr in struct amd_iommu. Tested on epyc06 (EPYC 7352, four Optane in one IOMMU group) with the VSTOR-154276 reproducer: an out-of-tree module exhausts the group's 32-bit IOVA space while fio reads the drives, and a kprobe holds the DTE update open for 5 ms. The stock 8.0 kernel gives IO_PAGE_FAULTs and fio verify mismatches with no I/O error. 22.19 with the VSTOR-154276 fix and this series gives no faults, no mismatches and no completion wait timeouts. https://virtuozzo.atlassian.net/browse/VSTOR-154424 Ankit Soni (2): ms/iommu/amd: move wait_on_sem() out of spinlock ms/iommu/amd: serialize sequence allocation under concurrent TLB invalidations Guanghui Feng (1): ms/iommu/amd: Wait for completion instead of returning early in iommu_completion_wait() drivers/iommu/amd/amd_iommu_types.h | 2 +- drivers/iommu/amd/init.c | 2 +- drivers/iommu/amd/iommu.c | 61 ++++++++++++++++++++--------- 3 files changed, 45 insertions(+), 20 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel