From patchwork Thu Oct 12 12:18:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 732474 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp917693wrv; Thu, 12 Oct 2023 05:22:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGf5SzmRQU71MJ3ThlnTkZsWkarvzHtY9uxdKekqtDhvrz0Dv2N4veRwdxErmcw3H4y5qJ X-Received: by 2002:a81:6e88:0:b0:5a2:15bc:b32c with SMTP id j130-20020a816e88000000b005a215bcb32cmr26174677ywc.42.1697113330217; Thu, 12 Oct 2023 05:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697113330; cv=none; d=google.com; s=arc-20160816; b=cxY9lBXR348lveq5zb504+MlrMYHd5GqfUCCV843UM5RNBGEo2lk1X66LXHKKsea5k w1cd0tDFH5+UEPq407/6apWjg48un6TXo6SZhNjhtjduz0RGToNwIIt1gv5YPObzNSDU cFUUZPxsL7+S5hkqSk2f0L2gbGuwb13xwQqORqPqohkiteHFaUigcgyEWbUQ0K/dafxS gB77h8hiElbBEmxqT4otqtjcnLE058uAzvfio3zUJyP46RBwv0s14lNDewxbcsNWbkzg DG30ysMflmti21p/hqYPrXlF99C0TzzsGPFc5+bEGkzcGadMVnqE52lQFpxwkg0sgU3+ h49Q== 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 :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=x9j0wB4sagFap8UlCk3DGG3Emv5eeF0Xy9DDluHlDSM=; fh=uMYo3jOuXUsDthaXCE4/M6n3+voY5rtHQA7Grzg1cYU=; b=cyvhPEij1gYD2Qa98gMw5ELTXvobO5rrLUJWXDRNM56Ap6dxrsCsYlCmd7fvRojyFg qCqtjnu0KHAQqg2V2NrsPTU+7H3BrQA71kWoVo01/6IR0X7s7fnYrI1ylO22TbRDf6uV L/n9VDdV9lONOO6kEStvHHjFibYUznPKIj/9mFS/y9L9i59kBOEDThMWUKfwoKl/0ESJ 4zyWcQpq/HfRYBnL9n4wadS/9B5wUB5DZhdgjQtt/MHGRcdTj37mYse9fQwv9IG/Ob2a 6eM2vOYeJKLx2ALLLzKzsn3fOMRhwhtKLag0XttZrDm9RG/U2FFcoN33a/Dj+rwwL4nM K1ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Op3YQS6i; 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=pass (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 v12-20020a05620a0f0c00b00774373352b5si11364077qkl.769.2023.10.12.05.22.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2023 05:22:10 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=Op3YQS6i; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qquey-0002uE-Rk; Thu, 12 Oct 2023 08:19:24 -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 1qquex-0002si-Tc for qemu-devel@nongnu.org; Thu, 12 Oct 2023 08:19:23 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qquew-0001ob-BQ for qemu-devel@nongnu.org; Thu, 12 Oct 2023 08:19:23 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-99357737980so148430666b.2 for ; Thu, 12 Oct 2023 05:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697113160; x=1697717960; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x9j0wB4sagFap8UlCk3DGG3Emv5eeF0Xy9DDluHlDSM=; b=Op3YQS6ii/w+7k2SJnNHXrk/kAAJsSBVqntkgWO0CFTlGNUQT0P9OEIEy/6SO3hkht w4ywhxzzwqHrNXTSw97p10oxyAFjVjEuq8LLIU6+V/26THL0nGcetp8Btu2w5kCUYhfs JXqqeEeVpIBnjXI/7Bl07CfUEz6nglBWbGes11tLaHDhnqZZtx0N4RFX57G9r9PUAOZr kuIQ1WRMOOeGsM+0C6zN0BZBnbP14/jtO4n7aw9gv4eRIk1NN1nmpx+7w8eVKLnLP2/8 2m/CsuRMInH3mzUZwjB0GOK2rZJNl1A35aFQ6rqMjwbRs7+u10vysecr5dnvOPlOle7Q j1JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697113160; x=1697717960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x9j0wB4sagFap8UlCk3DGG3Emv5eeF0Xy9DDluHlDSM=; b=SPjhFyzHuON6/SlwqpSuo7bEFFYSuhn8Oist28JzLjfshvEq+Z8POhgOWJzimJjyPG R7hCjjvrRnubs3dv5DIPdWpA3jyiyiTK29M1cfi2JxA+S8tqyjX7Jv3Ja9TNONWnFSHJ oYV2S0kfS6HlZvOMxeFyWzQP4Ipwd3fxb1CBNhmMPjYLFZcWiwHU7/8cnTi99mFfKfRd pyXdOEW6JYu4ZjIO+sZxxvCWEyIfy8FWoz3G9hmw+YXNGi9V8kOndmgNMEknh8wxv7c6 wvViizPjMjZSX1gRxL54c6zFEB3FlNrsqn/vydtzh/73cAXUHSc4Ihd4yTjrsP7wuUPB Ey1g== X-Gm-Message-State: AOJu0Yztuuf94OehB+WE9sOpTUEs776xtOs3MUVTqJ3Gfscx3+iO5z5V gRCJoddX6DM7PWy66NWpORl8wIX4pqA3X9xy4vJRug== X-Received: by 2002:a17:906:3288:b0:9a1:fb4c:3b6c with SMTP id 8-20020a170906328800b009a1fb4c3b6cmr21893209ejw.59.1697113160687; Thu, 12 Oct 2023 05:19:20 -0700 (PDT) Received: from m1x-phil.lan (176-131-211-232.abo.bbox.fr. [176.131.211.232]) by smtp.gmail.com with ESMTPSA id f23-20020a170906139700b0098f99048053sm11226132ejc.148.2023.10.12.05.19.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 12 Oct 2023 05:19:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Andrey Smirnov , qemu-arm@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 3/8] hw/pci-host/designware: Add 'host_mem' variable for clarity Date: Thu, 12 Oct 2023 14:18:51 +0200 Message-ID: <20231012121857.31873-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231012121857.31873-1-philmd@linaro.org> References: <20231012121857.31873-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.google.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, 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=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org designware_pcie_root_realize() uses get_system_memory() as the "host side memory region", as opposed to the "PCI side" one. Introduce the 'host_mem' variable for clarity. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Gustavo Romero --- hw/pci-host/designware.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index 692e0731cd..bacb2bdb2d 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -393,6 +393,7 @@ static void designware_pcie_root_realize(PCIDevice *dev, Error **errp) { DesignwarePCIERoot *root = DESIGNWARE_PCIE_ROOT(dev); DesignwarePCIEHost *host = designware_pcie_root_to_host(root); + MemoryRegion *host_mem = get_system_memory(); MemoryRegion *address_space = &host->pci.memory; PCIBridge *br = PCI_BRIDGE(dev); DesignwarePCIEViewport *viewport; @@ -433,7 +434,7 @@ static void designware_pcie_root_realize(PCIDevice *dev, Error **errp) viewport->cr[0] = DESIGNWARE_PCIE_ATU_TYPE_MEM; source = &host->pci.address_space_root; - destination = get_system_memory(); + destination = host_mem; direction = "Inbound"; /* @@ -458,7 +459,7 @@ static void designware_pcie_root_realize(PCIDevice *dev, Error **errp) destination = &host->pci.memory; direction = "Outbound"; - source = get_system_memory(); + source = host_mem; /* * Configure MemoryRegion implementing CPU -> PCI memory