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: 1903019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=iv50Vm8Z; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TgnmX6wxGz23d2 for ; Fri, 23 Feb 2024 09:26:20 +1100 (AEDT) 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-Google-Smtp-Source: AGHT+IF6WHTLqjO8wD41svY+GPvvNrqoH+RkTQt4RKYpbj+vqdRJvLt2zAavEvaGPZyYCG776QzMuA== 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.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