From patchwork Mon Feb 1 15:26:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 374275 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1396484jah; Mon, 1 Feb 2021 07:31:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZYugYAzG4ihv3GsfDX/R42+qK0opNLSomWZppV6BUGzVlzfadexGY3zSXELgddyaaLbUG X-Received: by 2002:a5b:444:: with SMTP id s4mr25488357ybp.172.1612193494590; Mon, 01 Feb 2021 07:31:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612193494; cv=none; d=google.com; s=arc-20160816; b=aA9eicK1IGjsPLH8E22ZXpj+rdu4V7Mvr6LUp2QfIecp9EUa7jUa5s3X8aZscZbebD ok8joYk2ozYsAYDFjASDojBtSmhVy7+2jnnyHc2NF0Kad4pEA9n6TCLYz7nlGDZXXzbD M/e3VgPSkYLwgRg3Wu+Wjc72eeZvlOF3mtnMseM8GnQ5/ilElMZDRIf3datL2XAsa71V z3bxP3l+VaKnm63/x2huD144zliNEzvkofWpvnX6VWG+YnW6SO4JFsKIr1X/oOVeYjUM QCa9NJEoQUfq/w9mR7RS2oGIDdJPduPI1jd4Nr52msyWhdzcYyNckKsJB05EuORu2WVa ojng== 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:references:in-reply-to:message-id:date:subject:to:from; bh=OiNHi/f/5rf23gwG8x3RCLDmqDQKTOiqtsHst5+YWgU=; b=BYA1SI51ra0SlqGseR2/IMemUtq2igPnKtI+qXLkHNq7ppPCKCHISRU3XgLtoCIfSI eeZd+gmwWTiu1srnhpok6SD39WeYEd6kxiEKSDuo0PEmmX96HHKcrLjK7VIc19lo/h83 hUFz05v4w233ux1UWhxqYY272JQCyMyJcc3ffplpwj2UmD0HZM3JQHTMvWpzxhCaq3Jc xQJT8ojMVmG4Pjbyxx1wOQA/WA6rHx9zIBLjBs6hy96ca6CMR1sng3EdB9SZq0LnOGEl z1N7p85sHoftDXasgCMQ6J6U1+no+2KdGoHpXqYkC8JR5k1mCv0+Q4WK7geUZJHrv6++ CS2Q== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v10si18576759ybk.194.2021.02.01.07.31.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Feb 2021 07:31:34 -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; 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" Received: from localhost ([::1]:60442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6bAs-0008IY-3u for patch@linaro.org; Mon, 01 Feb 2021 10:31:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bAZ-0008Gh-Cl for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:31:15 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bAX-00087O-FD for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:31:15 -0500 Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DTsJc3tFdz67jfx; Mon, 1 Feb 2021 23:27:44 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Mon, 1 Feb 2021 16:31:11 +0100 Received: from lhrphicprd00229.huawei.com (10.123.41.22) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Feb 2021 15:31:11 +0000 From: Jonathan Cameron To: Subject: [RFC PATCH 1/3] hw/pci-host/gpex-acpi: Add support for dsdt construction for pxb-cxl Date: Mon, 1 Feb 2021 23:26:53 +0800 Message-ID: <20210201152655.31027-2-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> References: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml751-chm.china.huawei.com (10.201.108.201) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-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 , Thomas Huth , Ben Widawsky , "Michael S . Tsirkin" , Jonathan Cameron , Vishal Verma , f.fangjian@huawei.com, Chris Browy , f4bug@amsat.org, linuxarm@openeuler.org, jcm@redhat.com, Prashant V Agarwal , Igor Mammedov , Dan Williams , Richard Henderson , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This adds code to instantiate the slightly extended ACPI root port description in DSDT as per the CXL 2.0 specification. Basically a cut and paste job from the i386/pc code. Signed-off-by: Jonathan Cameron --- hw/pci-host/gpex-acpi.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) -- 2.19.1 diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index 446912d771..58f67ee4b0 100644 --- a/hw/pci-host/gpex-acpi.c +++ b/hw/pci-host/gpex-acpi.c @@ -5,6 +5,7 @@ #include "hw/pci/pci_bus.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pcie_host.h" +#include "hw/acpi/cxl.h" static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq) { @@ -155,6 +156,7 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg) QLIST_FOREACH(bus, &bus->child, sibling) { uint8_t bus_num = pci_bus_num(bus); uint8_t numa_node = pci_bus_numa_node(bus); + bool is_cxl; if (!pci_bus_is_root(bus)) { continue; @@ -169,9 +171,19 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg) nr_pcie_buses = bus_num; } + is_cxl = pci_bus_is_cxl(bus); + dev = aml_device("PC%.02X", bus_num); - aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A08"))); - aml_append(dev, aml_name_decl("_CID", aml_string("PNP0A03"))); + if (is_cxl) { + struct Aml *pkg = aml_package(2); + aml_append(dev, aml_name_decl("_HID", aml_string("ACPI0016"))); + aml_append(pkg, aml_eisaid("PNP0A08")); + aml_append(pkg, aml_eisaid("PNP0A03")); + aml_append(dev, aml_name_decl("_CID", pkg)); + } else { + aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A08"))); + aml_append(dev, aml_name_decl("_CID", aml_string("PNP0A03"))); + } aml_append(dev, aml_name_decl("_BBN", aml_int(bus_num))); aml_append(dev, aml_name_decl("_UID", aml_int(bus_num))); aml_append(dev, aml_name_decl("_STR", aml_unicode("pxb Device"))); @@ -190,7 +202,11 @@ void acpi_dsdt_add_gpex(Aml *scope, struct GPEXConfig *cfg) cfg->pio.base, 0, 0, 0); aml_append(dev, aml_name_decl("_CRS", crs)); - acpi_dsdt_add_pci_osc(dev); + if (is_cxl) { + build_cxl_osc_method(dev); + } else { + acpi_dsdt_add_pci_osc(dev); + } aml_append(scope, dev); } From patchwork Mon Feb 1 15:26:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 374278 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1399169jah; Mon, 1 Feb 2021 07:34:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwogsDHo/OppdlFv6b15UvBya05WOYXy+wlPQtt7++mk8PEZxZM/IIINufyyE+5QsuTArC3 X-Received: by 2002:a25:cb92:: with SMTP id b140mr23357838ybg.433.1612193685802; Mon, 01 Feb 2021 07:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612193685; cv=none; d=google.com; s=arc-20160816; b=trK3zHlM4K37CSbPm7ecPM1h3EjCbZ2iYMZ4vEjJLV5BY8LLZQwxo/qpx/nhCoD7hx IpUFj0XnaautiGTPjNpoe9Sq5q1hYysxhnNI1P7Jhn0cTSE7vHKruTFgm0BKGhQnMRgG MRJfHvPbdmcndIF4CdwRU6q9bB69P3zHnvpzxSHUvCWWG3LTsWRoBY+lMV4fnx5K3JU5 9vtzvm6Y0zg8Bv90Y1fBKauUTKJzxzaDdGGXqOwUxBEjKXjgZKJGBfeSY6ASXOCepI23 lOKhAgL8krBQn01NpwXf8iSqBUOlHFrY1QtDlEAtcBb/+QmXfyV9NjgBjhyWwiCyLy0U n80Q== 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:references:in-reply-to:message-id:date:subject:to:from; bh=J5+7pjhqqHP07heWYo2iMeh56Ze+rdCYqa2oND9SqqI=; b=VbOhqjBjRegIXyRPWSe8pctmNf6Mr7isbPq0fOq2AKjAkzs/j0nKgC+kbCQU6H4AER EmsxyeGgowLwkUuaEs5p3xL/E6NGZqAOL3/f/FO5APSPlAzxavfr75fi8fpTFwls8xtY kRRUBOUxMZGf0tCCWwVEllaU9k6LZapmBbZKaeAvzRSIeUa907pmtV8uNY2wkMNHOlJb BTF62ZlMGynW1haWTHS5RhbdWlMZxE3/SwdbAA6tdU6B542Y8SoPysKNesvYym8h5xVE VThEjrgvvIk6ZX6Hu3mLUSGovvdIYNsaFWePgvMa9zs9gm+aumer0PyQIYSKa6H5TEHk cYVg== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x4si17521863ybo.323.2021.02.01.07.34.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Feb 2021 07:34:45 -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; 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" Received: from localhost ([::1]:41580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6bDx-0003ur-AM for patch@linaro.org; Mon, 01 Feb 2021 10:34:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bB8-0000Xf-Qh for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:31:51 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bB4-0008Lg-TT for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:31:50 -0500 Received: from fraeml702-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DTsG643vhz67Wp8; Mon, 1 Feb 2021 23:25:34 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml702-chm.china.huawei.com (10.206.15.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Mon, 1 Feb 2021 16:31:42 +0100 Received: from lhrphicprd00229.huawei.com (10.123.41.22) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Feb 2021 15:31:41 +0000 From: Jonathan Cameron To: Subject: [RFC PATCH 2/3] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl Date: Mon, 1 Feb 2021 23:26:54 +0800 Message-ID: <20210201152655.31027-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> References: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml751-chm.china.huawei.com (10.201.108.201) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-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 , Thomas Huth , Ben Widawsky , "Michael S . Tsirkin" , Jonathan Cameron , Vishal Verma , f.fangjian@huawei.com, Chris Browy , f4bug@amsat.org, linuxarm@openeuler.org, jcm@redhat.com, Prashant V Agarwal , Igor Mammedov , Dan Williams , Richard Henderson , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Code based on i386/pc enablement. There is a small amount of directly cut and paste code so it may make sense to unify that at some stage. Signed-off-by: Jonathan Cameron --- hw/arm/Kconfig | 1 + hw/arm/virt-acpi-build.c | 27 +++++++++++++++++++++++++++ hw/arm/virt.c | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) -- 2.19.1 diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 0a242e4c5d..c43862bb23 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -27,6 +27,7 @@ config ARM_VIRT select ACPI_HW_REDUCED select ACPI_NVDIMM select ACPI_APEI + select ACPI_CXL config CHEETAH bool diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 9d9ee24053..ce7fd908d2 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -39,11 +39,13 @@ #include "hw/acpi/aml-build.h" #include "hw/acpi/utils.h" #include "hw/acpi/pci.h" +#include "hw/acpi/cxl.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/generic_event_device.h" #include "hw/acpi/tpm.h" #include "hw/pci/pcie_host.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_bus.h" #include "hw/pci-host/gpex.h" #include "hw/arm/virt.h" #include "hw/mem/nvdimm.h" @@ -155,11 +157,27 @@ static void acpi_dsdt_add_virtio(Aml *scope, } } +/* Move the i386 definition somewhere common? */ +static void build_acpi0017(Aml *table) +{ + Aml *dev; + Aml *scope; + + scope = aml_scope("_SB"); + dev = aml_device("CXLM"); + aml_append(dev, aml_name_decl("_HID", aml_string("ACPI0017"))); + + aml_append(scope, dev); + aml_append(table, scope); +} + static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, uint32_t irq, bool use_highmem, bool highmem_ecam, VirtMachineState *vms) { int ecam_id = VIRT_ECAM_ID(highmem_ecam); + bool cxl_present = false; + PCIBus *bus = vms->bus; struct GPEXConfig cfg = { .mmio32 = memmap[VIRT_PCIE_MMIO], .pio = memmap[VIRT_PCIE_PIO], @@ -173,6 +191,14 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, } acpi_dsdt_add_gpex(scope, &cfg); + QLIST_FOREACH(bus, &vms->bus->child, sibling) { + if (pci_bus_is_cxl(bus)) { + cxl_present = true; + } + } + if (cxl_present) { + build_acpi0017(scope); + } } static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, @@ -724,6 +750,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) build_slit(tables_blob, tables->linker, ms); } } + cxl_build_cedt(table_offsets, tables_blob, tables->linker); if (ms->nvdimms_state->is_enabled) { nvdimm_build_acpi(table_offsets, tables_blob, tables->linker, diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a3ac20744b..4d760beea9 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -78,6 +78,7 @@ #include "hw/acpi/generic_event_device.h" #include "hw/virtio/virtio-iommu.h" #include "hw/char/pl011.h" +#include "hw/cxl/cxl.h" #include "qemu/guest-random.h" #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ @@ -2481,7 +2482,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) hc->unplug_request = virt_machine_device_unplug_request_cb; hc->unplug = virt_machine_device_unplug_cb; mc->nvdimm_supported = true; - mc->cxl_supported = false; + mc->cxl_supported = true; mc->auto_enable_numa_with_memhp = true; mc->auto_enable_numa_with_memdev = true; mc->default_ram_id = "mach-virt.ram"; From patchwork Mon Feb 1 15:26:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 374277 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1398288jah; Mon, 1 Feb 2021 07:33:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgZxNeZu/rg7oGraSAKr8ZOct+oaVGOl9PrvSOqA/Vt6wU6MdvIKBU/bzyilWvn0+gF8jb X-Received: by 2002:a25:81c7:: with SMTP id n7mr25027860ybm.171.1612193622916; Mon, 01 Feb 2021 07:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612193622; cv=none; d=google.com; s=arc-20160816; b=Gwcxy3PeKxHVlVsSPBE1a2aDH/l/Uec1tckE/r4UznnF6nxvrwYtXtSQPLWy+varv0 11Xm61yWX8laEb9Y4jxlya/UlUv2+XVUKwoxl7aXx/bl6NcVgf6bVjadaXb69xA6Epk0 6zc8t/DaNcxjKIxIdzRwB8sqvwxvQq3Kx7TxIDo2hrZSl5bmLnMY1Yzf8CRbFxiYO3xf qPBGX93h8EZBgwQtypWl3Ubm2tKQNvE2juDePt1yGakfn8nTfRyuo6t8ucG/h4zxJPDC i2E+lhGIIaB682xmyWpnRK2nuf751X92geMbduc9AbDgH7Qz8tW6nZng7UZAB/cABoLE 8iXQ== 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:references:in-reply-to:message-id:date:subject:to:from; bh=um8wfiBk1wk11qzW8nZjnqHDGl9BTKViJkF0EO07Wgo=; b=tkMwhDKx6NzmS++130W8zaqQf+f8ZtXa6DTMj/I2nooKlc3sUw6fwqqaH37rVWMiG4 QCGJiTG0ZV6MA9od69NTxuVXZxtYNqaJwP7HdgCvPTOx5VuIRw5HRK0VQvg4naDdW3Zn wXpfDHswb95iBJVZ1n2PFyl53voW1M6LNUrr5Ey70AtuoQpcIeFgHmnm8sRewwyIEVq3 XbfUkZ0QIspiBLsQ+5f5x+aH02aZBezXonIJgrsAxDXl6QCxu34oi4Y+I6s3kQ6gW2ab IOzWHCPKHMBpzce//RvaKBkeZGB0OVv2trl7x29DvC55GuI6QmARLPsNYqC3nEY81rvd QeEQ== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n200si924329yba.25.2021.02.01.07.33.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Feb 2021 07:33:42 -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; 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" Received: from localhost ([::1]:39692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6bCw-00036O-BD for patch@linaro.org; Mon, 01 Feb 2021 10:33:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bBY-0001QL-9Z for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:32:16 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bBW-00005g-Gb for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:32:15 -0500 Received: from fraeml745-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DTsGj1rgwz67jjw; Mon, 1 Feb 2021 23:26:05 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml745-chm.china.huawei.com (10.206.15.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Feb 2021 16:32:12 +0100 Received: from lhrphicprd00229.huawei.com (10.123.41.22) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Feb 2021 15:32:12 +0000 From: Jonathan Cameron To: Subject: [RFC PATCH 3/3] hw/cxl/cxl-device-utils: Allow incorrect read lengths Date: Mon, 1 Feb 2021 23:26:55 +0800 Message-ID: <20210201152655.31027-4-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> References: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml751-chm.china.huawei.com (10.201.108.201) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-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 , Thomas Huth , Ben Widawsky , "Michael S . Tsirkin" , Jonathan Cameron , Vishal Verma , f.fangjian@huawei.com, Chris Browy , f4bug@amsat.org, linuxarm@openeuler.org, jcm@redhat.com, Prashant V Agarwal , Igor Mammedov , Dan Williams , Richard Henderson , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is currently needed to avoid an issue in the Linux RFC in which a read is issued that is not a multiple of DW. On arm64 that results in byte reads being issued and a bus error returned. It is not yet obvious at what level this should be fixed, so paper over it to get things working. Not-signed-off-by: Jonathan Cameron --- hw/cxl/cxl-device-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.19.1 diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c index d0d0a47122..52dd03384a 100644 --- a/hw/cxl/cxl-device-utils.c +++ b/hw/cxl/cxl-device-utils.c @@ -181,11 +181,11 @@ static const MemoryRegionOps mailbox_ops = { .write = mailbox_reg_write, .endianness = DEVICE_LITTLE_ENDIAN, .valid = { - .min_access_size = 4, + .min_access_size = 1, .max_access_size = 8, }, .impl = { - .min_access_size = 4, + .min_access_size = 1, .max_access_size = 8, }, };