From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08C08C433FE for ; Mon, 4 Oct 2021 12:00:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E21E4613A8 for ; Mon, 4 Oct 2021 12:00:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233036AbhJDMCP (ORCPT ); Mon, 4 Oct 2021 08:02:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30310 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbhJDMCO (ORCPT ); Mon, 4 Oct 2021 08:02:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633348825; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Szh1sZdd2NA++7VzE8dfvZgPCeKZLBpLUKEMevzbR2c=; b=OCh2rWS6JEVzBAEPP2cpylcumjxb6M93vOCxnLT5WKf7qVoijo7QPI07rU+3SxJ0+CykDd NYge2UQc5KCaQqKrLrZyip2metEE75hZGZhmwWJEMdEAXPJdHxF2pHoTV8Vo6Ks7qfWY6X LJaGiTbxHxzDAFYiHSNM1wgOW3+S2Bs= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-584-ddmst8FYOva4p7Mydj9pQw-1; Mon, 04 Oct 2021 08:00:24 -0400 X-MC-Unique: ddmst8FYOva4p7Mydj9pQw-1 Received: by mail-wm1-f69.google.com with SMTP id 129-20020a1c0187000000b0030d4081c36cso4061820wmb.0 for ; Mon, 04 Oct 2021 05:00:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=Szh1sZdd2NA++7VzE8dfvZgPCeKZLBpLUKEMevzbR2c=; b=UsZPrvodDBajG1OH+KLCBLKO42jXJCNoTlEZ6Upzrf8ph1Bu6Qi/b/i7oSmZpATXNB nz6KF38GAXOD30TfM0T08dfz6oIpbi1c67ZUhboTtwL56PWLLngMiLits4+rDZFlifPB RwF82BwZaxFpcsRIvCcixTapbPnDEJ4jE65ZMQGKsSwWNfHG54yGbtWnmokNAM+K1ugu WQ2Y8Hy8BDoTzEtl40tppFQRFUELL+fIsp8KELsM/wBdMQizsTg+Tx0Qkq0Xr8w+PX/q CH+CswA5dtWXfKqX6r8BeTZbhK5GahQQf+gf7d78xJxtLTq34Jv43xRh8JNl7d1AwPKe 1YqA== X-Gm-Message-State: AOAM5332G6+IgIs5tCjm6/0MT0YfVkElc15Q0ISjpZ9+7GluXu92haaV 9NPuxpRXvrm2ZdrDgbBEQsSIeWpj523XND/+qO1wZsc9KTockJaIzYSE++RWlbybsNZ4ybkzsBz z3sOtL2TEG7Py X-Received: by 2002:adf:a45e:: with SMTP id e30mr12058140wra.269.1633348823446; Mon, 04 Oct 2021 05:00:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHUUsSuliMbaWMUJfOxhomX+YqGVSB+h6Tbvc9XMFwkt9wv5ln2ZOsJjF3r/t46K2PWn19YQ== X-Received: by 2002:adf:a45e:: with SMTP id e30mr12058101wra.269.1633348823180; Mon, 04 Oct 2021 05:00:23 -0700 (PDT) Received: from ?IPv6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id j27sm16609782wms.6.2021.10.04.05.00.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 05:00:22 -0700 (PDT) Reply-To: eric.auger@redhat.com Subject: Re: [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam To: Marc Zyngier , qemu-devel@nongnu.org Cc: Andrew Jones , Peter Maydell , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com References: <20211003164605.3116450-1-maz@kernel.org> <20211003164605.3116450-2-maz@kernel.org> From: Eric Auger Message-ID: Date: Mon, 4 Oct 2021 14:00:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20211003164605.3116450-2-maz@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Marc, On 10/3/21 6:46 PM, Marc Zyngier wrote: > Currently, the highmem PCIe region is oddly keyed on the highmem > attribute instead of highmem_ecam. Move the enablement of this PCIe > region over to highmem_ecam. > > Signed-off-by: Marc Zyngier > --- > hw/arm/virt-acpi-build.c | 10 ++++------ > hw/arm/virt.c | 4 ++-- > 2 files changed, 6 insertions(+), 8 deletions(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 037cc1fd82..d7bef0e627 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -157,10 +157,9 @@ static void acpi_dsdt_add_virtio(Aml *scope, > } > > static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > - uint32_t irq, bool use_highmem, bool highmem_ecam, > - VirtMachineState *vms) > + uint32_t irq, VirtMachineState *vms) > { > - int ecam_id = VIRT_ECAM_ID(highmem_ecam); > + int ecam_id = VIRT_ECAM_ID(vms->highmem_ecam); > struct GPEXConfig cfg = { > .mmio32 = memmap[VIRT_PCIE_MMIO], > .pio = memmap[VIRT_PCIE_PIO], > @@ -169,7 +168,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > .bus = vms->bus, > }; > > - if (use_highmem) { > + if (vms->highmem_ecam) { highmem_ecam is more restrictive than use_highmem: vms->highmem_ecam &= vms->highmem && (!firmware_loaded || aarch64); If I remember correctly there was a problem using highmem ECAM with 32b AAVMF FW. However 5125f9cd2532 ("hw/arm/virt: Add high MMIO PCI region, 512G in size") introduced high MMIO PCI region without this constraint. So to me we should keep vms->highmem here Eric > cfg.mmio64 = memmap[VIRT_HIGH_PCIE_MMIO]; > } > > @@ -712,8 +711,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) > acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]); > acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO], > (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPORTS); > - acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), > - vms->highmem, vms->highmem_ecam, vms); > + acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), vms); > if (vms->acpi_dev) { > build_ged_aml(scope, "\\_SB."GED_DEVICE, > HOTPLUG_HANDLER(vms->acpi_dev), > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 7170aaacd5..8021d545c3 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -1362,7 +1362,7 @@ static void create_pcie(VirtMachineState *vms) > mmio_reg, base_mmio, size_mmio); > memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > /* Map high MMIO space */ > MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1); > > @@ -1416,7 +1416,7 @@ static void create_pcie(VirtMachineState *vms) > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", > 2, base_ecam, 2, size_ecam); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", > 1, FDT_PCI_RANGE_IOPORT, 2, 0, > 2, base_pio, 2, size_pio, From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9133C433F5 for ; Mon, 4 Oct 2021 12:00:30 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 520106136F for ; Mon, 4 Oct 2021 12:00:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 520106136F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D504A4B283; Mon, 4 Oct 2021 08:00:29 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@redhat.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uj043PyikcgI; Mon, 4 Oct 2021 08:00:28 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B1B024B279; Mon, 4 Oct 2021 08:00:28 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1D58B4B279 for ; Mon, 4 Oct 2021 08:00:27 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DzE+sLK4D1ez for ; Mon, 4 Oct 2021 08:00:26 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 11BF84B278 for ; Mon, 4 Oct 2021 08:00:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633348825; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Szh1sZdd2NA++7VzE8dfvZgPCeKZLBpLUKEMevzbR2c=; b=OCh2rWS6JEVzBAEPP2cpylcumjxb6M93vOCxnLT5WKf7qVoijo7QPI07rU+3SxJ0+CykDd NYge2UQc5KCaQqKrLrZyip2metEE75hZGZhmwWJEMdEAXPJdHxF2pHoTV8Vo6Ks7qfWY6X LJaGiTbxHxzDAFYiHSNM1wgOW3+S2Bs= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-536-n4OEST2AN0icXsiEF6VUCg-1; Mon, 04 Oct 2021 08:00:24 -0400 X-MC-Unique: n4OEST2AN0icXsiEF6VUCg-1 Received: by mail-wr1-f70.google.com with SMTP id k2-20020adfc702000000b0016006b2da9bso4567547wrg.1 for ; Mon, 04 Oct 2021 05:00:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=Szh1sZdd2NA++7VzE8dfvZgPCeKZLBpLUKEMevzbR2c=; b=1VHmV9j+XF/1Q5KCREhGAuyDP9iNIlQS8Hn+Mt5VaUP8qnL2mqFn8KBscX7VduBF1Y 7ilXhrOaccjVib5p1wjU7VkGOQ7zg1uVtR2vNR0bzX3nzVNcfflUG4gjMzpZoqcwWkzS mX3dzDoipwP29G36CoC+X3fhjt7TlX3lTaZacPSp8jlff8II/exprI9YsOMyaqHLC6Ji CDryf49sDbm1Y+5BlpSLEnFUzDDhKWo2uspiTUlf5eDTeFcmv3MSfTxMnhX8+fNi2qCx qw+MvzC1bPPSEIvb7VfdTwl1hC1DstfPA+vlHAE+GBqp1CTGrWmJw9rRcJGwA/5I0N+3 3HuQ== X-Gm-Message-State: AOAM532LjcKaTEx1mE2o8Kc84MuJ6bnsiZG4Nk0FprDn27ybfOo9MnTN 06f04StLqOXQx9+Zip03vtP793Q6gqJosNDZ+KOUGpnFDx4JFA1qEUPTjWqIQT5nru+KPFtmFWO E/pBBI9A5+dYlpeERJ67uvhfo X-Received: by 2002:adf:a45e:: with SMTP id e30mr12058138wra.269.1633348823445; Mon, 04 Oct 2021 05:00:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHUUsSuliMbaWMUJfOxhomX+YqGVSB+h6Tbvc9XMFwkt9wv5ln2ZOsJjF3r/t46K2PWn19YQ== X-Received: by 2002:adf:a45e:: with SMTP id e30mr12058101wra.269.1633348823180; Mon, 04 Oct 2021 05:00:23 -0700 (PDT) Received: from ?IPv6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id j27sm16609782wms.6.2021.10.04.05.00.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 05:00:22 -0700 (PDT) Subject: Re: [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam To: Marc Zyngier , qemu-devel@nongnu.org References: <20211003164605.3116450-1-maz@kernel.org> <20211003164605.3116450-2-maz@kernel.org> From: Eric Auger Message-ID: Date: Mon, 4 Oct 2021 14:00:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20211003164605.3116450-2-maz@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Cc: kernel-team@android.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list Reply-To: eric.auger@redhat.com List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Marc, On 10/3/21 6:46 PM, Marc Zyngier wrote: > Currently, the highmem PCIe region is oddly keyed on the highmem > attribute instead of highmem_ecam. Move the enablement of this PCIe > region over to highmem_ecam. > > Signed-off-by: Marc Zyngier > --- > hw/arm/virt-acpi-build.c | 10 ++++------ > hw/arm/virt.c | 4 ++-- > 2 files changed, 6 insertions(+), 8 deletions(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 037cc1fd82..d7bef0e627 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -157,10 +157,9 @@ static void acpi_dsdt_add_virtio(Aml *scope, > } > > static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > - uint32_t irq, bool use_highmem, bool highmem_ecam, > - VirtMachineState *vms) > + uint32_t irq, VirtMachineState *vms) > { > - int ecam_id = VIRT_ECAM_ID(highmem_ecam); > + int ecam_id = VIRT_ECAM_ID(vms->highmem_ecam); > struct GPEXConfig cfg = { > .mmio32 = memmap[VIRT_PCIE_MMIO], > .pio = memmap[VIRT_PCIE_PIO], > @@ -169,7 +168,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > .bus = vms->bus, > }; > > - if (use_highmem) { > + if (vms->highmem_ecam) { highmem_ecam is more restrictive than use_highmem: vms->highmem_ecam &= vms->highmem && (!firmware_loaded || aarch64); If I remember correctly there was a problem using highmem ECAM with 32b AAVMF FW. However 5125f9cd2532 ("hw/arm/virt: Add high MMIO PCI region, 512G in size") introduced high MMIO PCI region without this constraint. So to me we should keep vms->highmem here Eric > cfg.mmio64 = memmap[VIRT_HIGH_PCIE_MMIO]; > } > > @@ -712,8 +711,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) > acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]); > acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO], > (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPORTS); > - acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), > - vms->highmem, vms->highmem_ecam, vms); > + acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), vms); > if (vms->acpi_dev) { > build_ged_aml(scope, "\\_SB."GED_DEVICE, > HOTPLUG_HANDLER(vms->acpi_dev), > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 7170aaacd5..8021d545c3 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -1362,7 +1362,7 @@ static void create_pcie(VirtMachineState *vms) > mmio_reg, base_mmio, size_mmio); > memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > /* Map high MMIO space */ > MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1); > > @@ -1416,7 +1416,7 @@ static void create_pcie(VirtMachineState *vms) > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", > 2, base_ecam, 2, size_ecam); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", > 1, FDT_PCI_RANGE_IOPORT, 2, 0, > 2, base_pio, 2, size_pio, _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3839C433EF for ; Mon, 4 Oct 2021 12:04:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52FC061215 for ; Mon, 4 Oct 2021 12:04:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 52FC061215 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:53624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXMiA-0003Zr-83 for qemu-devel@archiver.kernel.org; Mon, 04 Oct 2021 08:04:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXMe3-0000aV-Qo for qemu-devel@nongnu.org; Mon, 04 Oct 2021 08:00:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXMdx-0003sX-V6 for qemu-devel@nongnu.org; Mon, 04 Oct 2021 08:00:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633348825; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Szh1sZdd2NA++7VzE8dfvZgPCeKZLBpLUKEMevzbR2c=; b=OCh2rWS6JEVzBAEPP2cpylcumjxb6M93vOCxnLT5WKf7qVoijo7QPI07rU+3SxJ0+CykDd NYge2UQc5KCaQqKrLrZyip2metEE75hZGZhmwWJEMdEAXPJdHxF2pHoTV8Vo6Ks7qfWY6X LJaGiTbxHxzDAFYiHSNM1wgOW3+S2Bs= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-509-iZmJpRgSP52pZQYFGZXb6g-1; Mon, 04 Oct 2021 08:00:24 -0400 X-MC-Unique: iZmJpRgSP52pZQYFGZXb6g-1 Received: by mail-wr1-f72.google.com with SMTP id r15-20020adfce8f000000b0015df1098ccbso4587141wrn.4 for ; Mon, 04 Oct 2021 05:00:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=Szh1sZdd2NA++7VzE8dfvZgPCeKZLBpLUKEMevzbR2c=; b=ZHRuvUVUHigoapbu0b2jFzG1OV/XRhE9cjCy/IhldLD10DpRPMBUP63Ry48q8YLgY3 7pvMjc9xEGABQDegay2kx/5D+GfevG68QhNLjHELPapF8zhoy7+8cARnUfU+ZJ9qI0nX Ko+SuuQoH2SgTvw9H86IGKF/QGJxz2LILGAgr/B9DnqV7ERnQC/zSzlZ/lZLRHOWItS9 eoPVGBoYhpkg6YOmxDcVqDTbYGlMBOpQzxpgXf3MZdoqlr5MUfmzv2fvOq57mt+HDtz2 zpX2qj6IwBEKjUL7rNqzZyxrXxmGvrnUaPIgu7Bhi4UkMRMRP4aT04zzMHrm4JSwXvZV jESw== X-Gm-Message-State: AOAM530srCabnHZg0Qhbng5GTBJh4aodnL/1qxVaFRl0/z/krAvM9Kn/ OV+tQ1HG6jsOVo4nxCDZGYaQ/bktTV2Haxr/mKYyVmYV3V7mJrGL097ykXqph/cCdWjNMHRYdHg 9OqsjU1Mk2ayy+00= X-Received: by 2002:adf:a45e:: with SMTP id e30mr12058144wra.269.1633348823465; Mon, 04 Oct 2021 05:00:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHUUsSuliMbaWMUJfOxhomX+YqGVSB+h6Tbvc9XMFwkt9wv5ln2ZOsJjF3r/t46K2PWn19YQ== X-Received: by 2002:adf:a45e:: with SMTP id e30mr12058101wra.269.1633348823180; Mon, 04 Oct 2021 05:00:23 -0700 (PDT) Received: from ?IPv6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id j27sm16609782wms.6.2021.10.04.05.00.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 05:00:22 -0700 (PDT) Subject: Re: [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam To: Marc Zyngier , qemu-devel@nongnu.org References: <20211003164605.3116450-1-maz@kernel.org> <20211003164605.3116450-2-maz@kernel.org> From: Eric Auger Message-ID: Date: Mon, 4 Oct 2021 14:00:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20211003164605.3116450-2-maz@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Received-SPF: pass client-ip=216.205.24.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.066, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, 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: , Reply-To: eric.auger@redhat.com Cc: Peter Maydell , Andrew Jones , kernel-team@android.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi Marc, On 10/3/21 6:46 PM, Marc Zyngier wrote: > Currently, the highmem PCIe region is oddly keyed on the highmem > attribute instead of highmem_ecam. Move the enablement of this PCIe > region over to highmem_ecam. > > Signed-off-by: Marc Zyngier > --- > hw/arm/virt-acpi-build.c | 10 ++++------ > hw/arm/virt.c | 4 ++-- > 2 files changed, 6 insertions(+), 8 deletions(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 037cc1fd82..d7bef0e627 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -157,10 +157,9 @@ static void acpi_dsdt_add_virtio(Aml *scope, > } > > static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > - uint32_t irq, bool use_highmem, bool highmem_ecam, > - VirtMachineState *vms) > + uint32_t irq, VirtMachineState *vms) > { > - int ecam_id = VIRT_ECAM_ID(highmem_ecam); > + int ecam_id = VIRT_ECAM_ID(vms->highmem_ecam); > struct GPEXConfig cfg = { > .mmio32 = memmap[VIRT_PCIE_MMIO], > .pio = memmap[VIRT_PCIE_PIO], > @@ -169,7 +168,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > .bus = vms->bus, > }; > > - if (use_highmem) { > + if (vms->highmem_ecam) { highmem_ecam is more restrictive than use_highmem: vms->highmem_ecam &= vms->highmem && (!firmware_loaded || aarch64); If I remember correctly there was a problem using highmem ECAM with 32b AAVMF FW. However 5125f9cd2532 ("hw/arm/virt: Add high MMIO PCI region, 512G in size") introduced high MMIO PCI region without this constraint. So to me we should keep vms->highmem here Eric > cfg.mmio64 = memmap[VIRT_HIGH_PCIE_MMIO]; > } > > @@ -712,8 +711,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) > acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]); > acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO], > (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPORTS); > - acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), > - vms->highmem, vms->highmem_ecam, vms); > + acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), vms); > if (vms->acpi_dev) { > build_ged_aml(scope, "\\_SB."GED_DEVICE, > HOTPLUG_HANDLER(vms->acpi_dev), > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 7170aaacd5..8021d545c3 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -1362,7 +1362,7 @@ static void create_pcie(VirtMachineState *vms) > mmio_reg, base_mmio, size_mmio); > memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > /* Map high MMIO space */ > MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1); > > @@ -1416,7 +1416,7 @@ static void create_pcie(VirtMachineState *vms) > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", > 2, base_ecam, 2, size_ecam); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", > 1, FDT_PCI_RANGE_IOPORT, 2, 0, > 2, base_pio, 2, size_pio,