From nobody Fri Apr 19 03:18:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617707924; cv=none; d=zohomail.com; s=zohoarc; b=eHM+WkrsbWZZPhSA7z0wweK5ryrzkvfPy5QKDvLYC0are+XkcGOCEEiEfseaYvtLU5vs8/5KO+4o15QDMetd4YFnPIrfdMKZ1sBP2VDSsKy0maf6QjcHIb1i8RVi/PuIea6NqtW8eLyY1XWF3cb58hZF3TGFcL1gtJnfyieVVnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617707924; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=86rFKf/dpnhWd5MFpmO2yEWECsP2Q5v5meodLK7mXCw=; b=VdOznBdq5yeLmv+EsKpfW+cQ0iqHQ7Es98ztOdCtQdY5PMQJ7C65j3lklgXFF2CeK8fIitlihr7jmTJMXKH5yavvYC1rYJ02xmDgy2doxBMt+aJUeNbp2fBAdHDCZneV/Edwd05pqHuMGyZJM4QO5rp9VoR4KslpYRTRF/lYX1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617707924400349.4363367523554; Tue, 6 Apr 2021 04:18:44 -0700 (PDT) Received: from localhost ([::1]:50550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTjjH-0003Nd-AS for importer@patchew.org; Tue, 06 Apr 2021 07:18:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTjf4-0000Tj-RM for qemu-devel@nongnu.org; Tue, 06 Apr 2021 07:14:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTjf3-0005vQ-8q for qemu-devel@nongnu.org; Tue, 06 Apr 2021 07:14:22 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-FM4NzLYoPL2DH-x_cw2OMQ-1; Tue, 06 Apr 2021 07:14:18 -0400 Received: by mail-wr1-f69.google.com with SMTP id t14so9794424wrx.12 for ; Tue, 06 Apr 2021 04:14:18 -0700 (PDT) Received: from redhat.com (bzq-79-183-252-180.red.bezeqint.net. [79.183.252.180]) by smtp.gmail.com with ESMTPSA id o1sm4834072wrw.23.2021.04.06.04.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 04:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617707660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=86rFKf/dpnhWd5MFpmO2yEWECsP2Q5v5meodLK7mXCw=; b=d9WIzlvMnJAYDtLGvq4/Zi8IyjCF1F/Mkxjj9qUJTPz4PYmUe3C3wUC7Z1ViySnsgPbCGN GlQgdS6AdHmOF4kn9sQ9+xUEIt+kKTAivojT67IgtYAtBdsUvyr3m0EipPw/5ggW8um94F 9/50EA0uWeqBzuw/tkVSmzHLfqWfa4c= X-MC-Unique: FM4NzLYoPL2DH-x_cw2OMQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=86rFKf/dpnhWd5MFpmO2yEWECsP2Q5v5meodLK7mXCw=; b=klejvO47Zr0NSl8KfR166EvMTUXc6CXwPkCA+BBItYOQ+WFQJwHQMvIUSu3AuNV8l2 wXAKwEh2WmjgsaVeNQr2PL13BTRyqsC3WHXL6nDmRGuYvRlmeC/ODa4HTntwj6SzE/B+ PErMOJgGWAmeW2bnOuq2EP/Nxpyo6xWB0QUD1ohusRD7IXt+bg8fP2ijvf5jipyCN9u0 ncWhKLZAOBNgkUVC1iffQexvyeo00lfp/Az6+1q9rXZcTZapFJSzYsfTFHde6RLVoYK9 ODpxac2oINQGcZbM8y1Od3KG7haE0dHWTVPE2UtTQXGUcrLAdWbmw8svdHC9MVZLEBjF 6/pA== X-Gm-Message-State: AOAM530f4dBj7aeufdgW9fF0kqFIWR1MHkPw3FLbIumPVAcWJ5TyaGj6 fUZsQ8NogNPxpbASDlh2Rfb4O9tdXKv19RK/pUUjgn5ycGgxDw8NREUgiwk4J9zK+yhlC4LoyIZ wTeLgidR9DTFfCbJ1SehnEtQG6cw+AhQNpHFLIOFYgqdwT5bwYzs8Wy2dgZ5V X-Received: by 2002:adf:e7c2:: with SMTP id e2mr35814637wrn.338.1617707656983; Tue, 06 Apr 2021 04:14:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3cwNKNV+qW7g6E3EVLa3uHDlMmd8fXhxLlUrUN2hrNSNJIDy07rM4/6kLKdsJKwj6D5SFcQ== X-Received: by 2002:adf:e7c2:: with SMTP id e2mr35814617wrn.338.1617707656824; Tue, 06 Apr 2021 04:14:16 -0700 (PDT) Date: Tue, 6 Apr 2021 07:14:14 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 1/2] x86: rename oem-id and oem-table-id properties Message-ID: <20210406111359.302193-2-mst@redhat.com> References: <20210406111359.302193-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210406111359.302193-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mammedov , qemu-arm@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini After introducing non-scalar machine properties, it would be preferrable to have a single acpitable property which includes both generic information (such as the OEM ids) and custom tables currently passed via -acpitable. Do not saddle ourselves with legacy oem-id and oem-table-id properties, instead mark them as experimental. Signed-off-by: Paolo Bonzini Message-Id: <20210402082128.13854-1-pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/x86.h | 4 ++-- hw/arm/virt.c | 8 ++++---- tests/qtest/bios-tables-test.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 26c9cc45a4..c09b648dff 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -78,8 +78,8 @@ struct X86MachineState { =20 #define X86_MACHINE_SMM "smm" #define X86_MACHINE_ACPI "acpi" -#define X86_MACHINE_OEM_ID "oem-id" -#define X86_MACHINE_OEM_TABLE_ID "oem-table-id" +#define X86_MACHINE_OEM_ID "x-oem-id" +#define X86_MACHINE_OEM_TABLE_ID "x-oem-table-id" =20 #define TYPE_X86_MACHINE MACHINE_TYPE_NAME("x86") OBJECT_DECLARE_TYPE(X86MachineState, X86MachineClass, X86_MACHINE) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index aa2bbd14e0..bc5f948367 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2670,19 +2670,19 @@ static void virt_machine_class_init(ObjectClass *oc= , void *data) "Set on/off to enable/disable " "ITS instantiation"); =20 - object_class_property_add_str(oc, "oem-id", + object_class_property_add_str(oc, "x-oem-id", virt_get_oem_id, virt_set_oem_id); - object_class_property_set_description(oc, "oem-id", + object_class_property_set_description(oc, "x-oem-id", "Override the default value of f= ield OEMID " "in ACPI table header." "The string may be up to 6 bytes= in size"); =20 =20 - object_class_property_add_str(oc, "oem-table-id", + object_class_property_add_str(oc, "x-oem-table-id", virt_get_oem_table_id, virt_set_oem_table_id); - object_class_property_set_description(oc, "oem-table-id", + object_class_property_set_description(oc, "x-oem-table-id", "Override the default value of f= ield OEM Table ID " "in ACPI table header." "The string may be up to 8 bytes= in size"); diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index e020c83d2a..156d4174aa 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -73,7 +73,7 @@ =20 #define OEM_ID "TEST" #define OEM_TABLE_ID "OEM" -#define OEM_TEST_ARGS "-machine oem-id=3D"OEM_ID",oem-table-id=3D"OEM= _TABLE_ID +#define OEM_TEST_ARGS "-machine x-oem-id=3D"OEM_ID",x-oem-table-id=3D= "OEM_TABLE_ID =20 typedef struct { bool tcg_only; --=20 MST From nobody Fri Apr 19 03:18:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617707773; cv=none; d=zohomail.com; s=zohoarc; b=hjIzKvVb9vO5XaQGqssiKb6jzJYG1nyLJOhnmr9N+f+JYwdEm35bq3NaDKWJ7fzkDzydUuyCYPn6MLmbK/IH9vTA+0Bm8mq5IgMjmlx3aorxXcKV+VzSRJ5MAP+uyISgi77ZiSe79eG9mb1EsPFhkgZ4un/TfJLClJj5uoaLiqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617707773; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xEIoZ9Bv9C8PqaB9zYPlxU2z0nASwTi56Sb3t6QdC/c=; b=SdfAT7pvE+Pe7Sz0f09wMOFUIG8D2xheNHfWn+bVf+YXag2RDok1wmZgsK/RY7GxgKCpKHj8dLBmmcrUSqqZi98V8JfpNExsaEzDembudByXR7QUTkfHnYWvDjyMNyQkG2D1ABRqcFXpfzpPu+jI3wvez3oQzRp5A7dDP/165QU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617707773192369.5762588457594; Tue, 6 Apr 2021 04:16:13 -0700 (PDT) Received: from localhost ([::1]:46488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTjgp-0001iI-TO for importer@patchew.org; Tue, 06 Apr 2021 07:16:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTjf6-0000Vn-LZ for qemu-devel@nongnu.org; Tue, 06 Apr 2021 07:14:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTjf4-0005wa-T3 for qemu-devel@nongnu.org; Tue, 06 Apr 2021 07:14:24 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-366-0zKdOxX-MtyKHE9EJkeKhw-1; Tue, 06 Apr 2021 07:14:20 -0400 Received: by mail-wr1-f69.google.com with SMTP id r11so5054300wrp.8 for ; Tue, 06 Apr 2021 04:14:20 -0700 (PDT) Received: from redhat.com (bzq-79-183-252-180.red.bezeqint.net. [79.183.252.180]) by smtp.gmail.com with ESMTPSA id e13sm36257578wrg.72.2021.04.06.04.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 04:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617707662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xEIoZ9Bv9C8PqaB9zYPlxU2z0nASwTi56Sb3t6QdC/c=; b=HG6WQa0/hc+qZ99QG//0Zlm8AVFzZC6ngy1A7mf8beR8RCKgfxEdQUo+6qLN8/+7T1MYAC JcUC8teOrchppwOXwD58ba6Jg5VuCwXSQkCFlK3yNBUSYgvfrcmvRtXR9U3g0Rdqy64Yax NWCechTyQspmp8J6u65sqKUawnqQKXo= X-MC-Unique: 0zKdOxX-MtyKHE9EJkeKhw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xEIoZ9Bv9C8PqaB9zYPlxU2z0nASwTi56Sb3t6QdC/c=; b=I7C7jMalGMU6GAUkOrpFSGFEQy9OP+agcxEE2t1Vz9lPB8vsDvzZvhCSTYWQBYLlG5 E6N/SaX7ns3ivwEpI2P9aXl6s20sUtpUxVKddmuZNiI83epcH6vRljCtmUnSxNxVlh9t 0K7/u0xtZxkdYoo8tpfRvE2mQkimdQsG0ziBsXEE5HSMtpEMTmL/te+KUC+NMIhllpHr qWJ3u8/wK7N/kfb3c0SYDh0AYmD73ccjigfMJ3F0VckcqxmUHptPsiXt4OLTGvGRUiKR Y8gTjL666Li0bCKC6QYPur6vOUsXd0+QGY3R5bpvUbKbTPuxm2nQs/86k9afAzul57kw KiGQ== X-Gm-Message-State: AOAM533++FMyT8YQF12z7rXhAYJO7wckuPZ8aIiM8Qmkn8rVr7FH2Ulf /3qJLmmY9eOXk9VRoMVvdGP4vOcv4fGOpV5KLEjQ/iiDwPIuSZo3HzomFm+8ci4p40RxHL16LtZ fr/3HgJjizTfyj4bw4IpnKlvquO3qKyMoD3ZvxD49U1AFWtRkRFI/us7pOhir X-Received: by 2002:a5d:6c6d:: with SMTP id r13mr34026042wrz.362.1617707659341; Tue, 06 Apr 2021 04:14:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxluLhBJdCGo3UyklnDXUzFmDnuM+xu0HP+YQWJOp1ByJJDMRmrqGPoCPkSjaT1yXpM73Eoag== X-Received: by 2002:a5d:6c6d:: with SMTP id r13mr34026022wrz.362.1617707659178; Tue, 06 Apr 2021 04:14:19 -0700 (PDT) Date: Tue, 6 Apr 2021 07:14:17 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 2/2] virtio-pci: compat page aligned ATS Message-ID: <20210406111359.302193-3-mst@redhat.com> References: <20210406111359.302193-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210406111359.302193-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Jason Wang , "Dr . David Alan Gilbert" , Peter Xu , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang Commit 4c70875372b8 ("pci: advertise a page aligned ATS") advertises the page aligned via ATS capability (RO) to unbrek recent Linux IOMMU drivers since 5.2. But it forgot the compat the capability which breaks the migration from old machine type: (qemu) qemu-kvm: get_pci_config_device: Bad config data: i=3D0x104 read: 0 device: 20 cmask: ff wmask: 0 w1cmask:0 This patch introduces a new parameter "x-ats-page-aligned" for virtio-pci device and turns it on for machine type which is newer than 5.1. Cc: Michael S. Tsirkin Cc: Peter Xu Cc: Dr. David Alan Gilbert Cc: qemu-stable@nongnu.org Fixes: 4c70875372b8 ("pci: advertise a page aligned ATS") Signed-off-by: Jason Wang Message-Id: <20210406040330.11306-1-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.h | 5 +++++ include/hw/pci/pcie.h | 2 +- hw/core/machine.c | 1 + hw/pci/pcie.c | 10 ++++++---- hw/virtio/virtio-pci.c | 5 ++++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index d7d5d403a9..2446dcd9ae 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -42,6 +42,7 @@ enum { VIRTIO_PCI_FLAG_INIT_PM_BIT, VIRTIO_PCI_FLAG_INIT_FLR_BIT, VIRTIO_PCI_FLAG_AER_BIT, + VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED_BIT, }; =20 /* Need to activate work-arounds for buggy guests at vmstate load. */ @@ -84,6 +85,10 @@ enum { /* Advanced Error Reporting capability */ #define VIRTIO_PCI_FLAG_AER (1 << VIRTIO_PCI_FLAG_AER_BIT) =20 +/* Page Aligned Address space Translation Service */ +#define VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED \ + (1 << VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED_BIT) + typedef struct { MSIMessage msg; int virq; diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 14c58ebdb6..6063bee0ec 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -137,7 +137,7 @@ void pcie_acs_reset(PCIDevice *dev); =20 void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn); void pcie_dev_ser_num_init(PCIDevice *dev, uint16_t offset, uint64_t ser_n= um); -void pcie_ats_init(PCIDevice *dev, uint16_t offset); +void pcie_ats_init(PCIDevice *dev, uint16_t offset, bool aligned); =20 void pcie_cap_slot_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *d= ev, Error **errp); diff --git a/hw/core/machine.c b/hw/core/machine.c index 9935c6ddd5..a50f2d5f0a 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -53,6 +53,7 @@ GlobalProperty hw_compat_5_1[] =3D { { "nvme", "use-intel-id", "on"}, { "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */ { "pl011", "migrate-clk", "off" }, + { "virtio-pci", "x-ats-page-aligned", "off"}, }; const size_t hw_compat_5_1_len =3D G_N_ELEMENTS(hw_compat_5_1); =20 diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index a733e2fb87..fd0fa157e8 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -963,16 +963,18 @@ void pcie_dev_ser_num_init(PCIDevice *dev, uint16_t o= ffset, uint64_t ser_num) pci_set_quad(dev->config + offset + pci_dsn_cap, ser_num); } =20 -void pcie_ats_init(PCIDevice *dev, uint16_t offset) +void pcie_ats_init(PCIDevice *dev, uint16_t offset, bool aligned) { pcie_add_capability(dev, PCI_EXT_CAP_ID_ATS, 0x1, offset, PCI_EXT_CAP_ATS_SIZEOF); =20 dev->exp.ats_cap =3D offset; =20 - /* Invalidate Queue Depth 0, Page Aligned Request 1 */ - pci_set_word(dev->config + offset + PCI_ATS_CAP, - PCI_ATS_CAP_PAGE_ALIGNED); + /* Invalidate Queue Depth 0 */ + if (aligned) { + pci_set_word(dev->config + offset + PCI_ATS_CAP, + PCI_ATS_CAP_PAGE_ALIGNED); + } /* STU 0, Disabled by default */ pci_set_word(dev->config + offset + PCI_ATS_CTRL, 0); =20 diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c1b67cf6fc..b321604d9b 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1856,7 +1856,8 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Er= ror **errp) } =20 if (proxy->flags & VIRTIO_PCI_FLAG_ATS) { - pcie_ats_init(pci_dev, last_pcie_cap_offset); + pcie_ats_init(pci_dev, last_pcie_cap_offset, + proxy->flags & VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED); last_pcie_cap_offset +=3D PCI_EXT_CAP_ATS_SIZEOF; } =20 @@ -1933,6 +1934,8 @@ static Property virtio_pci_properties[] =3D { ignore_backend_features, false), DEFINE_PROP_BIT("ats", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_ATS_BIT, false), + DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags, + VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED_BIT, true), DEFINE_PROP_BIT("x-pcie-deverr-init", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_INIT_DEVERR_BIT, true), DEFINE_PROP_BIT("x-pcie-lnkctl-init", VirtIOPCIProxy, flags, --=20 MST