From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Thomas Huth <thuth@redhat.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Bernhard Beschow <shentey@gmail.com>
Cc: Michael S Tsirkin <mst@redhat.com>, BALATON Zoltan <balaton@eik.bme.hu>
Subject: Re: [PATCH v3] hw/rtc/mc146818rtc: Make this rtc device target independent
Date: Mon, 12 Dec 2022 16:44:29 +0100 [thread overview]
Message-ID: <02e4ebf7-908b-28f6-9f90-d917ee2b307b@linaro.org> (raw)
In-Reply-To: <dd94d639-ff48-554a-c462-ae7fe2399d4e@redhat.com>
On 12/12/22 14:48, Thomas Huth wrote:
> On 12/12/2022 14.39, Mark Cave-Ayland wrote:
>> On 12/12/2022 07:56, Thomas Huth wrote:
>>
>>> The only reason for this code being target dependent is the apic-related
>>> code in rtc_policy_slew_deliver_irq(). Since these apic functions are
>>> rather
>>> simple, we can easily move them into a new, separate file
>>> (apic_irqcount.c)
>>> which will always be compiled and linked if either APIC or the
>>> mc146818 device
>>> are required. This way we can get rid of the #ifdef TARGET_I386
>>> switches in
>>> mc146818rtc.c and declare it in the softmmu_ss instead of
>>> specific_ss, so
>>> that the code only gets compiled once for all targets.
>>>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>> v3: Move TYPE_APIC_COMMON from apic_internal.h to apic.h and use it
>>>
>>> include/hw/i386/apic.h | 2 ++
>>> include/hw/i386/apic_internal.h | 2 --
>>> include/hw/rtc/mc146818rtc.h | 1 +
>>> hw/intc/apic_common.c | 27 -----------------
>>> hw/intc/apic_irqcount.c | 53 +++++++++++++++++++++++++++++++++
>>> hw/rtc/mc146818rtc.c | 25 +++++-----------
>>> hw/intc/meson.build | 6 +++-
>>> hw/rtc/meson.build | 3 +-
>>> 8 files changed, 69 insertions(+), 50 deletions(-)
>>> create mode 100644 hw/intc/apic_irqcount.c
>>>
>>> diff --git a/include/hw/i386/apic.h b/include/hw/i386/apic.h
>>> index da1d2fe155..24069fb961 100644
>>> --- a/include/hw/i386/apic.h
>>> +++ b/include/hw/i386/apic.h
>>> @@ -1,6 +1,7 @@
>>> #ifndef APIC_H
>>> #define APIC_H
>>> +#define TYPE_APIC_COMMON "apic-common"
>>
>> Ah sorry, I should have been more specific here: what I was suggesting
>> was to move the entire QOM type information into apic.h as per the
>> normal convention, as opposed to just the #define. At first glance
>> that would involve lines 128-190 in apic_internal.h which would also
>> bring in APICCommonClass and APICCommonState - possibly the change may
>> warrant its own commit.
>
> At least APICCommonState is target specific since it uses "X86CPU" ...
Replace it by ArchCPU ;)
> so moving that to apic.h would be very counterproductive here.
>
> Anyway, moving those structs is certainly way more than what is required
> for this patch, so if we decide to move anything else related to the
> APIC, it should be done in a separate patch later.
I concur.
next prev parent reply other threads:[~2022-12-12 15:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 7:56 [PATCH v3] hw/rtc/mc146818rtc: Make this rtc device target independent Thomas Huth
2022-12-12 8:03 ` Philippe Mathieu-Daudé
2022-12-12 13:39 ` Mark Cave-Ayland
2022-12-12 13:48 ` Thomas Huth
2022-12-12 15:44 ` Philippe Mathieu-Daudé [this message]
2022-12-12 16:26 ` Mark Cave-Ayland
2022-12-16 14:26 ` Bernhard Beschow
2022-12-29 10:44 ` Thomas Huth
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=02e4ebf7-908b-28f6-9f90-d917ee2b307b@linaro.org \
--to=philmd@linaro.org \
--cc=balaton@eik.bme.hu \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
--cc=thuth@redhat.com \
/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).