From patchwork Mon Feb 14 12:43:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 542519 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp867303imn; Mon, 14 Feb 2022 05:08:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxobCEq9W6vGV9Mqdc4cb2PKaZD1IgOn01X+1GUtY9Kqia/0Boni46p/BGCKzw3fMeuXbbQ X-Received: by 2002:ac8:7e8c:: with SMTP id w12mr9384602qtj.342.1644844082734; Mon, 14 Feb 2022 05:08:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644844082; cv=none; d=google.com; s=arc-20160816; b=H5qlLWYG3jo7yrAZHohJl2WJj/7/ixF3hBAUyNSUhNJjSHwqVU/ZSP2WN4S/Ux8MAB dsPO5CerK2wiIo3TzndDFRy+kUU47lvt8JrEh9amnN2ulGtjhcHsMZey9ut0rZKVU65T I1CYE1cIZyUXZ9YV7eqDypCGxnp1IfUfKdJNSiAAnOOJIpCZr4rToadbUtKOhSD951y3 gm10z/KB2kq2wIFOynPPWmOBW8lOkRYL/ZKySeH6/HLV4tdaEfKRPQM7ZDeSQ1C64Kex HIFo8o87gRrv5oCEUTYw1i6HergKYWmn382oOkP3X1MLqj9FyWmZ6A5fCBh2jqkgHaN1 /NsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=8EynZCzzOwa6d/pox+zxXc087LSOBF09jVCbGFxyu6A=; b=D5t+P7NkPi3FGjj1maNVQlQ73+9+DLnuX75xndhmkFYGUxjLx8yGBJjM1Cflz6P6ns IJzIg63hc62dYUmWISw1lw8EXn3aE+2pcx+O9etlghhpsxFSIq947zz40oT+IrRP0sdQ CZBXIPaNX3uT3YUzYI2jxhXWZPE50nEW+Uj24tHMjPvrMUBMnztpy5THJcjhVhkAUxH6 5RGawUVajePaIOMi4tYeYfcr/y4vpCNo9vIIat74/oQACMyBnZGN3I3lER8sHGHb84mn 5Vg0Ywvp4+q44DLk3mMmOuTBn0AMg7d3in5p4LXqpvSErd8vsFAs72XlfUw9Pfjd0CtG +bYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=abNA3IWE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i4si4573541qvh.51.2022.02.14.05.08.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Feb 2022 05:08:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=abNA3IWE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJb5G-0002zn-6l for patch@linaro.org; Mon, 14 Feb 2022 08:08:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJala-0008JH-JY for qemu-devel@nongnu.org; Mon, 14 Feb 2022 07:47:44 -0500 Received: from [2a00:1450:4864:20::62d] (port=45862 helo=mail-ej1-x62d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJalW-00066t-4W for qemu-devel@nongnu.org; Mon, 14 Feb 2022 07:47:40 -0500 Received: by mail-ej1-x62d.google.com with SMTP id lw4so6368870ejb.12 for ; Mon, 14 Feb 2022 04:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8EynZCzzOwa6d/pox+zxXc087LSOBF09jVCbGFxyu6A=; b=abNA3IWECfAIDz5GwAXzBU7z0W+KWLzvVNKWWAMkfvg2ddmqNTpWjPYRV1Icl/lCi9 a3O6Wwc+aZGaoPCoZa2mSajSZSkz9pnKSZ/qIX+NM+Sr9XglLJw3s4GCtX588OhyuEHn h5LT1CuwvpZUc7pExsZc4iOs+S6Ai0zf3YazlBD9jc6T/lfANI7BJkcgHUH7bn+v2Vd7 3vMxt8a0UiX7QgIrl0fOYGdU7r23ecWGODMgClBE5OylrM9UeSo8A1CAdddBAcTrzjAf j7e0AVdLt+vGQsb+5cGjKyyz2r04A2dx11l7CMbdqCJmFzQsQkrXZcfI9k36/B84YqJQ LPqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8EynZCzzOwa6d/pox+zxXc087LSOBF09jVCbGFxyu6A=; b=V4pyJzNagXfQLmBzdZmz55E+9Eu+Mkrbmal2cO82r7VWDHnygLFZTJqAXUykX0PpD8 L+SSaniB0fpVU1g8u0s/ltpFa0+b6SqQHj5mZOaJblQKO4IJ4onVQJRFNSdDXXuPo1hj blWYPtcJ1PTp7UrI7DFl4e0t8BFmsowy66k4SmBhlbzAifGlgx4JpA+ClJkje76XAmwZ luNw7joZT1eExw0/TfbQZA8U0sTGxrb50REh1FgNobBmhao+4LpWAUzI8axplv43CcN8 z8AxfoArs4Vbb5lIGkiRi+vKJMKp2jpsCvUJtUHuqd3QPindY5sVHPkpw8SgJ3z+4ulA 7w6A== X-Gm-Message-State: AOAM530eAXbdnfCnH/SxUfHc4wNBlvjXfNr1Tr4iObUsjb2sOLb6w5y+ H4AjJMc2cICggGnFq+peLPFDIQ== X-Received: by 2002:a17:906:6482:: with SMTP id e2mr11514279ejm.198.1644842854614; Mon, 14 Feb 2022 04:47:34 -0800 (PST) Received: from localhost.localdomain (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id kq17sm1475422ejb.205.2022.02.14.04.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 04:47:33 -0800 (PST) From: Jean-Philippe Brucker To: eric.auger@redhat.com Subject: [PATCH v3 0/4] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG Date: Mon, 14 Feb 2022 12:43:52 +0000 Message-Id: <20220214124356.872985-1-jean-philippe@linaro.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=jean-philippe@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.635, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: lvivier@redhat.com, Jean-Philippe Brucker , thuth@redhat.com, mst@redhat.com, cohuck@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, pasic@linux.ibm.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Replace the VIRTIO_IOMMU_F_BYPASS feature with VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch global bypass on and off. Add a boot-bypass option, which defaults to 'on' to be in line with other vIOMMUs and to allow running firmware/bootloader that are unaware of the IOMMU. x86 doesn't need a workaround to boot with virtio-iommu anymore. Since v2 [1]: * Added the new bypass bits to the migration stream. As discussed on the v2 thread, we assume that cross-version compatibility is not required for live migration at the moment, so we only increase the version number. Patch 2 says: "We add the bypass field to the migration stream without introducing subsections, based on the assumption that this virtio-iommu device isn't being used in production enough to require cross-version migration at the moment (all previous version required workarounds since they didn't support ACPI and boot-bypass)." [1] https://lore.kernel.org/qemu-devel/20220127142940.671333-1-jean-philippe@linaro.org/ Jean-Philippe Brucker (4): linux-headers: update to v5.17-rc1 virtio-iommu: Default to bypass during boot virtio-iommu: Support bypass domain tests/qtest/virtio-iommu-test: Check bypass config include/hw/virtio/virtio-iommu.h | 1 + include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/drm/drm_fourcc.h | 11 ++ include/standard-headers/linux/ethtool.h | 1 + include/standard-headers/linux/fuse.h | 60 +++++++- include/standard-headers/linux/pci_regs.h | 142 +++++++++--------- include/standard-headers/linux/virtio_gpio.h | 72 +++++++++ include/standard-headers/linux/virtio_i2c.h | 47 ++++++ include/standard-headers/linux/virtio_iommu.h | 8 +- .../standard-headers/linux/virtio_pcidev.h | 65 ++++++++ include/standard-headers/linux/virtio_scmi.h | 24 +++ linux-headers/asm-generic/unistd.h | 5 +- linux-headers/asm-mips/unistd_n32.h | 2 + linux-headers/asm-mips/unistd_n64.h | 2 + linux-headers/asm-mips/unistd_o32.h | 2 + linux-headers/asm-powerpc/unistd_32.h | 2 + linux-headers/asm-powerpc/unistd_64.h | 2 + linux-headers/asm-riscv/bitsperlong.h | 14 ++ linux-headers/asm-riscv/mman.h | 1 + linux-headers/asm-riscv/unistd.h | 44 ++++++ linux-headers/asm-s390/unistd_32.h | 2 + linux-headers/asm-s390/unistd_64.h | 2 + linux-headers/asm-x86/kvm.h | 16 +- linux-headers/asm-x86/unistd_32.h | 1 + linux-headers/asm-x86/unistd_64.h | 1 + linux-headers/asm-x86/unistd_x32.h | 1 + linux-headers/linux/kvm.h | 17 +++ hw/virtio/virtio-iommu.c | 99 ++++++++++-- tests/qtest/virtio-iommu-test.c | 2 + hw/virtio/trace-events | 4 +- 30 files changed, 561 insertions(+), 90 deletions(-) create mode 100644 include/standard-headers/linux/virtio_gpio.h create mode 100644 include/standard-headers/linux/virtio_i2c.h create mode 100644 include/standard-headers/linux/virtio_pcidev.h create mode 100644 include/standard-headers/linux/virtio_scmi.h create mode 100644 linux-headers/asm-riscv/bitsperlong.h create mode 100644 linux-headers/asm-riscv/mman.h create mode 100644 linux-headers/asm-riscv/unistd.h Reviewed-by: Eric Auger Tested-by: Eric Auger Acked-by: Cornelia Huck