Received: by 2002:a17:504:7599:b0:1be7:c013:c773 with SMTP id j25csp1596279njm; Mon, 1 Jul 2024 14:15:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXD6aIgyB5GqkhDxqcoB3dAToTjVi8xZ+lK37ZsvcEfXH0zCLk7jB00t99gpCslW3zjkcsQiUwXL7Z+6gELnstkTnY+GAMr X-Google-Smtp-Source: AGHT+IFbtq7fizQ3v97bKR6Nau1Xlh3TqpsNM1e8fkzK/E2IdR0IsNMNaKQ8TGkUXHOcFJyMkWIu X-Received: by 2002:a05:6214:21ab:b0:6b5:8f40:a18c with SMTP id 6a1803df08f44-6b5b71d2292mr71437286d6.63.1719868539719; Mon, 01 Jul 2024 14:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719868539; cv=none; d=google.com; s=arc-20160816; b=xypT2P90Ev+N1kATyHSCYmPf53i7+KLcpRe+RNSvdoonRCPZygCTua5XvNUZiYIUgH qtV+Fe8UEyIAc6Le29ti6Ngtv2abbqGE+Qi6jCeSmqzmDMAeYI66tLetri3XgJmtSeHC j/CbdgXVOUnSZcwOriBYIDToTHTA+L+g7UXiXQJ6w0msQ+Rq9+S39JEHfj3CvQHEFsxW 2xRW47rDpxHhT8b1iqy7+J8pmzhL/ugqdOXYw6vrhu6eKOBXM6F6MKRGBhxJEDeu8DKK hbk0EquxZgcwhkY554SyYq32Y9YAfJccRYEs/71XaVxuWu+VlfG1THtJ6f2dMVfeiaus o1Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=tO7j13VWjFaBpcr4aWZs5ErUrepl2gPxfFFabPaQ2PQ=; fh=Ct1mK/A7KUv/lFt6qSOeh7lT9npvkv2iarkj+ZTwPCE=; b=ckhPDvSV6CbG/gHgfOvRDCjCcpXx7q3fCagE2ma9POx/QkNZEgy20W31Mb0la5/cTN CwjTuQhBHt3vOuFeBkzwIKOa4w4COO4sMRIdxWnASvql3LOsn7u41lzkZHs0LJ4lW7J+ /C/GGJyhi1r6CXNNAXK1wjR1f3IzjoEqOSklowpGCAlXk/OkzcP6pS2PEfg9TuKT7QMI rTQ2EgFnfPErM1f1WVSD/EMN13DSs8GzjQSjDX4qFRMDeWW7mgX6PWUNg/7rK4uuQKMH mOMU/qgjz2tknAS/OIKvhuH254h9JUiSObR/tpZSVt/snLmaXT1X1qzwHk/8Txeg+gz2 7Gpg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HcRTthx3; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b59e36c197si90308756d6.152.2024.07.01.14.15.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 14:15:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HcRTthx3; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOOMp-0007Nr-0H; Mon, 01 Jul 2024 17:15:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOOMm-0007NX-BZ for qemu-devel@nongnu.org; Mon, 01 Jul 2024 17:15:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOOMd-000823-L4 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 17:15:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719868505; 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: in-reply-to:in-reply-to:references:references; bh=tO7j13VWjFaBpcr4aWZs5ErUrepl2gPxfFFabPaQ2PQ=; b=HcRTthx31tKMCL9PyLieC1D07FR6ySpsdWj6SuJcCDebewu8SLsO6W9nzL5v51VUDfxMKL //NXI+9XJVbKURgonfjDmUCDygOLNGq2rNjXxzM4ru4LNSM2U+F6UX+Nd3dUfLK3C0frxD bcKckDB+PjvCXVRoziY4DmyIj7+iF+I= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-DYH1tdzYMwaxH_m2MnerqA-1; Mon, 01 Jul 2024 17:15:04 -0400 X-MC-Unique: DYH1tdzYMwaxH_m2MnerqA-1 Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-4ef63cc7451so1252752e0c.1 for ; Mon, 01 Jul 2024 14:15:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719868504; x=1720473304; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tO7j13VWjFaBpcr4aWZs5ErUrepl2gPxfFFabPaQ2PQ=; b=IZeG/VW5H4o0p+Zi1P2axM3jqzmZkeaXM8DdIWWD9Xaks8nJ+cV5lmTTuejeTP08Hd KIomLTsrlQ4cuxCc51e63rUpvfy0fd3IE4BcIoWjiItGcQu6vJz9+oK3/hredqYmd604 ZX44/c2Bqg3Ip+xj0iacu0Eh+HRVfaH/q5K1IOoYaVNPqLXGf6XHsDg8nOCEKTvcrl4h VnwlwZWsL+ZfEhwN/UhdWWaQarTXoWjACzPkHQlYXeO+bWAtnhlEUoOISlbRb9aOMpnp +l1eZwwKdUfzOFhlGRa+AvOzkyJG9ebpdlC8uqfo2koxAooFd7D4mWN4aKlzfsbEi/Vb I0WQ== X-Forwarded-Encrypted: i=1; AJvYcCW9pIy/AiZpyRrJ/tI6v4QbbX6tjWRuih4GhiTEIYup2v+23ID/P0iA2bvmURpe527QfGp0JiRgZlmG20hdsYfXh48Gzzg= X-Gm-Message-State: AOJu0YwWIAGWikwP69gjTIRTItMiVnudH/0eVuENsZwVs5DVKehdiYyD 5aea67vQaQqT/qObGtbCbHgNIzwuqgM2tYRlAFUXQwbJtwcI623i8KJRXgvPwOIv8arzflNQ95d zk2MNqxYrdAm8h/8YPVRARSZ3wSC1ygRvkgtP2g3KEasW0/l8Ng/4 X-Received: by 2002:a05:6122:608a:b0:4ef:668f:2438 with SMTP id 71dfb90a1353d-4f2a5511b8fmr8830872e0c.0.1719868503838; Mon, 01 Jul 2024 14:15:03 -0700 (PDT) X-Received: by 2002:a05:6122:608a:b0:4ef:668f:2438 with SMTP id 71dfb90a1353d-4f2a5511b8fmr8830856e0c.0.1719868503535; Mon, 01 Jul 2024 14:15:03 -0700 (PDT) Received: from ?IPV6:2a01:e0a:280:24f0:9db0:474c:ff43:9f5c? ([2a01:e0a:280:24f0:9db0:474c:ff43:9f5c]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79d692f24e6sm386377985a.73.2024.07.01.14.15.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Jul 2024 14:15:03 -0700 (PDT) Message-ID: <86060667-4f53-4d92-a4d6-25d9bfb6f457@redhat.com> Date: Mon, 1 Jul 2024 23:14:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/7] VIRTIO-IOMMU/HostIOMMUDevice: Fixes and page size mask rework To: Eric Auger , eric.auger.pro@gmail.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, mst@redhat.com, jean-philippe@linaro.org, peter.maydell@linaro.org, yanghliu@redhat.com, zhenzhong.duan@intel.com, alex.williamson@redhat.com References: <20240701084957.1567641-1-eric.auger@redhat.com> Content-Language: en-US, fr From: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= In-Reply-To: <20240701084957.1567641-1-eric.auger@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: MRBByQGWEdCk On 7/1/24 10:48 AM, Eric Auger wrote: > The 2 first patches are fixes of > cf2647a76e ("virtio-iommu: Compute host reserved regions") > They can be taken separately of the rest. > > Then the series uses the HostIOMMUDevice interface to fetch > information about the page size mask supported along the assigned > device and propagate it to the virtio-iommu. This is a similar > work as what was done in > > VIRTIO-IOMMU/VFIO: Fix host iommu geometry handling series > > but this time for the page size mask. Using this new > infrastructure allows to handle page size mask conflicts > earlier on device hotplug as opposed to current QEMU > abort: > > qemu-system-aarch64: virtio-iommu virtio-iommu-memory-region-8-0 > does not support frozen granule 0x10000 > qemu: hardware error: vfio: DMA mapping failed, unable to continue > > With this series the hotplug nicely fails. > > Also this allows to remove hacks consisting in transiently enabling > IOMMU MRs to collect coldplugged device page size mask before machine > init. Those hacks were introduced by > > 94df5b2180d6 ("virtio-iommu: Fix 64kB host page size VFIO device > assignment") > > The series can be found at: > https://github.com/eauger/qemu/tree/virtio-iommu-psmask-rework-v2 > > --- > v1 -> v2: > - Don't update mask if the granule is frozen (Zhenzhong) > - Collected Zhenzhong's and Cédric's R-bs > > Eric Auger (7): > virtio-iommu: Fix error handling in > virtio_iommu_set_host_iova_ranges() > vfio-container-base: Introduce vfio_container_get_iova_ranges() helper > HostIOMMUDevice : remove Error handle from get_iova_ranges callback > HostIOMMUDevice: Introduce get_page_size_mask() callback > virtio-iommu : Retrieve page size mask on > virtio_iommu_set_iommu_device() > memory: remove IOMMU MR iommu_set_page_size_mask() callback > virtio-iommu: Revert transient enablement of IOMMU MR in bypass mode > > include/exec/memory.h | 38 -------- > include/hw/vfio/vfio-container-base.h | 9 ++ > include/sysemu/host_iommu_device.h | 11 ++- > hw/vfio/common.c | 8 -- > hw/vfio/container-base.c | 15 ++++ > hw/vfio/container.c | 16 ++-- > hw/vfio/iommufd.c | 21 +++-- > hw/virtio/virtio-iommu.c | 123 +++++++++++++------------- > system/memory.c | 13 --- > hw/virtio/trace-events | 2 +- > 10 files changed, 119 insertions(+), 137 deletions(-) > Applied to vfio-next. Thanks, C.