From patchwork Thu Nov 2 17:02:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 1858621 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=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=Ubvp/F2c; 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 4SLqwS1gQ3z1yQt for ; Fri, 3 Nov 2023 04:04:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyb5u-0002jo-GL; Thu, 02 Nov 2023 13:02:58 -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 1qyb5s-0002hm-QL for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:02:56 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyb5r-0003iW-1f for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:02:56 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5b9390d6bd3so1858337a12.0 for ; Thu, 02 Nov 2023 10:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698944572; x=1699549372; 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=0G4mli43rxQIFAxng87lycqryCrXbuE4wxOKTPRmEvA=; b=Ubvp/F2c9SJJ7eAZy/PgOJ2kRjxBEb6w/jMpRuad8kRPbhn9R+Ncg5Gi88nPzrD7UO 8wRokrKNB1bP+So1j8TjPviK4zoMf1ywtAoHQkmPPWUORGYuBxbCjsfYxd1W/A7E6eR8 2+atNM0I00xFHFcvizb4/UsKJO4faN1xwYpOYbiToASspAmcjAnmRgXnDuNgUFwQ8en9 oOCPoeodyuObSoAw2TdIOUpO+z/MBaaovprMVRPcqjEA3P9XWBiY5xLyxMWpCIhvSAnw mCOZbAgbS9SMZ5aqXvw3OQ4Q3joXOvKpYR4Hqqd4qLzyQ12H+urwCnpguzeeOsNjYlzB NVsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698944572; x=1699549372; 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=0G4mli43rxQIFAxng87lycqryCrXbuE4wxOKTPRmEvA=; b=L//Gzi1dGaGRDaig9+XCwrI9nZ38DEjIto3LJ2Di9mQcSoUNSMToqbaMbe1J9TIuCP UsdNKOSLME8qqrXXGzGQFwSVy7EaJOYI4tTMKKDXvhLFz+KNTakl+ZZXjym5iO3YA8Bd YU8Qww+S1BZRmgMvS+ezjxIqd3nLNFkDcgoEgO57Zw7w68tELnIq0oTnLGEiCqheS69i penapZyXFjgH2OXxYWJsYgYHVEtiGfST5TFOmyg+Ahh7HC6OBAqk28pQN9FEl92lV5vQ PQ8gcgID/yX/DeFhuAPtMcWCf//fqqcJJ/W5wtE9YndgYsj4djUVejSunac0dNnMJkcD K8KA== X-Gm-Message-State: AOJu0YwrzubRIt8pkXxbNC/Z3UnsqqC7cpjdQRBfnTxx6IsHMyjIK2/W Cg/ihPSK2Ylwya9uLajshrVHAw== X-Google-Smtp-Source: AGHT+IFDPWNC5rrILIRSWdY4h1ye9gTX3Wrnd0z8khSwTRflH7blhqvm/mTe4NSv8C8aiwzQfgGQag== X-Received: by 2002:a17:90a:17ca:b0:280:cc28:9d2b with SMTP id q68-20020a17090a17ca00b00280cc289d2bmr138546pja.0.1698944572412; Thu, 02 Nov 2023 10:02:52 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.188.78]) by smtp.gmail.com with ESMTPSA id 18-20020a17090a031200b0026b70d2a8a2sm25098pje.29.2023.11.02.10.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 10:02:52 -0700 (PDT) From: Sunil V L To: qemu-arm@nongnu.org, qemu-devel@nongnu.org, qemu-riscv@nongnu.org Cc: Peter Maydell , Shannon Zhao , "Michael S . Tsirkin" , Igor Mammedov , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Gerd Hoffmann , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Anup Patel , Atish Kumar Patra , Haibo Xu , Sunil V L , Andrew Jones Subject: [PATCH v6 03/13] hw/i386/acpi-microvm.c: Use common function to add virtio in DSDT Date: Thu, 2 Nov 2023 22:32:13 +0530 Message-Id: <20231102170223.2619260-4-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231102170223.2619260-1-sunilvl@ventanamicro.com> References: <20231102170223.2619260-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=sunilvl@ventanamicro.com; helo=mail-pg1-x52f.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 With common function to add virtio in DSDT created now, update microvm code also to use it instead of duplicate code. Suggested-by: Andrew Jones Signed-off-by: Sunil V L Acked-by: Alistair Francis Acked-by: Michael S. Tsirkin --- hw/i386/acpi-microvm.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index 2909a73933..279da6b4aa 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -37,6 +37,7 @@ #include "hw/pci/pci.h" #include "hw/pci/pcie_host.h" #include "hw/usb/xhci.h" +#include "hw/virtio/virtio-acpi.h" #include "hw/virtio/virtio-mmio.h" #include "hw/input/i8042.h" @@ -77,19 +78,7 @@ static void acpi_dsdt_add_virtio(Aml *scope, uint32_t irq = mms->virtio_irq_base + index; hwaddr base = VIRTIO_MMIO_BASE + index * 512; hwaddr size = 512; - - Aml *dev = aml_device("VR%02u", (unsigned)index); - aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005"))); - aml_append(dev, aml_name_decl("_UID", aml_int(index))); - aml_append(dev, aml_name_decl("_CCA", aml_int(1))); - - Aml *crs = aml_resource_template(); - aml_append(crs, aml_memory32_fixed(base, size, AML_READ_WRITE)); - aml_append(crs, - aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH, - AML_EXCLUSIVE, &irq, 1)); - aml_append(dev, aml_name_decl("_CRS", crs)); - aml_append(scope, dev); + virtio_acpi_dsdt_add(scope, base, size, irq, index, 1); } } }