From nobody Tue Nov 26 10:49:37 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=1708783285; cv=none; d=zohomail.com; s=zohoarc; b=OfbVumKpOd7ItQ/tMJFwF67/YeqdjRKXJrNwG7ZS1gbQbhPhFEcvboVBNsEqV2W64f7jsoJVWjKnUMSzhBJ9GRxJkPEvdbCxxZPzXhCxi/YLYMUjGqYRr7somZjH/Khk+RxGV9h3eRjrdWWaUcWBkF/sI3PhSB8I/qqMRbKE0m8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708783285; 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=eSTZZKZJd9onOmZuoGSDc/R40/Oc/o39d6sBD3S+k2A=; b=KvVoCsSR+ufIL/vM2J/lPefN358WRUqL15AaCVSDWxv7ReHvZ09N3SRGBE9tsED5LbrTqyQvVdJIrRlvxkOuq/3LW31d/FM8QxBx/32ozn8BChgsxjscf36Cj8jJCZ2SXpWIrlcDPwRDHsgIDLuV2wJjNUrlvODsCHY0dzIzQrE= 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 1708783285885101.81211092901162; Sat, 24 Feb 2024 06:01:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdsYj-0004EC-GL; Sat, 24 Feb 2024 08:59:21 -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 1rdsYc-0004Ah-To for qemu-devel@nongnu.org; Sat, 24 Feb 2024 08:59:14 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdsYb-0002m0-13 for qemu-devel@nongnu.org; Sat, 24 Feb 2024 08:59:14 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3392b045e0aso1314160f8f.2 for ; Sat, 24 Feb 2024 05:59:12 -0800 (PST) Received: from archlinux.. (dynamic-089-012-138-060.89.12.pool.telefonica.de. [89.12.138.60]) by smtp.gmail.com with ESMTPSA id n8-20020a056000170800b0033d817eddd3sm2285542wrc.13.2024.02.24.05.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 05:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708783150; x=1709387950; 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=eSTZZKZJd9onOmZuoGSDc/R40/Oc/o39d6sBD3S+k2A=; b=CHvu3BXfpqhjcQLQTbwVgi4PFE2MjqMymbfnfNPZtjXlGa3cUtzn10B9nhp6WS3Bou TRBuUi0hL5rarL6wCjPzV1uhRNSTeWyHCSao0OF2YaVP5TbhdI6/9kxkv+BhvcruGOyW J6VACOnLRsQZrasrkXAJqlQR64ZxalsDcBdwg5VHvtHqHvcanWLIkj7AwRb/842/KKkc cslfi9Ch8ngvSKI/s1VCAzt1xO+cr3jIxZobx4a23miLpoHZY3ceebdP9La3Xh0j6vhI UmCMYdtdCSC0RS6eO5wvxivBXnMa5oE5QKBuTSvvqtDkBBGQaKobUYZXtqFAj/tN64dA QOdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708783150; x=1709387950; 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=eSTZZKZJd9onOmZuoGSDc/R40/Oc/o39d6sBD3S+k2A=; b=hOQ4e/UbWF3QpKEUZMy+6D3YGBuoRUEeADbLAS2I2KnT5eH0n8LcHSwZYfow7+8CVY HOfwa8OBSrKD/OgvWXUmxY3bzkQ5c1fSsV1fKwDfZSV8j/vLoklWgHoVvcBnubT4nXnW CPQeTe/QrbIDtL33iH4cDUkqsNlWN3efHSyu+5favxDbbcJ6N5LOnsCxDk2/wnLHSBJo QvGrNS0d8jjkl3IAyYfguHsHR62m3NANloCOX2HRIkDyyEbVgdxfx+XWf2RDPGL4ZX/E +0tmpivMfM60fI+GskJPP15Kxby9MkRIphVM4TnD9yn6oMHSjDiiAt6YxmFZ7ngnk0rw SOpA== X-Gm-Message-State: AOJu0Yy9i1HkLpP8kPWKNFFFjjS03beuGXhxCe958+HpC3AVRDSD2oTc Zguv+bZoJCrkVLzRqq331xT8PmbHRIJUWhOlk5fw/wUeXUgMSkWmaydOoPGf X-Google-Smtp-Source: AGHT+IEDelizaLxsH9REnnjXKRVT9AC2w8qLDghH4sPV9ZmjXoSfpnCJTRYYrXhArVbpLG1ofC0UCw== X-Received: by 2002:a5d:6743:0:b0:33c:f9d6:fb20 with SMTP id l3-20020a5d6743000000b0033cf9d6fb20mr1849577wrw.45.1708783150577; Sat, 24 Feb 2024 05:59:10 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Richard Henderson , Paolo Bonzini , Paul Durrant , Igor Mammedov , Jason Wang , David Woodhouse , Sergio Lopez , Bernhard Beschow Subject: [PATCH v2 6/6] hw/i386/pc: Inline pc_cmos_init() into pc_cmos_init_late() and remove it Date: Sat, 24 Feb 2024 14:58:51 +0100 Message-ID: <20240224135851.100361-7-shentey@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240224135851.100361-1-shentey@gmail.com> References: <20240224135851.100361-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::433; envelope-from=shentey@gmail.com; helo=mail-wr1-x433.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: 1708783286817100006 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 4bb1899602..2b7c53d619 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 880e95de26..fad4c54512 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -567,14 +567,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 @@ -617,8 +609,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 e0b3f55a02..df0a5f934c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -310,8 +310,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