From: Stefan Berger <stefanb@linux.ibm.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
qemu-block@nongnu.org,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
qemu-trivial@nongnu.org,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Corey Minyard" <minyard@acm.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"Richard Henderson" <rth@twiddle.net>,
"Kevin Wolf" <kwolf@redhat.com>, "Max Reitz" <mreitz@redhat.com>,
qemu-ppc@nongnu.org, "Igor Mammedov" <imammedo@redhat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition
Date: Sun, 11 Oct 2020 16:28:55 -0400 [thread overview]
Message-ID: <1976a77d-8799-5f2a-1dcb-5c8dbdb21a3f@linux.ibm.com> (raw)
In-Reply-To: <20201011193229.3210774-5-f4bug@amsat.org>
On 10/11/20 3:32 PM, Philippe Mathieu-Daudé wrote:
> The TPM TIS device uses IRQ #5 by default. Add this
> default definition to the IsaIrqNumber enum.
>
> Avoid magic values in the code, replace them by the
> newly introduced definition.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> include/hw/isa/isa.h | 1 +
> hw/i386/acpi-build.c | 2 +-
> hw/ipmi/isa_ipmi_bt.c | 2 +-
> hw/ipmi/isa_ipmi_kcs.c | 2 +-
> hw/tpm/tpm_tis_isa.c | 2 +-
> 5 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
> index 519296d5823..e4f2aed004f 100644
> --- a/include/hw/isa/isa.h
> +++ b/include/hw/isa/isa.h
> @@ -11,6 +11,7 @@
> enum IsaIrqNumber {
> ISA_IRQ_KBD_DEFAULT = 1,
> ISA_IRQ_SER_DEFAULT = 4,
> + ISA_IRQ_TPM_DEFAULT = 5,
> ISA_NUM_IRQS = 16
> };
>
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 45ad2f95334..2b6038ab015 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1886,7 +1886,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> Rewrite to take IRQ from TPM device model and
> fix default IRQ value there to use some unused IRQ
> */
> - /* aml_append(crs, aml_irq_no_flags(TPM_TIS_IRQ)); */
> + /* aml_append(crs, aml_irq_no_flags(ISA_IRQ_TPM_DEFAULT)); */
> aml_append(dev, aml_name_decl("_CRS", crs));
>
> tpm_build_ppi_acpi(tpm, dev);
> diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c
> index b7c2ad557b2..13a92bd2c44 100644
> --- a/hw/ipmi/isa_ipmi_bt.c
> +++ b/hw/ipmi/isa_ipmi_bt.c
> @@ -137,7 +137,7 @@ static void *isa_ipmi_bt_get_backend_data(IPMIInterface *ii)
>
> static Property ipmi_isa_properties[] = {
> DEFINE_PROP_UINT32("ioport", ISAIPMIBTDevice, bt.io_base, 0xe4),
> - DEFINE_PROP_INT32("irq", ISAIPMIBTDevice, isairq, 5),
> + DEFINE_PROP_INT32("irq", ISAIPMIBTDevice, isairq, ISA_IRQ_TPM_DEFAULT),
> DEFINE_PROP_END_OF_LIST(),
> };
>
> diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c
> index 7dd6bf0040a..c956b539688 100644
> --- a/hw/ipmi/isa_ipmi_kcs.c
> +++ b/hw/ipmi/isa_ipmi_kcs.c
> @@ -144,7 +144,7 @@ static void *isa_ipmi_kcs_get_backend_data(IPMIInterface *ii)
>
> static Property ipmi_isa_properties[] = {
> DEFINE_PROP_UINT32("ioport", ISAIPMIKCSDevice, kcs.io_base, 0xca2),
> - DEFINE_PROP_INT32("irq", ISAIPMIKCSDevice, isairq, 5),
> + DEFINE_PROP_INT32("irq", ISAIPMIKCSDevice, isairq, ISA_IRQ_TPM_DEFAULT),
> DEFINE_PROP_END_OF_LIST(),
> };
I don't know what these devices do but this looks like an unwanted clash.
> diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c
> index 6fd876eebf1..5a4afda42df 100644
> --- a/hw/tpm/tpm_tis_isa.c
> +++ b/hw/tpm/tpm_tis_isa.c
> @@ -91,7 +91,7 @@ static void tpm_tis_isa_reset(DeviceState *dev)
> }
>
> static Property tpm_tis_isa_properties[] = {
> - DEFINE_PROP_UINT32("irq", TPMStateISA, state.irq_num, TPM_TIS_IRQ),
> + DEFINE_PROP_UINT32("irq", TPMStateISA, state.irq_num, ISA_IRQ_TPM_DEFAULT),
> DEFINE_PROP_TPMBE("tpmdev", TPMStateISA, state.be_driver),
> DEFINE_PROP_BOOL("ppi", TPMStateISA, state.ppi_enabled, true),
> DEFINE_PROP_END_OF_LIST(),
next prev parent reply other threads:[~2020-10-11 20:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-11 19:32 [PATCH 00/10] hw/isa: Introduce definitions for default IRQ values Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 01/10] hw/isa: Introduce IsaIrqNumber enum Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 02/10] hw/isa: Add the ISA_IRQ_KBD_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 03/10] hw/isa: Add the ISA_IRQ_SER_DEFAULT definition Philippe Mathieu-Daudé
2020-10-13 7:14 ` Gerd Hoffmann
2020-10-11 19:32 ` [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 20:28 ` Stefan Berger [this message]
2020-10-11 21:07 ` Philippe Mathieu-Daudé
2020-10-13 7:20 ` Gerd Hoffmann
2020-10-13 8:26 ` Philippe Mathieu-Daudé
2020-10-13 14:23 ` Stefan Berger
2020-10-11 19:32 ` [PATCH 05/10] hw/isa: Add the ISA_IRQ_FDC_DEFAULT definition Philippe Mathieu-Daudé
2020-10-12 14:17 ` John Snow
2020-10-11 19:32 ` [PATCH 06/10] hw/isa: Add the ISA_IRQ_PAR_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 07/10] hw/isa: Add the ISA_IRQ_RTC_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition Philippe Mathieu-Daudé
2020-10-13 7:23 ` Gerd Hoffmann
2020-10-13 8:27 ` Philippe Mathieu-Daudé
2020-10-13 14:20 ` Stefan Berger
2020-10-11 19:32 ` [PATCH 09/10] hw/isa: Add the ISA_IRQ_MOU_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition Philippe Mathieu-Daudé
2020-10-12 14:16 ` John Snow
2020-10-13 7:25 ` Gerd Hoffmann
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=1976a77d-8799-5f2a-1dcb-5c8dbdb21a3f@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=hpoussin@reactos.org \
--cc=imammedo@redhat.com \
--cc=jasowang@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=minyard@acm.org \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanb@linux.vnet.ibm.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).