From patchwork Sat Feb 4 15:10:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13128745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7B50C61DA4 for ; Sat, 4 Feb 2023 15:12:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKBx-0002OK-Uu; Sat, 04 Feb 2023 10:11:02 -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 1pOKBv-0002NS-Ji; Sat, 04 Feb 2023 10:10:59 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOKBt-0006a1-S8; Sat, 04 Feb 2023 10:10:59 -0500 Received: by mail-ej1-x630.google.com with SMTP id dr8so22831222ejc.12; Sat, 04 Feb 2023 07:10:57 -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=EfmMdCHz+Fhltt6YfTaJbRbrlBRK7jA6WLfOJqml/3o=; b=eNaXTzLgKJsYzN9zpLA0l3RTGY5gIYeyG0JDFd8eSxZMtmjjNL2RquNP0+WSb3+tiC tuZrvLQkSTLwjcgmVoIAuif/ASIMoerjt3u6FjZjqK7+vjXjA8m2xGG9i3DOeD7dg8ho PmqkFt/Emnv6gEFRTVHSfmWzNpq+LsW8+mk75gipGnW0JCiHN7IpZ41850yMdJPCI5GK xgaZ1xn5HKG+9sqQZ9D8KqLlBIdFStNA1zxSVfJIAdg5VXTn8Y6RDpjcBi8MVlf5aG7r kj5jF4aI8Xbw1OEgQXzmNe7jH2OO4t7NJ/s9qrvPOz8jS/PTPL/4pMdkSF77p9m3EafZ 5VAw== 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=EfmMdCHz+Fhltt6YfTaJbRbrlBRK7jA6WLfOJqml/3o=; b=Ed+tWxhKC2OMcI06LiG/pf9IbYjECGJ6ZVp/P/AwSfY2Z5d6xKfhETCrp6PUi4LX6t ird5Bnjro7cIPCX8cxUdCPgs5wwWgGSPpVt0P0TiWb0bbTer2QGa7VZbRVI7Dhs1JaEQ eGeGc1IYcZtElktl4JmyoSn09/743NH+TgnuGleVz7zUfA6X1BNWIUqClddLnFxvsRK0 oFnhLc1HXyackwD1bkcwLdbVVXrBwxdQTP2eaGeobOUnsFexYmf3OwHV4eoGB1BckbcA Oyh6xBl3YNwIKhs25ebmNGRHwxftNlQBTBruSfYk8meZGkHuUmqPkZcQ9TTlu7JZiViO AN2Q== X-Gm-Message-State: AO0yUKUUq62CiNDDC31H2QEyv8ME2pnQiyAIRIOtvapv21iyH6BlSfhW jQT0E4HFR5SkUGCB6qx/NbrjbHQhEu8= X-Google-Smtp-Source: AK7set+ARqWwQbRVk8DA5O5aHkUkYVLQ3MFi6x4JOlpACJjgCpRlyrd13UMPIVTG9G5cZf8kttrOJg== X-Received: by 2002:a17:907:8e93:b0:888:a06f:104b with SMTP id tx19-20020a1709078e9300b00888a06f104bmr15905424ejc.36.1675523455272; Sat, 04 Feb 2023 07:10:55 -0800 (PST) Received: from localhost.localdomain (dynamic-077-183-077-083.77.183.pool.telefonica.de. [77.183.77.83]) by smtp.gmail.com with ESMTPSA id 17-20020a170906211100b0088a2aebb146sm2937922ejt.52.2023.02.04.07.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:10:54 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org, BALATON Zoltan , Laurent Vivier , Sunil Muthuswamy , Marcel Apfelbaum , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 0/9] PC cleanups Date: Sat, 4 Feb 2023 16:10:18 +0100 Message-Id: <20230204151027.39007-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::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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. One notable change is that the SMRAM memory region gets moved from the i440fx and q35 host bridges into the x86 machine. This will simplify cleaning up these host bridges which will be done in a separate series. 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` v3: * Add three patches regarding init_pam() and SMRAM. * Drop 'hw/i386/pc_q35: Resolve redundant q35_host variable' since Phil posted a similar patch in a more comprehensive series: https://lore.kernel.org/qemu-devel/20230203180914.49112-13-philmd@linaro.org/ * Drop 'hw/isa/lpc_ich9: Reuse memory and io address space of PCI bus' since it inadvertantly changed the memory hierarchy. * Drop ICH9 cleanups again in favor of a separate series. 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 (9): 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,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/pci-host/pam: Make init_pam() usage more readable hw/i386/x86: Make TYPE_X86_MACHINE the owner of smram target/i386/tcg/sysemu/tcg-cpu: Avoid own opinion about smram size include/hw/i386/pc.h | 1 - include/hw/i386/x86.h | 2 ++ include/hw/pci-host/i440fx.h | 7 ++++--- include/hw/pci-host/pam.h | 5 +++-- include/hw/pci-host/q35.h | 4 +++- hw/i386/pc.c | 2 -- hw/i386/pc_piix.c | 10 +++++----- hw/i386/pc_q35.c | 16 +++++++++------- hw/i386/x86.c | 4 ++++ hw/pci-host/i440fx.c | 28 +++++++++++++--------------- hw/pci-host/pam.c | 12 ++++++------ hw/pci-host/q35.c | 31 ++++++++++++++++--------------- target/i386/tcg/sysemu/tcg-cpu.c | 3 +-- 13 files changed, 66 insertions(+), 59 deletions(-)