From nobody Wed Nov 12 15:17:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571138972; cv=none; d=zoho.com; s=zohoarc; b=aLaIiVJnNoujf5PTHcPGg4HlV47UzLwpgjFDywOhVSygVYv43F0jeM11+Rllo4Bs+HuOPCTDjxh5F02GKy7wXK5NyvN5KzQsKHSV38SfmnXdGyo2Szrt6X3ri80SfaZlYt+piJNiNF6JF/b4a9edcVSBu7z9BPq+v3FArGnaPBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571138972; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=333EWLQmceXkyFmGzjOeMRn+KTNM8xbNI/pR1iiZMJk=; b=eQbJBoANpU0irQW3HQC+byTTLQQ5AJOOoR23yBXkty1eCb+3xX5DIg2WwVr6hmnbilIMceN0Rvp6oRHn5D5qcUc5Y5RNEsbbWzh9ebnUQRr67Etv3VCqXPF307fgSNSrriyQE5hUKIIyiJmyQ0peuPCGzMigDMzw+KDVRoyRQIs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571138972866608.7889961018333; Tue, 15 Oct 2019 04:29:32 -0700 (PDT) Received: from localhost ([::1]:41548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKL19-0004RA-Au for importer@patchew.org; Tue, 15 Oct 2019 07:29:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56234) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKKw3-0007zB-Jk for qemu-devel@nongnu.org; Tue, 15 Oct 2019 07:24:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKKw2-00044o-2X for qemu-devel@nongnu.org; Tue, 15 Oct 2019 07:24:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57874) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iKKw1-00044N-Ql for qemu-devel@nongnu.org; Tue, 15 Oct 2019 07:24:14 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1550F5D66B; Tue, 15 Oct 2019 11:24:13 +0000 (UTC) Received: from dritchie.redhat.com (unknown [10.33.36.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46F7010027A9; Tue, 15 Oct 2019 11:24:10 +0000 (UTC) From: Sergio Lopez To: qemu-devel@nongnu.org Subject: [PATCH v9 02/15] hw/i386/pc: rename functions shared with non-PC machines Date: Tue, 15 Oct 2019 13:23:33 +0200 Message-Id: <20191015112346.45554-3-slp@redhat.com> In-Reply-To: <20191015112346.45554-1-slp@redhat.com> References: <20191015112346.45554-1-slp@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 15 Oct 2019 11:24:13 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, Sergio Lopez , mst@redhat.com, lersek@redhat.com, kraxel@redhat.com, pbonzini@redhat.com, imammedo@redhat.com, sgarzare@redhat.com, philmd@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The following functions are named *pc* but are not PC-machine specific but generic to the X86 architecture, rename them: load_linux -> x86_load_linux pc_new_cpu -> x86_new_cpu pc_cpus_init -> x86_cpus_init pc_cpu_index_to_props -> x86_cpu_index_to_props pc_get_default_cpu_node_id -> x86_get_default_cpu_node_id pc_possible_cpu_arch_ids -> x86_possible_cpu_arch_ids old_pc_system_rom_init -> x86_system_rom_init Signed-off-by: Sergio Lopez Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella Reviewed-by: Michael S. Tsirkin --- include/hw/i386/pc.h | 2 +- hw/i386/pc.c | 28 ++++++++++++++-------------- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/i386/pc_sysfw.c | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 6df4f4b6fb..d12f42e9e5 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -195,7 +195,7 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms); void pc_register_ferr_irq(qemu_irq irq); void pc_acpi_smi_interrupt(void *opaque, int irq, int level); =20 -void pc_cpus_init(PCMachineState *pcms); +void x86_cpus_init(PCMachineState *pcms); void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp); void pc_smp_parse(MachineState *ms, QemuOpts *opts); =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index bcda50efcc..fd08c6704b 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1019,8 +1019,8 @@ static bool load_elfboot(const char *kernel_filename, return true; } =20 -static void load_linux(PCMachineState *pcms, - FWCfgState *fw_cfg) +static void x86_load_linux(PCMachineState *pcms, + FWCfgState *fw_cfg) { uint16_t protocol; int setup_size, kernel_size, cmdline_size; @@ -1374,7 +1374,7 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int= level) } } =20 -static void pc_new_cpu(PCMachineState *pcms, int64_t apic_id, Error **errp) +static void x86_cpu_new(PCMachineState *pcms, int64_t apic_id, Error **err= p) { Object *cpu =3D NULL; Error *local_err =3D NULL; @@ -1490,14 +1490,14 @@ void pc_hot_add_cpu(MachineState *ms, const int64_t= id, Error **errp) return; } =20 - pc_new_cpu(PC_MACHINE(ms), apic_id, &local_err); + x86_cpu_new(PC_MACHINE(ms), apic_id, &local_err); if (local_err) { error_propagate(errp, local_err); return; } } =20 -void pc_cpus_init(PCMachineState *pcms) +void x86_cpus_init(PCMachineState *pcms) { int i; const CPUArchIdList *possible_cpus; @@ -1518,7 +1518,7 @@ void pc_cpus_init(PCMachineState *pcms) ms->smp.max_cpus - 1)= + 1; possible_cpus =3D mc->possible_cpu_arch_ids(ms); for (i =3D 0; i < ms->smp.cpus; i++) { - pc_new_cpu(pcms, possible_cpus->cpus[i].arch_id, &error_fatal); + x86_cpu_new(pcms, possible_cpus->cpus[i].arch_id, &error_fatal); } } =20 @@ -1621,7 +1621,7 @@ void xen_load_linux(PCMachineState *pcms) fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus); rom_set_fw(fw_cfg); =20 - load_linux(pcms, fw_cfg); + x86_load_linux(pcms, fw_cfg); for (i =3D 0; i < nb_option_roms; i++) { assert(!strcmp(option_rom[i].name, "linuxboot.bin") || !strcmp(option_rom[i].name, "linuxboot_dma.bin") || @@ -1756,7 +1756,7 @@ void pc_memory_init(PCMachineState *pcms, } =20 if (linux_boot) { - load_linux(pcms, fw_cfg); + x86_load_linux(pcms, fw_cfg); } =20 for (i =3D 0; i < nb_option_roms; i++) { @@ -2678,7 +2678,7 @@ static void pc_machine_wakeup(MachineState *machine) } =20 static CpuInstanceProperties -pc_cpu_index_to_props(MachineState *ms, unsigned cpu_index) +x86_cpu_index_to_props(MachineState *ms, unsigned cpu_index) { MachineClass *mc =3D MACHINE_GET_CLASS(ms); const CPUArchIdList *possible_cpus =3D mc->possible_cpu_arch_ids(ms); @@ -2687,7 +2687,7 @@ pc_cpu_index_to_props(MachineState *ms, unsigned cpu_= index) return possible_cpus->cpus[cpu_index].props; } =20 -static int64_t pc_get_default_cpu_node_id(const MachineState *ms, int idx) +static int64_t x86_get_default_cpu_node_id(const MachineState *ms, int idx) { X86CPUTopoInfo topo; PCMachineState *pcms =3D PC_MACHINE(ms); @@ -2699,7 +2699,7 @@ static int64_t pc_get_default_cpu_node_id(const Machi= neState *ms, int idx) return topo.pkg_id % ms->numa_state->num_nodes; } =20 -static const CPUArchIdList *pc_possible_cpu_arch_ids(MachineState *ms) +static const CPUArchIdList *x86_possible_cpu_arch_ids(MachineState *ms) { PCMachineState *pcms =3D PC_MACHINE(ms); int i; @@ -2801,9 +2801,9 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) assert(!mc->get_hotplug_handler); mc->get_hotplug_handler =3D pc_get_hotplug_handler; mc->hotplug_allowed =3D pc_hotplug_allowed; - mc->cpu_index_to_instance_props =3D pc_cpu_index_to_props; - mc->get_default_cpu_node_id =3D pc_get_default_cpu_node_id; - mc->possible_cpu_arch_ids =3D pc_possible_cpu_arch_ids; + mc->cpu_index_to_instance_props =3D x86_cpu_index_to_props; + mc->get_default_cpu_node_id =3D x86_get_default_cpu_node_id; + mc->possible_cpu_arch_ids =3D x86_possible_cpu_arch_ids; mc->auto_enable_numa_with_memhp =3D true; mc->has_hotpluggable_cpus =3D true; mc->default_boot_order =3D "cad"; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 6824b72124..de09e076cd 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -152,7 +152,7 @@ static void pc_init1(MachineState *machine, } } =20 - pc_cpus_init(pcms); + x86_cpus_init(pcms); =20 if (kvm_enabled() && pcmc->kvmclock_enabled) { kvmclock_create(); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 8fad20f314..894989b64e 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -179,7 +179,7 @@ static void pc_q35_init(MachineState *machine) xen_hvm_init(pcms, &ram_memory); } =20 - pc_cpus_init(pcms); + x86_cpus_init(pcms); =20 kvmclock_create(); =20 diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index a9983f0bfb..28cb1f63c9 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -211,7 +211,7 @@ static void pc_system_flash_map(PCMachineState *pcms, } } =20 -static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ra= m_fw) +static void x86_bios_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) { char *filename; MemoryRegion *bios, *isa_bios; @@ -272,7 +272,7 @@ void pc_system_firmware_init(PCMachineState *pcms, BlockBackend *pflash_blk[ARRAY_SIZE(pcms->flash)]; =20 if (!pcmc->pci_enabled) { - old_pc_system_rom_init(rom_memory, true); + x86_bios_rom_init(rom_memory, true); return; } =20 @@ -293,7 +293,7 @@ void pc_system_firmware_init(PCMachineState *pcms, =20 if (!pflash_blk[0]) { /* Machine property pflash0 not set, use ROM mode */ - old_pc_system_rom_init(rom_memory, false); + x86_bios_rom_init(rom_memory, false); } else { if (kvm_enabled() && !kvm_readonly_mem_enabled()) { /* --=20 2.21.0