From patchwork Fri Jun 30 07:37:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1801712 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=kSFWqNra; dkim-atps=neutral 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 4QsnHW03YRz20XS for ; Fri, 30 Jun 2023 17:38:31 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qF8hC-000228-PF; Fri, 30 Jun 2023 03:37:34 -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 1qF8hA-00021f-Cq for qemu-devel@nongnu.org; Fri, 30 Jun 2023 03:37:32 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450: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 1qF8h8-0005Ov-FF for qemu-devel@nongnu.org; Fri, 30 Jun 2023 03:37:31 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-992f6d7c7fbso7509166b.3 for ; Fri, 30 Jun 2023 00:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688110648; x=1690702648; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Gx+NjmcFBvSAtRPV3rw42EgP3SfyA5VZE1XABQlh2QY=; b=kSFWqNraloBBDcupbq+eO4ser1ZXEJfsHbNmY0cFSF+TkOypou66knaamtBo8Qnm0o uPnUsNSVE79zEcnuTZPkDjB8KPkjh/opi7fg4U17porinhhFMYWQ1Fmo1OvhgbDbHlsP 1txQPuOUskpr0z5mqX5TfJcPulLWzhqYrgjtw/AKC4Nufa+JK3pAdPr7izhxzzOY1RQl F+J7pWvN14eIlhlPy7ME0UtEL0hlXXm6bAmomeXh67MZ5bsyiYPa9olHBf297VpmUgMa aHbj2YVEP6h4zQkU/Efh6XX4AP7NhF4nGo++x3kmjnjfyi9XstH9L0MdZjNtpDHzHoHp Qk3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688110648; x=1690702648; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gx+NjmcFBvSAtRPV3rw42EgP3SfyA5VZE1XABQlh2QY=; b=jwk+cW3pI/JNwEsGnSc3POJk4b/n/WZ7u8FjzD6IgCgaLiGq3+9SHzpcMfRxIfh+Nh E0l8DKfC3XZi88gnZn5rw9MiWfcxUI1gHg6UjtJxsY4XVUNOCaklPom1UNoyGaZlILMz +pcJycHEt+Ws9QkY2c0VdjnTJ4otULYY0vuq1t9bIn5nIlRiwJzG174c9TxXic27IASM 5WrReb+DA6LwhQBY3NWoQfiJSgvCFohfqwoXNAPXBncmY8SujYnzzBoQnplTj4fZNXSK GdL28GS+8VH7GsNYobTH0LoN0QSvQKlqNkAfG9DGylQ7hbpNlQstFJb7EEHk4I01T88J vo0w== X-Gm-Message-State: ABy/qLZwMKruSldmohORYw/KppfUYD/UxbASeT2LrwzpMOs7VcZgm/d5 RlKKJD5w+StQTTw6edmbILgIxD7tjX4= X-Google-Smtp-Source: APBJJlHSKS/Cd79AE16vYzlYeD9Pex9oTqxTfnQikgZ5szsXPTnxb8BNfZovuZK20J1baeK7b40QOw== X-Received: by 2002:a17:906:f884:b0:988:9621:d85f with SMTP id lg4-20020a170906f88400b009889621d85fmr1190132ejb.58.1688110648228; Fri, 30 Jun 2023 00:37:28 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-131-254.89.12.pool.telefonica.de. [89.12.131.254]) by smtp.gmail.com with ESMTPSA id k19-20020a1709061c1300b00988b32160dfsm7625578ejg.222.2023.06.30.00.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 00:37:27 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , Marcel Apfelbaum , Eduardo Habkost , Paolo Bonzini , "Michael S. Tsirkin" , Bernhard Beschow Subject: [PATCH v3 00/17] Q35 and I440FX host bridge QOM cleanup Date: Fri, 30 Jun 2023 09:37:03 +0200 Message-ID: <20230630073720.21297-1-shentey@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=shentey@gmail.com; helo=mail-ej1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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 This series resolves the legacy i440fx_init() function and instantiates the I440FX host bridge the QOM way. As a preparation the Q35 host bridge receives some cleanup as well. Most of the Q35 patches have been submitted under [1] before. This series incorporates only the changes making the two device models consistent with each other. The original plan of [1] was to clean up Q35 first and then submit a separate follow-up I440FX QOM'ification series. This series takes a more direct approach by cutting down on the changes in both device models while still allowing both device models to be instantiated the same way. The remaining patches in [1] would still be doable. The series is structured as follows: The first 5 patches clean up Q35, the next patch massages Q35 to share its property names with I440FX. The rest of the series resolves i440fx_init(). Tesging done: * `make check` * `make check-avocado` * Run `xl create` under Xen with the following config: name = "Manjaro" type = 'hvm' memory = 1536 apic = 1 usb = 1 disk = [ "file:manjaro-kde-21.2.6-220416-linux515.iso,hdc:cdrom,r" ] device_model_override = "/usr/bin/qemu-system-x86_64" vga = "stdvga" sdl = 1 v3: * Establish i440fx' parent-child relation earlier (Phil) * Rename i440fx_host -> phb earlier to avoid some churn in last patch v2: * Rename `address_space_io` to `io_memory` (Phil) * Eliminate one else branch in pc_piix (Igor) * Make Q35's blackhole_ops DEVICE_LITTLE_ENDIAN again (Igor) * Possibly ongoing discussion regarding bringing together i440fx new and realize [1] https://patchew.org/QEMU/20230304152648.103749-1-shentey@gmail.com/ Bernhard Beschow (17): hw/i386/pc_q35: Resolve redundant q35_host variable hw/pci-host/q35: Fix double, contradicting .endianness assignment hw/pci-host/q35: Initialize PCMachineState::bus in board code hw/pci/pci_host: Introduce PCI_HOST_BYPASS_IOMMU macro hw/pci-host/q35: Initialize PCI_HOST_BYPASS_IOMMU property from board code hw/pci-host/q35: Make some property name macros reusable by i440fx hw/i386/pc_piix: Turn some local variables into initializers hw/pci-host/i440fx: Add "i440fx" child property in board code hw/pci-host/i440fx: Replace magic values by existing constants hw/pci-host/i440fx: Have common names for some local variables hw/pci-host/i440fx: Move i440fx_realize() into PCII440FXState section hw/pci-host/i440fx: Make MemoryRegion pointers accessible as properties hw/pci-host/i440fx: Add PCI_HOST_PROP_IO_MEM property hw/pci-host/i440fx: Add PCI_HOST_{ABOVE, BELOW}_4G_MEM_SIZE properties hw/pci-host/i440fx: Add I440FX_HOST_PROP_PCI_TYPE property hw/pci-host/i440fx: Resolve i440fx_init() hw/i386/pc_piix: Move i440fx' realize near its qdev_new() include/hw/i386/pc.h | 4 ++ include/hw/pci-host/i440fx.h | 16 +---- include/hw/pci-host/q35.h | 5 -- include/hw/pci/pci_host.h | 2 + hw/i386/pc_piix.c | 59 +++++++++------- hw/i386/pc_q35.c | 31 +++++---- hw/pci-host/i440fx.c | 128 +++++++++++++++++++---------------- hw/pci-host/q35.c | 13 ++-- hw/pci/pci_host.c | 2 +- 9 files changed, 135 insertions(+), 125 deletions(-)