From nobody Thu Sep 19 01:58:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1709492118; cv=none; d=zohomail.com; s=zohoarc; b=A5r2BmKY9wpQV1N7ann6Ma0Pbn3ohyuf33jUSYhtiHBnwJx/j/6KyErwLs+22+M0t9EJarQNIzMxPvMieSVio9BAEExxdGE06QpOrFc+EbzgeNPoc5UyV1cVuOryXmMHgQf7LutTZ4lVugGP3yMVbKm+na+JfFa971xytX8m+BQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709492118; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XUX7oIApRf9quDNJaxBX4ag31s8+YagalHAQ+nw7IxU=; b=YF4zxnr1CHaStiDCn6/x32KA/Aazi/GynIUtbypRWYcczogxyrger5YLl4M8PRBdqZlcWSbZVoxAWoBQiDfsFTW2fwgS2WwGErye9l9vxXCnAgQVwfiDrraCKkJqK14HFdQdAU/x5vo7FMMCPitniV6mAXdDifl61C5EE+UEtBY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709492118024448.0671825144856; Sun, 3 Mar 2024 10:55:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgqyG-0002yx-LB; Sun, 03 Mar 2024 13:54:00 -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 1rgqyB-0002xt-0f for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:55 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgqy7-0003yQ-UA for qemu-devel@nongnu.org; Sun, 03 Mar 2024 13:53:53 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-412e2dfa58eso1419405e9.0 for ; Sun, 03 Mar 2024 10:53:51 -0800 (PST) Received: from archlinux.. (dynamic-092-224-118-014.92.224.pool.telefonica.de. [92.224.118.14]) by smtp.gmail.com with ESMTPSA id o17-20020a05600c4fd100b00412d68dbf75sm5259460wmq.35.2024.03.03.10.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 10:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709492029; x=1710096829; 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=XUX7oIApRf9quDNJaxBX4ag31s8+YagalHAQ+nw7IxU=; b=ggTdwN173rTdNhoCrb4/SDNIi/gwpFuTXUF+kPpZPSYwBioRMIShyvRvz1IVeGtobw pKp0cph+ejCAbcsmK9pk5C8Jrl+r7rDB8sB4Y5HPyAlA0DNK1kxNgKk5heHYNeKJ/PM1 5BzG+Ua9ohHXQSI4q4KI72n/1f3NKjaRozDCz29USHt7jTVEF40D6rScWx6zPaGQcr93 h11NkbHBTjbRmG6D9Y6ly8588ajZtaH0NvLAb5OR/OZSjj9EmRnq+LZaxhzKIa4SMzj2 AGWtx3+YW2/yMXh4FVdygmSm7K89i22agQwNoau9F3VUdIFvttDJh67HN45bj9soet+t 33uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709492029; x=1710096829; 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=XUX7oIApRf9quDNJaxBX4ag31s8+YagalHAQ+nw7IxU=; b=falN2SQ/ScTv5i7IJ3pZCM1669qJT/NoHEpdLvx6DbYZi9rv4as1kMSiUOExOZIdf9 6MeVGrD4dlrQKDGalunm3Z0fX4Y41rSZ4f3XKBDJwu9jI+IC3bZ0RcFbTejNc8h+vmiy gmjiW7mbBjJpWgxD43qp+hUooLIwkHF1BdbNxD+llOWJdoJSZDtrmJ96TL8J/wHl2laH LvSzcR5Q/ZbKyex2w1ycmrlaejSvbkfBhc/e35AP9hUCNTlWDnKzAhBs5EA7uJmMZbhk B4xymdL8IFwDWFfX6rvawqE7JTxY+fEeeLIxK/nHlngnawhc6pn0mbWUHjaNOmzEL0KB 9hPQ== X-Gm-Message-State: AOJu0YwuATaVmJ+AbY+HwXkdOU+Vct6Z16tjHzXnvnLSg17ZB8myGWK6 Uxjg5usjnzakHz/ZKkpcDauNxqSPAxAZvUBU+Rir+DWIFpW37ssLf/xyklTJ X-Google-Smtp-Source: AGHT+IFUSo8u73blocfm9TEjjHLhAMJGhFpEbLyicahfaMZeqb3X3wML28HjU0iOzGputokKSewqag== X-Received: by 2002:a05:600c:3b94:b0:412:d1ee:dfa2 with SMTP id n20-20020a05600c3b9400b00412d1eedfa2mr3851295wms.0.1709492029404; Sun, 03 Mar 2024 10:53:49 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Eduardo Habkost , Marcel Apfelbaum , "Michael S. Tsirkin" , Paolo Bonzini , Sergio Lopez , Paul Durrant , David Woodhouse , Richard Henderson , Igor Mammedov , Ani Sinha , Bernhard Beschow Subject: [PATCH v3 4/4] hw/i386/pc: Inline pc_cmos_init() into pc_cmos_init_late() and remove it Date: Sun, 3 Mar 2024 19:53:32 +0100 Message-ID: <20240303185332.1408-5-shentey@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240303185332.1408-1-shentey@gmail.com> References: <20240303185332.1408-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=shentey@gmail.com; helo=mail-wm1-x332.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1709492120013100003 Content-Type: text/plain; charset="utf-8" Now that pc_cmos_init() doesn't populate the X86MachineState::rtc attribute= any longer, its duties can be merged into pc_cmos_init_late() which is called w= ithin machine_done notifier. This frees pc_piix and pc_q35 from explicit CMOS initialization. Signed-off-by: Bernhard Beschow --- include/hw/i386/pc.h | 2 -- hw/i386/pc.c | 10 ---------- hw/i386/pc_piix.c | 2 -- hw/i386/pc_q35.c | 2 -- 4 files changed, 16 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 5065590281..bfdcd64514 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -178,8 +178,6 @@ void pc_basic_device_init(struct PCMachineState *pcms, ISADevice *rtc_state, bool create_fdctrl, uint32_t hpet_irqs); -void pc_cmos_init(PCMachineState *pcms, - ISADevice *s); void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); =20 void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7780d8d6dd..69e134e141 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -570,14 +570,6 @@ static void pc_cmos_init_late(PCMachineState *pcms) mc146818rtc_set_cmos_data(s, 0x39, val); =20 pc_cmos_init_floppy(s, pc_find_fdc0()); -} - -void pc_cmos_init(PCMachineState *pcms, - ISADevice *rtc) -{ - int val; - X86MachineState *x86ms =3D X86_MACHINE(pcms); - MC146818RtcState *s =3D MC146818_RTC(rtc); =20 /* various important CMOS locations needed by PC/Bochs bios */ =20 @@ -618,8 +610,6 @@ void pc_cmos_init(PCMachineState *pcms, val |=3D 0x02; /* FPU is there */ val |=3D 0x04; /* PS/2 mouse installed */ mc146818rtc_set_cmos_data(s, REG_EQUIPMENT_BYTE, val); - - /* hard drives and FDC are handled by pc_cmos_init_late() */ } =20 static void handle_a20_line_change(void *opaque, int irq, int level) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ce6aad758d..637f4d38be 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -342,8 +342,6 @@ static void pc_init1(MachineState *machine, } #endif =20 - pc_cmos_init(pcms, x86ms->rtc); - if (piix4_pm) { smi_irq =3D qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); =20 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 45a4102e75..bccd13d162 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -311,8 +311,6 @@ static void pc_q35_init(MachineState *machine) smbus_eeprom_init(pcms->smbus, 8, NULL, 0); } =20 - pc_cmos_init(pcms, x86ms->rtc); - /* the rest devices to which pci devfn is automatically assigned */ pc_vga_init(isa_bus, pcms->pcibus); pc_nic_init(pcmc, isa_bus, pcms->pcibus); --=20 2.44.0