From patchwork Thu Feb 22 22:22:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 774922 Delivered-To: patch@linaro.org Received: by 2002:adf:a356:0:b0:33b:4db1:f5b3 with SMTP id d22csp77015wrb; Thu, 22 Feb 2024 14:26:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCViFz5TrCVNBPjgP1mso4tkbt5KvS4ZFbascydZE08cr6WsY/oc6tpJXrG1IYie8y41s2yixRbqmknIqTYuAp8D X-Google-Smtp-Source: AGHT+IFE5ZeLEU8k4CXnYCDRA8NhYXmBCmJL+2VUlT11IyqCRt7ejCNYoaelT7rIJuShWsUYGjXT X-Received: by 2002:a0c:f310:0:b0:68d:1347:77dc with SMTP id j16-20020a0cf310000000b0068d134777dcmr405469qvl.65.1708640779731; Thu, 22 Feb 2024 14:26:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708640779; cv=none; d=google.com; s=arc-20160816; b=UXs6wTtACeUBDgS0kvu8691MucAVvoPbFe3BBqFjDfvEk1g98dQDvt1vAwLEf3pHYo D27cnBqTZfuyPxI0atmrJ5COYJ+uAL0xM/TBrAbIUNf1ift8ZvfdwVYK5mTeQ5UEAiX0 RvGEm1t2OrWCMJF+WdU4FUWRGJhPmCNvOQoEh0cR1yv9kBuWQ05HwD9Epy45pJih5Ufo iBiD+rL3wHpmaRIqyM2BSum2qoTWu1qxi0Xihd0JpD6gnmAPsezhD1iJhgEUAsUtR/Nh crCONGcJxwz6fRoNDQuZ9tFvzGta7lyE30Yq1zo7FSjqZd09um6kI0VQlgAGI5tuEmpq ixdg== 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=Q9UcYHsblrSFfrXQA46NbgNay0fShjw8qDCj70T3uHM=; fh=FwJ41ag6ReWcl5sLmX4YL9yVV2DrcCZ6yOxRDQfQdJE=; b=TtY2B9Pnquxd18Je7oF2bGfFc23VcgDCmi56QeNHvtI96JKxQaiic0U7FumdBBjuE0 Ye/l/zyiSQR2/36dUbuFofUN4Dh4fbAI/gM1vFXGlCbBx+TQ3tu5LxoPgciOraiYmo/9 jzvxq8DKgWvNPECWAoRnFToa3vlk/FeIeRAmkVO9bSx9lEEtAeW3yaklwipu9ZqTaxUU MuTW8AgYemnl99XufBuip+NOEecI51J8BxDjwXoHzaC4j9i5WEtHZWxt4TYwvYWNrwsd 4GDqCWwCbn24uUNYxZzZJ/y0EKxhXwcwjnBk+jIv8u5nE5tyngqux6mx6sB7geVic/YM Sjww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iv50Vm8Z; 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 a4-20020ad45c44000000b0068f34f52833si15221080qva.107.2024.02.22.14.26.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Feb 2024 14:26:19 -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=pass header.i=@linaro.org header.s=google header.b=iv50Vm8Z; 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 1rdHUW-0002ds-3u; Thu, 22 Feb 2024 17:24:32 -0500 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 1rdHUV-0002bl-0s for qemu-devel@nongnu.org; Thu, 22 Feb 2024 17:24:31 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdHUS-0003BC-CX for qemu-devel@nongnu.org; Thu, 22 Feb 2024 17:24:29 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1dc29f1956cso1288065ad.0 for ; Thu, 22 Feb 2024 14:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708640667; x=1709245467; 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=Q9UcYHsblrSFfrXQA46NbgNay0fShjw8qDCj70T3uHM=; b=iv50Vm8ZwkMM6CAkwpkBEwGpswYsH81/7OMPUZfuChJ7fobHzKjwTPCvD042+PfJKI HY/8o7hZEZkM+GtB3TEu+nQYdhapXT5je6M5IMj/yMhkVzjjyB4NoSpt0sN0h0SrsBfh 0kcRaoerOb4IDlYIIrtuLs4KHo5DwJ6fxnoLpRHh8rDlrurM1equg7qsvT3bC+va6Vnz PNtd/VxQLs0CLr65k76+leW2AMoHMUp6PDJRf4QZp3Bo88DbQG+JADx0T3cMGCmwO1/E fW/l7sNB5zmi+WJ1Hq6lWGf5ztFSI2eqaMiDB7D4L1Odfd1LG8QUD+DR+nN7LbfslpD8 RazQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708640667; x=1709245467; 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=Q9UcYHsblrSFfrXQA46NbgNay0fShjw8qDCj70T3uHM=; b=F1W16F+FcvMcoqB67lHwHQnpiMwNywlifQ9wvkkeAo+e+X0J93RilpH5imLxwU287I yXtFjuGhZADIuwsVEaYjT0VbRSq2DgNB2LeYtuyPgxtc2HG+j5dF2xU62M2pZUxymExw /37B1HhsuBJmTo83AF6wzgTvgkRJ0wvjPeDjwu3eWAkiAP+Oh7qGhA3ZZOPvyb2jyim6 ochxZ0IQGTScenFhAurqKIz+/1KLpEefz4+m8k55FIuGUITPHt2vAEF+T/DiaR2erHAz WERN6p9xHNU9EdikcAELGlPDGzx2iEo4fcXrSE/h/CnI90u+X0dhsDUFJg1Ymrq302JF WXxw== X-Gm-Message-State: AOJu0YzzA48njuV1sgiPUhZ2QYqiWAHxyiiI0LbJn9pFYlWzMYcdZ1ax ANntkYOZGzlbqBdw0NrSNPT2phHX9qCHDo6giVfoa0LWjCjZZ4lMywP7x+mMIz875OCEnvEtIT/ 44G0= X-Received: by 2002:a17:902:7895:b0:1dc:139:8488 with SMTP id q21-20020a170902789500b001dc01398488mr199012pll.5.1708640666890; Thu, 22 Feb 2024 14:24:26 -0800 (PST) Received: from amd.. ([2804:7f0:b400:285a:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id ji7-20020a170903324700b001d7057c2fbasm10457210plb.100.2024.02.22.14.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:24:26 -0800 (PST) From: Gustavo Romero To: qemu-devel@nongnu.org, philmd@linaro.org Cc: thuth@redhat.com, lvivier@redhat.com, qemu-arm@nongnu.org, alex.bennee@linaro.org, pbonzini@redhat.com, anton.kochkov@proton.me, richard.henderson@linaro.org, peter.maydell@linaro.org, gustavo.romero@linaro.org Subject: [PATCH 3/6] hw/arm: Allow some machines to use the ivshmem-flat device Date: Thu, 22 Feb 2024 22:22:15 +0000 Message-Id: <20240222222218.2261956-4-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222222218.2261956-1-gustavo.romero@linaro.org> References: <20240222222218.2261956-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=gustavo.romero@linaro.org; helo=mail-pl1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Allow Arm machine lm3s6965evb and the mps2 ones, like the mps2-an385, to use the ivshmem-flat device. Message-ID: <20231127052024.435743-2-gustavo.romero@linaro.org> Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gustavo Romero --- hw/arm/mps2.c | 3 +++ hw/arm/stellaris.c | 3 +++ hw/arm/virt.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index 50919ee46d..fe158dfbc0 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -42,6 +42,7 @@ #include "hw/timer/cmsdk-apb-dualtimer.h" #include "hw/misc/mps2-scc.h" #include "hw/misc/mps2-fpgaio.h" +#include "hw/misc/ivshmem-flat.h" #include "hw/ssi/pl022.h" #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/net/lan9118.h" @@ -472,6 +473,8 @@ static void mps2_class_init(ObjectClass *oc, void *data) mc->max_cpus = 1; mc->default_ram_size = 16 * MiB; mc->default_ram_id = "mps.ram"; + + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_IVSHMEM_FLAT); } static void mps2_an385_class_init(ObjectClass *oc, void *data) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index a2f998bf9e..e25858f232 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -28,6 +28,7 @@ #include "hw/watchdog/cmsdk-apb-watchdog.h" #include "migration/vmstate.h" #include "hw/misc/unimp.h" +#include "hw/misc/ivshmem-flat.h" #include "hw/timer/stellaris-gptm.h" #include "hw/qdev-clock.h" #include "qom/object.h" @@ -1404,6 +1405,8 @@ static void lm3s6965evb_class_init(ObjectClass *oc, void *data) mc->init = lm3s6965evb_init; mc->ignore_memory_transaction_failures = true; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m3"); + + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_IVSHMEM_FLAT); } static const TypeInfo lm3s6965evb_type = { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0af1943697..6c0917f3b2 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -84,6 +84,7 @@ #include "hw/virtio/virtio-iommu.h" #include "hw/char/pl011.h" #include "qemu/guest-random.h" +#include "hw/misc/ivshmem-flat.h" #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ @@ -2973,6 +2974,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_AMD_XGBE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_PLATFORM); + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_IVSHMEM_FLAT); #ifdef CONFIG_TPM machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); #endif