qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Sergio Lopez <slp@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	kvm@vger.kernel.org, Paul Durrant <paul@xen.org>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	xen-devel@lists.xenproject.org,
	Anthony Perard <anthony.perard@citrix.com>,
	Igor Mammedov <imammedo@redhat.com>,
	qemu-block@nongnu.org, John Snow <jsnow@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h'
Date: Mon, 16 Dec 2019 16:37:59 +0100	[thread overview]
Message-ID: <0d15c735-73b4-7875-ec0f-8c181508f0d4@redhat.com> (raw)
In-Reply-To: <20191215045812-mutt-send-email-mst@kernel.org>

On 12/15/19 10:58 AM, Michael S. Tsirkin wrote:
> On Fri, Dec 13, 2019 at 05:47:28PM +0100, Philippe Mathieu-Daudé wrote:
>> On 12/13/19 5:17 PM, Philippe Mathieu-Daudé wrote:
>>> 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é <philmd@redhat.com>
>>> ---
>>> Maybe name it 'pc_machine.h'?
>>
>> I forgot to describe here (and in the cover), what's follow after this
>> patch.
>>
>> Patch #13 moves PCMachineClass to
>>
>> If you ignore PCMachineState, "hw/i386/pc.h" now only contains 76 lines, and
>> it is easier to see what is PC machine specific, what is X86 specific, and
>> what is device generic (not X86 related at all):
>>
>> - GSI is common to X86 (Paolo sent [3], [6])
>> - IOAPIC is common to X86
>> - i8259 is multiarch (Paolo [2])
>> - PCI_HOST definitions and pc_pci_hole64_start() are X86
>> - pc_machine_is_smm_enabled() is X86 (Paolo sent [5])
>> - hpet
>> - tsc (Paolo sent [3])
>> - 3 more functions
>>
>> So we can move half of this file to "pc_internal.h" and the other to
>>
>> One problem is the Q35 MCH north bridge which directly sets the PCI
>> PCMachineState->bus in q35_host_realize(). This seems a QOM violation and is
>> probably easily fixable.
>>
>> Maybe I can apply Paolo's patches instead of this #12, move X86-generic
>> declarations to "hw/i386/x86.h", and directly git-move what's left of
>> "hw/i386/pc.h" to "pc_internal.h".
> 
> Yea that sounds a bit better.

OK, I'll wait for Paolo's next pull get in, then continue based on that, 
including Paolo's "x86: allow building without PC machine types" series.

(Thanks Paolo for picking most of this series!)



  reply	other threads:[~2019-12-16 15:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 16:17 [PATCH 00/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h' Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 01/12] hw/i386/pc: Convert DPRINTF() to trace events Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 02/12] hw/i386/pc: Move kvm_i8259_init() declaration to sysemu/kvm.h Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 03/12] hw/i386/pc: Remove obsolete pc_pci_device_init() declaration Philippe Mathieu-Daudé
2019-12-16 13:08   ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 04/12] hw/i386/pc: Remove obsolete cpu_set_smm_t typedef Philippe Mathieu-Daudé
2019-12-16 13:09   ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 05/12] hw/i386/ich9: Remove unused include Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 06/12] hw/i386/ich9: Move unnecessary "pci_bridge.h" include Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 07/12] hw/ide/piix: Remove superfluous DEVICE() cast Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 08/12] hw/ide/piix: Use ARRAY_SIZE() instead of magic numbers Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 09/12] hw/intc/ioapic: Make ioapic_print_redtbl() static Philippe Mathieu-Daudé
2019-12-16 13:11   ` Paolo Bonzini
2019-12-13 16:17 ` [PATCH 10/12] hw/i386/pc: Rename allocate_cpu_irq from 'pc' to 'x86_machine' Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 11/12] hw/i386/pc: Move x86_machine_allocate_cpu_irq() to 'hw/i386/x86.c' Philippe Mathieu-Daudé
2019-12-13 16:17 ` [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h' Philippe Mathieu-Daudé
2019-12-13 16:47   ` Philippe Mathieu-Daudé
2019-12-15  9:58     ` Michael S. Tsirkin
2019-12-16 15:37       ` Philippe Mathieu-Daudé [this message]
2019-12-16 15:41         ` Paolo Bonzini
2019-12-16 15:48           ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d15c735-73b4-7875-ec0f-8c181508f0d4@redhat.com \
    --to=philmd@redhat.com \
    --cc=anthony.perard@citrix.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=slp@redhat.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).