From patchwork Tue Jan 31 11:53:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1734805 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=20210112 header.b=hS8u0yfN; 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 4P5k6v2d1vz23gY for ; Tue, 31 Jan 2023 22:56:55 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMpD0-00060V-IM; Tue, 31 Jan 2023 06:53:54 -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 1pMpCz-0005zY-5D; Tue, 31 Jan 2023 06:53:53 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMpCx-0002Kb-EP; Tue, 31 Jan 2023 06:53:52 -0500 Received: by mail-ed1-x533.google.com with SMTP id u21so14134834edv.3; Tue, 31 Jan 2023 03:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CV6DbXQ4WiiwIhud5+egk51JZFhVFpinyxfLOWtC5KM=; b=hS8u0yfNSODGlbdvvokhCmm/RqOiimQhtAoUhvVGqbQm3KoOXgJa51iyM7bmipVkfu ep7HU8wEHg/Rntbcm68h/ElmFCCKtVUTgy1tbqH6TcqnmBkvAGhX5HriJPBgGpZs6nbG NqTgoDZApLH3fYhz0qbgC7ox/PtI/4uPN8EKHlTrtNXPqQItfY2ad8TdoMMazVIoN75F gOj0oDG5EbnPqGpqWQDD7C7hXPVgUlxFG+EKIbuH36WJdcOTzSkLugL9ze3hZqfWkHZz tb6NNsq+axEtWqdlijfBK7cR73EY51wdEKOM/p6TSalfQAt+HGm9H/NYrZ9azUZ5Gugr +1iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=CV6DbXQ4WiiwIhud5+egk51JZFhVFpinyxfLOWtC5KM=; b=fGQn9Iqv+Hhdw8dpfb5NmDQVqKX0Llo46/cmuhrBRtl2+qzB4RI65P/MN7D4OnNCNF cMZgmt4TqM5ZzbhCsr4E2fqpNxP0mhJoZqddK5zFHXKyjcgNy32hjQ0IuZhmMzkyeGbm 32jpjjA1wJG+0RrDXoDs95sOT15aRtBBzrnjy8rumhfkSbnG7waK2teDqO//WG8fCwuE cJPz1W/mjl72UBY0X6a7o+R1oB5h8+IyvIpihrgj9WMuluji+AAgnCJ7oJnVOmRY76k/ T+VJ2589lup7GUPJsVVVkUiyz8JL8A5ays++aVRxj08ww6+Norv2Pctea3EvE6JuzNaM nUbA== X-Gm-Message-State: AO0yUKV97XEJ2qzogb+Hu29ErsOsm5eJHp/oTJ0WjLjFnwJwADIQR6L0 wjNMqaRV1eTKY6izOjSsQwoiOC2Nl/s= X-Google-Smtp-Source: AK7set86H77md3MaSm7rxmA8WKmVJT0h9YguovCyd7ctlnbIl+wB7Y47v5WlWjJbzZhnCFBdaYZMug== X-Received: by 2002:a05:6402:35d2:b0:4a2:3612:40c with SMTP id z18-20020a05640235d200b004a23612040cmr13076866edc.10.1675166029016; Tue, 31 Jan 2023 03:53:49 -0800 (PST) Received: from localhost.localdomain (dynamic-077-013-082-236.77.13.pool.telefonica.de. [77.13.82.236]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b00483dd234ac6sm8178318edu.96.2023.01.31.03.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 03:53:48 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Igor Mammedov , Richard Henderson , Ani Sinha , "Michael S. Tsirkin" , Paolo Bonzini , BALATON Zoltan , Thomas Huth , Marcel Apfelbaum , Eduardo Habkost , Laurent Vivier , Sunil Muthuswamy , qemu-trivial@nongnu.org, Bernhard Beschow Subject: [PATCH v2 00/20] PC and ICH9 cleanups Date: Tue, 31 Jan 2023 12:53:06 +0100 Message-Id: <20230131115326.12454-1-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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 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 contains some cleanups I came across when working on the PC machines. It consists of reducing the usage of global variables and eliminating some redundancies. The ICH9 cleanups include further QOM'ification, making it more self-contained, and reducing its x86/pc dependencies. Testing done: * `make check` ' `make check-avocado` * `qemu-system-x86_64 -M q35 -m 2G -cdrom \ manjaro-kde-21.3.2-220704-linux515.iso` * `qemu-system-x86_64 -M pc -m 2G -cdrom manjaro-kde-21.3.2-220704-linux515.iso` v2: * Factor out 'hw/i386/pc_q35: Reuse machine parameter' from 'hw/i386/pc_q35: Resolve redundant q35_host variable' (Zoltan) * Lower type of phb to Object in 'hw/i386/pc_q35: Resolve redundant q35_host variable' (Zoltan) * Add ICH9 cleanups Bernhard Beschow (20): hw/pci-host/i440fx: Inline sysbus_add_io() hw/pci-host/q35: Inline sysbus_add_io() hw/i386/pc_q35: Reuse machine parameter hw/i386/pc_q35: Resolve redundant q35_host variable hw/i386/pc_{q35,piix}: Reuse MachineClass::desc as SMB product name hw/i386/pc_{q35,piix}: Minimize usage of get_system_memory() hw/i386/pc: Initialize ram_memory variable directly hw/i386/ich9: Rename Q35_MASK to ICH9_MASK hw/isa/lpc_ich9: Unexport PIRQ functions hw/isa/lpc_ich9: Eliminate ICH9LPCState::isa_bus hw/isa/lpc_ich9: Reuse memory and io address space of PCI bus hw/i2c/smbus_ich9: Move ich9_smb_set_irq() in front of ich9_smbus_realize() hw/i2c/smbus_ich9: Inline ich9_smb_init() and remove it hw/i386/pc_q35: Allow for setting properties before realizing TYPE_ICH9_LPC_DEVICE hw/isa/lpc_ich9: Connect pm stuff to lpc internally hw/isa/lpc_ich9: Remove redundant ich9_lpc_reset() invocation hw/i386/ich9: Remove redundant GSI_NUM_PINS hw: Move ioapic*.h to intc/ hw/i386/ich9: Clean up includes hw: Move ich9.h to southbridge/ MAINTAINERS | 2 + include/hw/acpi/ich9.h | 6 +- include/hw/i386/pc.h | 1 - include/hw/i386/x86.h | 3 +- include/hw/{i386 => intc}/ioapic.h | 6 +- include/hw/{i386 => intc}/ioapic_internal.h | 8 +-- include/hw/{i386 => southbridge}/ich9.h | 35 ++++------ hw/acpi/ich9.c | 10 +-- hw/acpi/ich9_tco.c | 2 +- hw/i2c/smbus_ich9.c | 39 +++++------ hw/i386/acpi-build.c | 3 +- hw/i386/kvm/ioapic.c | 3 +- hw/i386/pc.c | 8 +-- hw/i386/pc_piix.c | 8 +-- hw/i386/pc_q35.c | 73 ++++++++++----------- hw/intc/apic.c | 2 +- hw/intc/ioapic.c | 4 +- hw/intc/ioapic_common.c | 4 +- hw/isa/lpc_ich9.c | 40 +++++------ hw/pci-bridge/i82801b11.c | 2 +- hw/pci-host/i440fx.c | 5 +- hw/pci-host/q35.c | 6 +- target/i386/whpx/whpx-all.c | 2 +- tests/qtest/tco-test.c | 2 +- 24 files changed, 127 insertions(+), 147 deletions(-) rename include/hw/{i386 => intc}/ioapic.h (93%) rename include/hw/{i386 => intc}/ioapic_internal.h (96%) rename include/hw/{i386 => southbridge}/ich9.h (91%)