From patchwork Fri Dec 13 16:17:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D711214E3 for ; Fri, 13 Dec 2019 21:01:18 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A793C2469F for ; Fri, 13 Dec 2019 21:01:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RglyfGT3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A793C2469F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifne6-0008LT-GA; Fri, 13 Dec 2019 16:18:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifne5-0008LO-KK for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:18:25 +0000 X-Inumbo-ID: 3009ebe4-1dc4-11ea-8f6f-12813bfff9fa Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.61]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 3009ebe4-1dc4-11ea-8f6f-12813bfff9fa; Fri, 13 Dec 2019 16:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zCZ3/HzJt6UebSooqSPs4MgLhNuCHweYJBKUsTXMBXw=; b=RglyfGT3r9CU70deDTCvjAs5XCx3qtvStP4m6DkjyTQrfiM21GcbA+NAnRxI/KyttjdCI6 W1jxIIZ+o+/88oWO3+eFqn3FO0PGLmpJdX8LrQ1PYXB61ihC7lfKJKitd6YQm20d4tbSHq MpgdcYuw+CpGhDmcHc8BsdnKdxHjr7I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-312-3ZUD0pJMOhuSY8G0PHLj2g-1; Fri, 13 Dec 2019 11:18:21 -0500 X-MC-Unique: 3ZUD0pJMOhuSY8G0PHLj2g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B5BB107ACC4; Fri, 13 Dec 2019 16:18:20 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB3BD19C4F; Fri, 13 Dec 2019 16:18:12 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:42 +0100 Message-Id: <20191213161753.8051-2-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 01/12] hw/i386/pc: Convert DPRINTF() to trace events X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Convert the deprecated DPRINTF() macro to trace events. Signed-off-by: Philippe Mathieu-Daudé --- v2: rename pc_pic -> x86_pic --- hw/i386/pc.c | 19 +++++-------------- hw/i386/trace-events | 6 ++++++ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ac08e63604..5f8e39c025 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -90,16 +90,7 @@ #include "config-devices.h" #include "e820_memory_layout.h" #include "fw_cfg.h" - -/* debug PC/ISA interrupts */ -//#define DEBUG_IRQ - -#ifdef DEBUG_IRQ -#define DPRINTF(fmt, ...) \ - do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) -#endif +#include "trace.h" struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; @@ -348,7 +339,7 @@ void gsi_handler(void *opaque, int n, int level) { GSIState *s = opaque; - DPRINTF("pc: %s GSI %d\n", level ? "raising" : "lowering", n); + trace_x86_gsi_interrupt(n, level); if (n < ISA_NUM_IRQS) { qemu_set_irq(s->i8259_irq[n], level); } @@ -426,7 +417,7 @@ static void pic_irq_request(void *opaque, int irq, int level) CPUState *cs = first_cpu; X86CPU *cpu = X86_CPU(cs); - DPRINTF("pic_irqs: %s irq %d\n", level? "raise" : "lower", irq); + trace_x86_pic_interrupt(irq, level); if (cpu->apic_state && !kvm_irqchip_in_kernel()) { CPU_FOREACH(cs) { cpu = X86_CPU(cs); @@ -760,7 +751,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val, Port92State *s = opaque; int oldval = s->outport; - DPRINTF("port92: write 0x%02" PRIx64 "\n", val); + trace_port92_write(val); s->outport = val; qemu_set_irq(s->a20_out, (val >> 1) & 1); if ((val & 1) && !(oldval & 1)) { @@ -775,7 +766,7 @@ static uint64_t port92_read(void *opaque, hwaddr addr, uint32_t ret; ret = s->outport; - DPRINTF("port92: read 0x%02x\n", ret); + trace_port92_read(ret); return ret; } diff --git a/hw/i386/trace-events b/hw/i386/trace-events index c8bc464bc5..a608a5b635 100644 --- a/hw/i386/trace-events +++ b/hw/i386/trace-events @@ -111,3 +111,9 @@ amdvi_ir_irte_ga_val(uint64_t hi, uint64_t lo) "hi 0x%"PRIx64" lo 0x%"PRIx64 # vmport.c vmport_register(unsigned char command, void *func, void *opaque) "command: 0x%02x func: %p opaque: %p" vmport_command(unsigned char command) "command: 0x%02x" + +# pc.c +x86_gsi_interrupt(int irqn, int level) "GSI interrupt #%d level:%d" +x86_pic_interrupt(int irqn, int level) "PIC interrupt #%d level:%d" +port92_read(uint8_t val) "port92: read 0x%02x" +port92_write(uint8_t val) "port92: write 0x%02x" From patchwork Fri Dec 13 16:17:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291129 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62D2A14BD for ; Fri, 13 Dec 2019 21:00:17 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33FA524682 for ; Fri, 13 Dec 2019 21:00:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QtHBVa5g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33FA524682 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifneL-0008O5-2B; Fri, 13 Dec 2019 16:18:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifneJ-0008Nl-At for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:18:39 +0000 X-Inumbo-ID: 38645108-1dc4-11ea-8f6f-12813bfff9fa Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 38645108-1dc4-11ea-8f6f-12813bfff9fa; Fri, 13 Dec 2019 16:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wz+kj9bS7gdLelr2F1XTImk+uhNKHdBToR+OTBW2CLw=; b=QtHBVa5gKx6TCajlX7qh5tkOnML/buIUQFyWTpiu012plxGR9T5unyFIIBboZzsVQ1jdW/ J+daNsNB5E0XjP/E1tWWLQrMwais7YB9TBosCezz8dq3STzBm3M+a9XGXpN+DrWxaftgk2 KCiC+dyODg8A6NkTHGhmQpNb5yWIu2Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-313-LJRbsRb5OhS3yg3bYkLDHQ-1; Fri, 13 Dec 2019 11:18:36 -0500 X-MC-Unique: LJRbsRb5OhS3yg3bYkLDHQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7D391005512; Fri, 13 Dec 2019 16:18:34 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D383D19C4F; Fri, 13 Dec 2019 16:18:20 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:43 +0100 Message-Id: <20191213161753.8051-3-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 02/12] hw/i386/pc: Move kvm_i8259_init() declaration to sysemu/kvm.h X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Move the KVM-related call to "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 1 - include/sysemu/kvm.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 1f86eba3f9..9866dfbd60 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -138,7 +138,6 @@ typedef struct PCMachineClass { extern DeviceState *isa_pic; qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq); -qemu_irq *kvm_i8259_init(ISABus *bus); int pic_read_irq(DeviceState *d); int pic_get_output(DeviceState *d); diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 9fe233b9bf..0f57667f79 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -518,6 +518,7 @@ void kvm_irqchip_set_qemuirq_gsi(KVMState *s, qemu_irq irq, int gsi); void kvm_pc_gsi_handler(void *opaque, int n, int level); void kvm_pc_setup_irq_routing(bool pci_enabled); void kvm_init_irq_routing(KVMState *s); +qemu_irq *kvm_i8259_init(ISABus *bus); /** * kvm_arch_irqchip_create: From patchwork Fri Dec 13 16:17:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D37514BD for ; Fri, 13 Dec 2019 21:01:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E965246AC for ; Fri, 13 Dec 2019 21:01:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DzbLDecS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E965246AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifneY-0008Sc-Hh; Fri, 13 Dec 2019 16:18:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifneX-0008S8-BU for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:18:53 +0000 X-Inumbo-ID: 3d339cfc-1dc4-11ea-88e7-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 3d339cfc-1dc4-11ea-88e7-bc764e2007e4; Fri, 13 Dec 2019 16:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YVWQa/Zo1x2m8LGgxk7TW+9fJim2zfZM8M5wdoCqM3g=; b=DzbLDecS98DTMSni0Va706qkqnXVDTEt0fyNdxJdUUTZw0e1XAyipwdI9DdldG6w/dQt92 3N4YsxIh4RTL8oaLlYfhDUAxrsQEr4RAVVUczuMVwF39UFy97memvn7/4e7QdYPPaz9akM srPp26IV5SSylzKBru/+xLKmQ9+xZdE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-eDjHLZxKONO5C1zmGmqY7Q-1; Fri, 13 Dec 2019 11:18:45 -0500 X-MC-Unique: eDjHLZxKONO5C1zmGmqY7Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBEE2800D41; Fri, 13 Dec 2019 16:18:42 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57CD819C4F; Fri, 13 Dec 2019 16:18:35 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:44 +0100 Message-Id: <20191213161753.8051-4-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 03/12] hw/i386/pc: Remove obsolete pc_pci_device_init() declaration X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In commit 1454509726 we removed the pc_pci_device_init() deprecated function and its calls, but we forgot to remove its prototype. Do that now. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 9866dfbd60..bc7d855aaa 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -211,7 +211,6 @@ void pc_cmos_init(PCMachineState *pcms, BusState *ide0, BusState *ide1, ISADevice *s); void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); -void pc_pci_device_init(PCIBus *pci_bus); typedef void (*cpu_set_smm_t)(int smm, void *arg); From patchwork Fri Dec 13 16:17:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291133 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44ADC14BD for ; Fri, 13 Dec 2019 21:00:25 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 158DB24682 for ; Fri, 13 Dec 2019 21:00:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P7MyBPgK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 158DB24682 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnei-0008Vw-R7; Fri, 13 Dec 2019 16:19:04 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifneh-0008VK-Fv for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:19:03 +0000 X-Inumbo-ID: 4628d3e2-1dc4-11ea-8f6f-12813bfff9fa Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 4628d3e2-1dc4-11ea-8f6f-12813bfff9fa; Fri, 13 Dec 2019 16:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GGwuqBufIRpm7r+bogG1ik6zWSyuu3LLE1OLY6amY0k=; b=P7MyBPgKAUZjxvHJQE396s4OjOb6JuXXiy/zJ2zlASw+Z2BKN/ulVA7Xp5utDnzAcBLuAz 4B7GdkYi//xEf9DqTl7SmAwKt38abOYosyzmirVeV3x1rN0TnyPtw+QjSJUuvWovk6m6hY HwEauLQsWrJW2lFmjP9Rn21ZELGB4v0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-126-tC9omY2INnyb3aoLSRkHSQ-1; Fri, 13 Dec 2019 11:18:59 -0500 X-MC-Unique: tC9omY2INnyb3aoLSRkHSQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF5A48024CF; Fri, 13 Dec 2019 16:18:57 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62BEC19C4F; Fri, 13 Dec 2019 16:18:43 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:45 +0100 Message-Id: <20191213161753.8051-5-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 04/12] hw/i386/pc: Remove obsolete cpu_set_smm_t typedef X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In commit f809c6051 we replaced the use of cpu_set_smm_t callbacks by using a Notifier to modify the MemoryRegion. This prototype is now not used anymore, we can safely remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index bc7d855aaa..743141e107 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -212,8 +212,6 @@ void pc_cmos_init(PCMachineState *pcms, ISADevice *s); void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); -typedef void (*cpu_set_smm_t)(int smm, void *arg); - void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name); From patchwork Fri Dec 13 16:17:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291113 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA1E518B8 for ; Fri, 13 Dec 2019 20:59:56 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B4D6C246A9 for ; Fri, 13 Dec 2019 20:59:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jOL+8O01" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4D6C246A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifneq-000071-3u; Fri, 13 Dec 2019 16:19:12 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnep-00006g-BS for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:19:11 +0000 X-Inumbo-ID: 4abf1109-1dc4-11ea-8f6f-12813bfff9fa Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.61]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 4abf1109-1dc4-11ea-8f6f-12813bfff9fa; Fri, 13 Dec 2019 16:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MoaYblDuqaOu06Ol7lC33g4xxfLM5QgSZVl86kdLlTs=; b=jOL+8O01ioOVAn+nJqsnlB8CnD136wRL03MH+F/KmE2PsPlYwIMMgFK2FLanYKMIZPXT0M 41uOE/1jswil5VlJRxP5kDIkgKtpNEorZjoXy3etMA0VGMNVWlGS48vQYx582Y/NDOgdMf kOg3Un4hsvyPFTIBgRcrHwU9ZKeiyro= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-7VHFUSGePyuNHDhuMawR8g-1; Fri, 13 Dec 2019 11:19:08 -0500 X-MC-Unique: 7VHFUSGePyuNHDhuMawR8g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2D1A801E70; Fri, 13 Dec 2019 16:19:06 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E7D019C4F; Fri, 13 Dec 2019 16:18:57 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:46 +0100 Message-Id: <20191213161753.8051-6-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 05/12] hw/i386/ich9: Remove unused include X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The "pcie_host.h" header is used by devices providing a PCI-e bus, usually North Bridges. The ICH9 is a South Bridge. Since we don't need this header, do not include it. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/ich9.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 72e803f6e2..eeb79ac1fe 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -7,7 +7,6 @@ #include "hw/isa/apm.h" #include "hw/i386/ioapic.h" #include "hw/pci/pci.h" -#include "hw/pci/pcie_host.h" #include "hw/pci/pci_bridge.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" From patchwork Fri Dec 13 16:17:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 732BC14BD for ; Fri, 13 Dec 2019 21:00:47 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 438F82465E for ; Fri, 13 Dec 2019 21:00:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="i0VrH76E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 438F82465E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfL-0000Hv-FD; Fri, 13 Dec 2019 16:19:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfJ-0000HU-LB for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:19:41 +0000 X-Inumbo-ID: 58d393c2-1dc4-11ea-b6f1-bc764e2007e4 Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 58d393c2-1dc4-11ea-b6f1-bc764e2007e4; Fri, 13 Dec 2019 16:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=udh4eRVcqNXqy8xw20XMMLF1nsNWpiytALbnJZM2cT8=; b=i0VrH76EFbp7A8+eEe2p1qN3w04JOzZ1tr3Zd1lpzaS5Q9WEsqrct6ITEHJXGGp3vIOyiu WZILvRsrvwTsNNxYoj449jsYlVkBeXDaG/4kfJM+MmRol+NBcQw76elq39b72qc1+wdXIY QJyWd54JMpWW5/Jn54GquLtuPBPFGCA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-E1z2I1SDMG2jpXGeAYNRRQ-1; Fri, 13 Dec 2019 11:19:28 -0500 X-MC-Unique: E1z2I1SDMG2jpXGeAYNRRQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E8601854323; Fri, 13 Dec 2019 16:19:26 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F12719C4F; Fri, 13 Dec 2019 16:19:07 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:47 +0100 Message-Id: <20191213161753.8051-7-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 06/12] hw/i386/ich9: Move unnecessary "pci_bridge.h" include X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" While the ICH9 chipset is a 'South Bridge', it is not a PCI bridge. Nothing in "hw/i386/ich9.h" requires definitions from "pci_bridge.h" so move its inclusion where it is required. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/ich9.h | 1 - hw/i386/acpi-build.c | 1 + hw/pci-bridge/i82801b11.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index eeb79ac1fe..369bc64671 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -7,7 +7,6 @@ #include "hw/isa/apm.h" #include "hw/i386/ioapic.h" #include "hw/pci/pci.h" -#include "hw/pci/pci_bridge.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" #include "hw/pci/pci_bus.h" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 12ff55fcfb..291909fa05 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -27,6 +27,7 @@ #include "qemu/bitmap.h" #include "qemu/error-report.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_bridge.h" #include "hw/core/cpu.h" #include "target/i386/cpu.h" #include "hw/misc/pvpanic.h" diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c index 2b3907655b..033b3c43c4 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -43,6 +43,7 @@ #include "qemu/osdep.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_bridge.h" #include "migration/vmstate.h" #include "qemu/module.h" #include "hw/i386/ich9.h" From patchwork Fri Dec 13 16:17:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291119 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D83D14BD for ; Fri, 13 Dec 2019 21:00:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0BB52465E for ; Fri, 13 Dec 2019 21:00:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MX5ZbxZw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0BB52465E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfO-0000J8-Mx; Fri, 13 Dec 2019 16:19:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfM-0000IR-S0 for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:19:44 +0000 X-Inumbo-ID: 5fa49e12-1dc4-11ea-8f70-12813bfff9fa Received: from us-smtp-1.mimecast.com (unknown [205.139.110.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 5fa49e12-1dc4-11ea-8f70-12813bfff9fa; Fri, 13 Dec 2019 16:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iDPjG3bzf4auKjid69BMILX9vi363Mf6WYlN4QfXbhI=; b=MX5ZbxZwNcbTOc7VUp6R/4kmnKdUNAqg7cr701D4x76Sc07ErQzfRCYsxNLee15ceYKsev qAEQB0xgRujj7sk0UO4I7vMar2u0vSBXwxDKUSKDu9DPubyaJeYClcIqGOkCe5Mu+UGaEq gJVX385mLgX/lwMUsHP1SmoypxA0UIo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-JGYk5EipN_i0mWuUmywLaw-1; Fri, 13 Dec 2019 11:19:40 -0500 X-MC-Unique: JGYk5EipN_i0mWuUmywLaw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 70F3F102C8BB; Fri, 13 Dec 2019 16:19:37 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06C8B19C4F; Fri, 13 Dec 2019 16:19:26 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:48 +0100 Message-Id: <20191213161753.8051-8-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 07/12] hw/ide/piix: Remove superfluous DEVICE() cast X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Commit 02a9594b4f0 already converted 'dev' to DeviceState. Since the cast is superfluous, remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/piix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index db313dd3b1..ffeff4e095 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -193,7 +193,8 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux) blk_unref(blk); } } - qdev_reset_all(DEVICE(dev)); + qdev_reset_all(dev); + return 0; } From patchwork Fri Dec 13 16:17:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291187 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D1266C1 for ; Fri, 13 Dec 2019 21:01:54 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1BB32465E for ; Fri, 13 Dec 2019 21:01:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Nfy7zHBJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1BB32465E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfg-0000j4-1a; Fri, 13 Dec 2019 16:20:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfe-0000aw-O5 for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:20:02 +0000 X-Inumbo-ID: 6568569a-1dc4-11ea-a914-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.61]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 6568569a-1dc4-11ea-a914-bc764e2007e4; Fri, 13 Dec 2019 16:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=psjmWWDdVhLhKwDb1Wq8yYWFEUJUVcwEEB0iH9Xv/kA=; b=Nfy7zHBJEdilzAJnjb4XMffrbB907kyCRzm0FbdKOlR9dknJ7U9w/dq8+qrD2eW03mMf+5 A+75QNNc22NM6Y9BC0QCgjlLTALzM2slucuOp1RXkvmrMvOtKjmKG36snfFCOamCt740X6 ceYM0N4R9ij/Qmy9CdXPaXLevg92IM8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-XiV1IY8PM82PJ_OyDAlfBg-1; Fri, 13 Dec 2019 11:19:50 -0500 X-MC-Unique: XiV1IY8PM82PJ_OyDAlfBg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE9211856A65; Fri, 13 Dec 2019 16:19:48 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 070AE19C4F; Fri, 13 Dec 2019 16:19:37 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:49 +0100 Message-Id: <20191213161753.8051-9-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 08/12] hw/ide/piix: Use ARRAY_SIZE() instead of magic numbers X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Using magic numbers is dangerous because the structures PCIIDEState might be modified and this source file consuming the "ide/pci.h" header would be out of sync, eventually accessing out of bound array members. Use the ARRAY_SIZE() to keep the source file sync. Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/piix.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index ffeff4e095..ab23613a44 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -87,10 +87,9 @@ static const MemoryRegionOps piix_bmdma_ops = { static void bmdma_setup_bar(PCIIDEState *d) { - int i; - memory_region_init(&d->bmdma_bar, OBJECT(d), "piix-bmdma-container", 16); - for(i = 0;i < 2; i++) { + + for (size_t i = 0; i < ARRAY_SIZE(d->bmdma); i++) { BMDMAState *bm = &d->bmdma[i]; memory_region_init_io(&bm->extra_io, OBJECT(d), &piix_bmdma_ops, bm, @@ -107,9 +106,8 @@ static void piix_ide_reset(DeviceState *dev) PCIIDEState *d = PCI_IDE(dev); PCIDevice *pd = PCI_DEVICE(d); uint8_t *pci_conf = pd->config; - int i; - for (i = 0; i < 2; i++) { + for (size_t i = 0; i < ARRAY_SIZE(d->bus); i++) { ide_bus_reset(&d->bus[i]); } @@ -132,10 +130,10 @@ static void pci_piix_init_ports(PCIIDEState *d) { {0x1f0, 0x3f6, 14}, {0x170, 0x376, 15}, }; - int i; - for (i = 0; i < 2; i++) { - ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); + for (size_t i = 0; i < ARRAY_SIZE(d->bus); i++) { + ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, + ARRAY_SIZE(d->bus[0].ifs)); ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, port_info[i].iobase2); ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq)); @@ -163,14 +161,13 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error **errp) int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux) { - PCIIDEState *pci_ide; + PCIIDEState *pci_ide = PCI_IDE(dev); DriveInfo *di; - int i; IDEDevice *idedev; + const size_t idedev_max = ARRAY_SIZE(pci_ide->bus) + * ARRAY_SIZE(pci_ide->bus[0].ifs); - pci_ide = PCI_IDE(dev); - - for (i = aux ? 1 : 0; i < 4; i++) { + for (size_t i = aux ? 1 : 0; i < idedev_max; i++) { di = drive_get_by_index(IF_IDE, i); if (di != NULL && !di->media_cd) { BlockBackend *blk = blk_by_legacy_dinfo(di); @@ -210,9 +207,8 @@ PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) static void pci_piix_ide_exitfn(PCIDevice *dev) { PCIIDEState *d = PCI_IDE(dev); - unsigned i; - for (i = 0; i < 2; ++i) { + for (size_t i = 0; i < ARRAY_SIZE(d->bmdma); ++i) { memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io); memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_ioport); } From patchwork Fri Dec 13 16:17:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291123 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6BEB14BD for ; Fri, 13 Dec 2019 21:00:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8735F24682 for ; Fri, 13 Dec 2019 21:00:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AFuwLkT0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8735F24682 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfl-00019s-A1; Fri, 13 Dec 2019 16:20:09 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifnfk-00018j-4d for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:20:08 +0000 X-Inumbo-ID: 6d4fd5f5-1dc4-11ea-8f78-12813bfff9fa Received: from us-smtp-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 6d4fd5f5-1dc4-11ea-8f78-12813bfff9fa; Fri, 13 Dec 2019 16:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576254007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a8wBTE5cUDwAyuXnH+hRuodn6C9SR01WXRNOHU/iiao=; b=AFuwLkT0ZNJDIhprUk3hV1TfkoUmjtCFcuEeoNp0dCdcdFi1gvqgsh8LyCr2YXSCG/PywM 06/0i01doxDKuOTBgPLZePM6I4oAOcU6B7rwyWVtVJM4u1Is44Mc9spgGTpGoIPLSY4rpN KKfW3bFc6WA2YjDcYhFp778ptkgvna4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-HUXIkw6eNy6QdyW3JyJ81A-1; Fri, 13 Dec 2019 11:20:05 -0500 X-MC-Unique: HUXIkw6eNy6QdyW3JyJ81A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13E62593A1; Fri, 13 Dec 2019 16:20:04 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79E2A19C4F; Fri, 13 Dec 2019 16:19:49 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:50 +0100 Message-Id: <20191213161753.8051-10-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 09/12] hw/intc/ioapic: Make ioapic_print_redtbl() static X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Since commit 0c8465440 the ioapic_print_redtbl() function is not used outside of ioapic_common.c, make it static, and remove its prototype declaration in "ioapic_internal.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/ioapic_internal.h | 1 - hw/intc/ioapic_common.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h index d46c87c510..8b743aeed0 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/i386/ioapic_internal.h @@ -118,7 +118,6 @@ struct IOAPICCommonState { void ioapic_reset_common(DeviceState *dev); -void ioapic_print_redtbl(Monitor *mon, IOAPICCommonState *s); void ioapic_stat_update_irq(IOAPICCommonState *s, int irq, int level); #endif /* QEMU_IOAPIC_INTERNAL_H */ diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c index 5538b5b86e..72ea945377 100644 --- a/hw/intc/ioapic_common.c +++ b/hw/intc/ioapic_common.c @@ -76,7 +76,7 @@ static void ioapic_irr_dump(Monitor *mon, const char *name, uint32_t bitmap) monitor_printf(mon, "\n"); } -void ioapic_print_redtbl(Monitor *mon, IOAPICCommonState *s) +static void ioapic_print_redtbl(Monitor *mon, IOAPICCommonState *s) { static const char *delm_str[] = { "fixed", "lowest", "SMI", "...", "NMI", "INIT", "...", "extINT"}; From patchwork Fri Dec 13 16:17:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291157 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B13706C1 for ; Fri, 13 Dec 2019 21:01:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 820BE2465E for ; Fri, 13 Dec 2019 21:01:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MmZQ1LiH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 820BE2465E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifng1-0001IK-S0; Fri, 13 Dec 2019 16:20:25 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifng0-0001Hp-OP for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:20:24 +0000 X-Inumbo-ID: 7270d36c-1dc4-11ea-a1e1-bc764e2007e4 Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 7270d36c-1dc4-11ea-a1e1-bc764e2007e4; Fri, 13 Dec 2019 16:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576254015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KN6AckxlKUpsLzxakKRr0um+iuOesJrJu7GlUIEw6bQ=; b=MmZQ1LiHb7yd5M4X7q+qCp2C3t93mtfXDF/x8cB6eIBT8rCHDnU0/DVfK0fcYvpRW182ag v1quLewpJc9Ssm5HWeXXxkoa9wFe+ywXBZMj5MH2UbEHAPF7YXeWgeIlxsL4TXXTMbRa8P I7VEcUTf2nHYAYxMUePHNie0Ke0Gc1s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-rlsJfBc9OvaPIStuNENCNA-1; Fri, 13 Dec 2019 11:20:14 -0500 X-MC-Unique: rlsJfBc9OvaPIStuNENCNA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7A050800EC0; Fri, 13 Dec 2019 16:20:12 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B180319C4F; Fri, 13 Dec 2019 16:20:04 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:51 +0100 Message-Id: <20191213161753.8051-11-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 10/12] hw/i386/pc: Rename allocate_cpu_irq from 'pc' to 'x86_machine' X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" All the X86 machines use an interrupt controller. Rename the function to something more generic. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 2 +- hw/i386/microvm.c | 2 +- hw/i386/pc.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 743141e107..244dbf2ec0 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -198,7 +198,7 @@ void pc_memory_init(PCMachineState *pcms, MemoryRegion *rom_memory, MemoryRegion **ram_memory); uint64_t pc_pci_hole64_start(void); -qemu_irq pc_allocate_cpu_irq(void); +qemu_irq x86_machine_allocate_cpu_irq(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state, diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index def37e60f7..7ac008460a 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -132,7 +132,7 @@ static void microvm_devices_init(MicrovmMachineState *mms) if (mms->pic == ON_OFF_AUTO_ON || mms->pic == ON_OFF_AUTO_AUTO) { qemu_irq *i8259; - i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq()); + i8259 = i8259_init(isa_bus, x86_machine_allocate_cpu_irq()); for (i = 0; i < ISA_NUM_IRQS; i++) { gsi_state->i8259_irq[i] = i8259[i]; } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5f8e39c025..4defee274f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1282,7 +1282,7 @@ uint64_t pc_pci_hole64_start(void) return ROUND_UP(hole64_start, 1 * GiB); } -qemu_irq pc_allocate_cpu_irq(void) +qemu_irq x86_machine_allocate_cpu_irq(void) { return qemu_allocate_irq(pic_irq_request, NULL, 0); } @@ -1463,7 +1463,7 @@ void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs) } else if (xen_enabled()) { i8259 = xen_interrupt_controller_init(); } else { - i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq()); + i8259 = i8259_init(isa_bus, x86_machine_allocate_cpu_irq()); } for (size_t i = 0; i < ISA_NUM_IRQS; i++) { From patchwork Fri Dec 13 16:17:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291143 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84BF26C1 for ; Fri, 13 Dec 2019 21:00:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5510C2465E for ; Fri, 13 Dec 2019 21:00:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="A7+DBJ7R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5510C2465E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifng6-0001Kk-6F; Fri, 13 Dec 2019 16:20:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifng5-0001KK-Di for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:20:29 +0000 X-Inumbo-ID: 795f6f8b-1dc4-11ea-8f78-12813bfff9fa Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 795f6f8b-1dc4-11ea-8f78-12813bfff9fa; Fri, 13 Dec 2019 16:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576254027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2EftjF8HiFSpwXHv8YZWYjoqxeIDtjy2n7wAZHjtMGk=; b=A7+DBJ7RSW942P7zwXRg7R/4n94VRlMi/c+EYQ01Y06nQzqCZ/sThWMLJn63sTY5tB0oNo lvCGQte90GCw1wP93Gj518KogjhUpFe2GXxwSisgw4ZjsG6i6HiCM/DBO06m8HP2NOeyuW P5DKzHrfleAOjeUz2SFgVMT+ONgAO80= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-fqun19fLNLSrG9Al94wyOA-1; Fri, 13 Dec 2019 11:20:26 -0500 X-MC-Unique: fqun19fLNLSrG9Al94wyOA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89139800D4E; Fri, 13 Dec 2019 16:20:24 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E95AD19481; Fri, 13 Dec 2019 16:20:12 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:52 +0100 Message-Id: <20191213161753.8051-12-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 11/12] hw/i386/pc: Move x86_machine_allocate_cpu_irq() to 'hw/i386/x86.c' X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Keep 'pc.c' for PC-machine specific code, and use 'x86.c' for code used by all the X86-based machines. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 1 - include/hw/i386/x86.h | 2 ++ hw/i386/pc.c | 27 --------------------------- hw/i386/x86.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 244dbf2ec0..2ef6e2cfff 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -198,7 +198,6 @@ void pc_memory_init(PCMachineState *pcms, MemoryRegion *rom_memory, MemoryRegion **ram_memory); uint64_t pc_pci_hole64_start(void); -qemu_irq x86_machine_allocate_cpu_irq(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state, diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 4b84917885..4c3dd6f33e 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -95,4 +95,6 @@ void x86_load_linux(X86MachineState *x86ms, bool pvh_enabled, bool linuxboot_dma_enabled); +qemu_irq x86_machine_allocate_cpu_irq(void); + #endif diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4defee274f..4c018735b0 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -412,28 +412,6 @@ int cpu_get_pic_interrupt(CPUX86State *env) return intno; } -static void pic_irq_request(void *opaque, int irq, int level) -{ - CPUState *cs = first_cpu; - X86CPU *cpu = X86_CPU(cs); - - trace_x86_pic_interrupt(irq, level); - if (cpu->apic_state && !kvm_irqchip_in_kernel()) { - CPU_FOREACH(cs) { - cpu = X86_CPU(cs); - if (apic_accept_pic_intr(cpu->apic_state)) { - apic_deliver_pic_intr(cpu->apic_state, level); - } - } - } else { - if (level) { - cpu_interrupt(cs, CPU_INTERRUPT_HARD); - } else { - cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); - } - } -} - /* PC cmos mappings */ #define REG_EQUIPMENT_BYTE 0x14 @@ -1282,11 +1260,6 @@ uint64_t pc_pci_hole64_start(void) return ROUND_UP(hole64_start, 1 * GiB); } -qemu_irq x86_machine_allocate_cpu_irq(void) -{ - return qemu_allocate_irq(pic_irq_request, NULL, 0); -} - DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) { DeviceState *dev = NULL; diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 394edc2f72..a6a394ca36 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -34,6 +34,7 @@ #include "sysemu/numa.h" #include "sysemu/replay.h" #include "sysemu/sysemu.h" +#include "sysemu/kvm.h" #include "hw/i386/x86.h" #include "target/i386/cpu.h" @@ -41,11 +42,13 @@ #include "hw/i386/fw_cfg.h" #include "hw/acpi/cpu_hotplug.h" +#include "hw/irq.h" #include "hw/nmi.h" #include "hw/loader.h" #include "multiboot.h" #include "elf.h" #include "standard-headers/asm-x86/bootparam.h" +#include "trace.h" #define BIOS_FILENAME "bios.bin" @@ -206,6 +209,33 @@ static void x86_nmi(NMIState *n, int cpu_index, Error **errp) } } +static void pic_irq_request(void *opaque, int irq, int level) +{ + CPUState *cs = first_cpu; + X86CPU *cpu = X86_CPU(cs); + + trace_x86_pic_interrupt(irq, level); + if (cpu->apic_state && !kvm_irqchip_in_kernel()) { + CPU_FOREACH(cs) { + cpu = X86_CPU(cs); + if (apic_accept_pic_intr(cpu->apic_state)) { + apic_deliver_pic_intr(cpu->apic_state, level); + } + } + } else { + if (level) { + cpu_interrupt(cs, CPU_INTERRUPT_HARD); + } else { + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); + } + } +} + +qemu_irq x86_machine_allocate_cpu_irq(void) +{ + return qemu_allocate_irq(pic_irq_request, NULL, 0); +} + static long get_file_size(FILE *f) { long where, size; From patchwork Fri Dec 13 16:17:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11291171 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E9156C1 for ; Fri, 13 Dec 2019 21:01:21 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 14D9B24682 for ; Fri, 13 Dec 2019 21:01:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZlQ+cX1T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14D9B24682 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifngK-0001Sq-HJ; Fri, 13 Dec 2019 16:20:44 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifngJ-0001SH-7K for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:20:43 +0000 X-Inumbo-ID: 7f07fa11-1dc4-11ea-8f78-12813bfff9fa Received: from us-smtp-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 7f07fa11-1dc4-11ea-8f78-12813bfff9fa; Fri, 13 Dec 2019 16:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576254037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4iY8APFf9mkIq+cbZyyzXVA8af+R0+1u/Mw6FuzxngQ=; b=ZlQ+cX1TrrGTLyHIT4HrhfBzgyp4hzdNWw+ZCyATgCLzaTz7lh0dbQ1nKZQOOKfH0oGKtu HnloFwUCAWOj16jGNLYBQiqxRKbsgWKjB/cNQIakbpouAa/J65C8qdY2BrEIhhpll1OdZj qaRLhWvmaAimzv7KEXRFRIFlRpJZGRE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-7TJ690WrPveV067pFYkoLA-1; Fri, 13 Dec 2019 11:20:35 -0500 X-MC-Unique: 7TJ690WrPveV067pFYkoLA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF7DF1856A60; Fri, 13 Dec 2019 16:20:33 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20A8F19C4F; Fri, 13 Dec 2019 16:20:24 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:53 +0100 Message-Id: <20191213161753.8051-13-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h' X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Historically, QEMU started with only one X86 machine: the PC. The 'hw/i386/pc.h' header was used to store all X86 and PC declarations. Since we have now multiple machines based on the X86 architecture, move the PC-specific declarations in a new header. We use 'internal' in the name to explicit this header is restricted to the X86 architecture. Other architecture can not access it. Signed-off-by: Philippe Mathieu-Daudé --- Maybe name it 'pc_machine.h'? --- hw/i386/pc_internal.h | 144 ++++++++++++++++++++++++++++++++++++++++++ include/hw/i386/pc.h | 128 ------------------------------------- hw/i386/acpi-build.c | 1 + hw/i386/pc.c | 1 + hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/i386/pc_sysfw.c | 1 + hw/i386/xen/xen-hvm.c | 1 + 8 files changed, 150 insertions(+), 128 deletions(-) create mode 100644 hw/i386/pc_internal.h diff --git a/hw/i386/pc_internal.h b/hw/i386/pc_internal.h new file mode 100644 index 0000000000..c9be64e815 --- /dev/null +++ b/hw/i386/pc_internal.h @@ -0,0 +1,144 @@ +#ifndef HW_I386_PC_INTERNAL_H +#define HW_I386_PC_INTERNAL_H + +#include "hw/hw.h" +#include "hw/isa/isa.h" +#include "hw/i386/pc.h" +#include "hw/block/fdc.h" +#include "net/net.h" + +#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" +#define PC_MACHINE_DEVMEM_REGION_SIZE "device-memory-region-size" +#define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g" +#define PC_MACHINE_VMPORT "vmport" +#define PC_MACHINE_SMM "smm" +#define PC_MACHINE_SMBUS "smbus" +#define PC_MACHINE_SATA "sata" +#define PC_MACHINE_PIT "pit" + +void pc_register_ferr_irq(qemu_irq irq); +void pc_acpi_smi_interrupt(void *opaque, int irq, int level); + +void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp); +void pc_smp_parse(MachineState *ms, QemuOpts *opts); + +void pc_guest_info_init(PCMachineState *pcms); + +void xen_load_linux(PCMachineState *pcms); +void pc_memory_init(PCMachineState *pcms, + MemoryRegion *system_memory, + MemoryRegion *rom_memory, + MemoryRegion **ram_memory); + +void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, + ISADevice **rtc_state, + bool create_fdctrl, + bool no_vmport, + bool has_pit, + uint32_t hpet_irqs); +void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd); +void pc_cmos_init(PCMachineState *pcms, + BusState *ide0, BusState *ide1, + ISADevice *s); +void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); + +ISADevice *pc_find_fdc0(void); +int cmos_get_fd_drive_type(FloppyDriveType fd0); + +#define FW_CFG_IO_BASE 0x510 + +/* pc_sysfw.c */ +void pc_system_flash_create(PCMachineState *pcms); +void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); + +extern GlobalProperty pc_compat_4_1[]; +extern const size_t pc_compat_4_1_len; + +extern GlobalProperty pc_compat_4_0[]; +extern const size_t pc_compat_4_0_len; + +extern GlobalProperty pc_compat_3_1[]; +extern const size_t pc_compat_3_1_len; + +extern GlobalProperty pc_compat_3_0[]; +extern const size_t pc_compat_3_0_len; + +extern GlobalProperty pc_compat_2_12[]; +extern const size_t pc_compat_2_12_len; + +extern GlobalProperty pc_compat_2_11[]; +extern const size_t pc_compat_2_11_len; + +extern GlobalProperty pc_compat_2_10[]; +extern const size_t pc_compat_2_10_len; + +extern GlobalProperty pc_compat_2_9[]; +extern const size_t pc_compat_2_9_len; + +extern GlobalProperty pc_compat_2_8[]; +extern const size_t pc_compat_2_8_len; + +extern GlobalProperty pc_compat_2_7[]; +extern const size_t pc_compat_2_7_len; + +extern GlobalProperty pc_compat_2_6[]; +extern const size_t pc_compat_2_6_len; + +extern GlobalProperty pc_compat_2_5[]; +extern const size_t pc_compat_2_5_len; + +extern GlobalProperty pc_compat_2_4[]; +extern const size_t pc_compat_2_4_len; + +extern GlobalProperty pc_compat_2_3[]; +extern const size_t pc_compat_2_3_len; + +extern GlobalProperty pc_compat_2_2[]; +extern const size_t pc_compat_2_2_len; + +extern GlobalProperty pc_compat_2_1[]; +extern const size_t pc_compat_2_1_len; + +extern GlobalProperty pc_compat_2_0[]; +extern const size_t pc_compat_2_0_len; + +extern GlobalProperty pc_compat_1_7[]; +extern const size_t pc_compat_1_7_len; + +extern GlobalProperty pc_compat_1_6[]; +extern const size_t pc_compat_1_6_len; + +extern GlobalProperty pc_compat_1_5[]; +extern const size_t pc_compat_1_5_len; + +extern GlobalProperty pc_compat_1_4[]; +extern const size_t pc_compat_1_4_len; + +/* + * Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +#define PC_CPU_MODEL_IDS(v) \ + { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ + { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ + { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, + +#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ + static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ + { \ + MachineClass *mc = MACHINE_CLASS(oc); \ + optsfn(mc); \ + mc->init = initfn; \ + } \ + static const TypeInfo pc_machine_type_##suffix = { \ + .name = namestr TYPE_MACHINE_SUFFIX, \ + .parent = TYPE_PC_MACHINE, \ + .class_init = pc_machine_##suffix##_class_init, \ + }; \ + static void pc_machine_init_##suffix(void) \ + { \ + type_register(&pc_machine_type_##suffix); \ + } \ + type_init(pc_machine_init_##suffix) + +#endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 2ef6e2cfff..9a5633a394 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -4,9 +4,7 @@ #include "exec/memory.h" #include "hw/boards.h" #include "hw/isa/isa.h" -#include "hw/block/fdc.h" #include "hw/block/flash.h" -#include "net/net.h" #include "hw/i386/ioapic.h" #include "hw/i386/x86.h" @@ -58,14 +56,6 @@ struct PCMachineState { hwaddr memhp_io_base; }; -#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" -#define PC_MACHINE_DEVMEM_REGION_SIZE "device-memory-region-size" -#define PC_MACHINE_VMPORT "vmport" -#define PC_MACHINE_SMM "smm" -#define PC_MACHINE_SMBUS "smbus" -#define PC_MACHINE_SATA "sata" -#define PC_MACHINE_PIT "pit" - /** * PCMachineClass: * @@ -173,12 +163,6 @@ void vmmouse_set_data(const uint32_t *data); extern int fd_bootchk; bool pc_machine_is_smm_enabled(PCMachineState *pcms); -void pc_acpi_smi_interrupt(void *opaque, int irq, int level); - -void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp); -void pc_smp_parse(MachineState *ms, QemuOpts *opts); - -void pc_guest_info_init(PCMachineState *pcms); #define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start" #define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end" @@ -192,31 +176,12 @@ void pc_guest_info_init(PCMachineState *pcms); void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory, MemoryRegion *pci_address_space); -void xen_load_linux(PCMachineState *pcms); -void pc_memory_init(PCMachineState *pcms, - MemoryRegion *system_memory, - MemoryRegion *rom_memory, - MemoryRegion **ram_memory); uint64_t pc_pci_hole64_start(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); -void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, - ISADevice **rtc_state, - bool create_fdctrl, - bool no_vmport, - bool has_pit, - uint32_t hpet_irqs); -void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd); -void pc_cmos_init(PCMachineState *pcms, - BusState *ide0, BusState *ide1, - ISADevice *s); -void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name); -ISADevice *pc_find_fdc0(void); -int cmos_get_fd_drive_type(FloppyDriveType fd0); - #define FW_CFG_IO_BASE 0x510 #define PORT92_A20_LINE "a20" @@ -224,102 +189,9 @@ int cmos_get_fd_drive_type(FloppyDriveType fd0); /* hpet.c */ extern int no_hpet; -/* pc_sysfw.c */ -void pc_system_flash_create(PCMachineState *pcms); -void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); - /* acpi-build.c */ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, const CPUArchIdList *apic_ids, GArray *entry); -extern GlobalProperty pc_compat_4_1[]; -extern const size_t pc_compat_4_1_len; - -extern GlobalProperty pc_compat_4_0[]; -extern const size_t pc_compat_4_0_len; - -extern GlobalProperty pc_compat_3_1[]; -extern const size_t pc_compat_3_1_len; - -extern GlobalProperty pc_compat_3_0[]; -extern const size_t pc_compat_3_0_len; - -extern GlobalProperty pc_compat_2_12[]; -extern const size_t pc_compat_2_12_len; - -extern GlobalProperty pc_compat_2_11[]; -extern const size_t pc_compat_2_11_len; - -extern GlobalProperty pc_compat_2_10[]; -extern const size_t pc_compat_2_10_len; - -extern GlobalProperty pc_compat_2_9[]; -extern const size_t pc_compat_2_9_len; - -extern GlobalProperty pc_compat_2_8[]; -extern const size_t pc_compat_2_8_len; - -extern GlobalProperty pc_compat_2_7[]; -extern const size_t pc_compat_2_7_len; - -extern GlobalProperty pc_compat_2_6[]; -extern const size_t pc_compat_2_6_len; - -extern GlobalProperty pc_compat_2_5[]; -extern const size_t pc_compat_2_5_len; - -extern GlobalProperty pc_compat_2_4[]; -extern const size_t pc_compat_2_4_len; - -extern GlobalProperty pc_compat_2_3[]; -extern const size_t pc_compat_2_3_len; - -extern GlobalProperty pc_compat_2_2[]; -extern const size_t pc_compat_2_2_len; - -extern GlobalProperty pc_compat_2_1[]; -extern const size_t pc_compat_2_1_len; - -extern GlobalProperty pc_compat_2_0[]; -extern const size_t pc_compat_2_0_len; - -extern GlobalProperty pc_compat_1_7[]; -extern const size_t pc_compat_1_7_len; - -extern GlobalProperty pc_compat_1_6[]; -extern const size_t pc_compat_1_6_len; - -extern GlobalProperty pc_compat_1_5[]; -extern const size_t pc_compat_1_5_len; - -extern GlobalProperty pc_compat_1_4[]; -extern const size_t pc_compat_1_4_len; - -/* Helper for setting model-id for CPU models that changed model-id - * depending on QEMU versions up to QEMU 2.4. - */ -#define PC_CPU_MODEL_IDS(v) \ - { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ - { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ - { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, - -#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ - static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ - { \ - MachineClass *mc = MACHINE_CLASS(oc); \ - optsfn(mc); \ - mc->init = initfn; \ - } \ - static const TypeInfo pc_machine_type_##suffix = { \ - .name = namestr TYPE_MACHINE_SUFFIX, \ - .parent = TYPE_PC_MACHINE, \ - .class_init = pc_machine_##suffix##_class_init, \ - }; \ - static void pc_machine_init_##suffix(void) \ - { \ - type_register(&pc_machine_type_##suffix); \ - } \ - type_init(pc_machine_init_##suffix) - extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); #endif diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 291909fa05..7267e9754f 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -64,6 +64,7 @@ #include "hw/acpi/pci.h" #include "qom/qom-qobject.h" +#include "hw/i386/pc_internal.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4c018735b0..df879ff8e5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -26,6 +26,7 @@ #include "qemu/units.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" +#include "hw/i386/pc_internal.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" #include "hw/i386/apic.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 1bd70d1abb..a7f67f39a8 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -29,6 +29,7 @@ #include "hw/loader.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" +#include "hw/i386/pc_internal.h" #include "hw/i386/apic.h" #include "hw/pci-host/i440fx.h" #include "hw/southbridge/piix.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 385e5cffb1..d1d251cb26 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -42,6 +42,7 @@ #include "exec/address-spaces.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" +#include "hw/i386/pc_internal.h" #include "hw/i386/ich9.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index f5f3f466b0..6762a6b453 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -33,6 +33,7 @@ #include "hw/sysbus.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" +#include "hw/i386/pc_internal.h" #include "hw/loader.h" #include "hw/qdev-properties.h" #include "sysemu/sysemu.h" diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 82ece6b9e7..26e6d013d0 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -14,6 +14,7 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" #include "hw/i386/pc.h" +#include "hw/i386/pc_internal.h" #include "hw/southbridge/piix.h" #include "hw/irq.h" #include "hw/hw.h"