qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	marcandre.lureau@gmail.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PULL v1 02/21] tpm-tis: remove RAISE_STS_IRQ
Date: Thu, 19 Oct 2017 14:02:36 -0400	[thread overview]
Message-ID: <1508436175-1596-3-git-send-email-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1508436175-1596-1-git-send-email-stefanb@linux.vnet.ibm.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

This look like temporary hacking code. It shouldn't be necessary in
release code, or there should be a runtime option for it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
---
 hw/tpm/tpm_tis.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index a9e9cbd..c54dac3 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -43,9 +43,6 @@
     } \
 } while (0);
 
-/* whether the STS interrupt is supported */
-#define RAISE_STS_IRQ
-
 /* tis registers */
 #define TPM_TIS_REG_ACCESS                0x00
 #define TPM_TIS_REG_INT_ENABLE            0x08
@@ -98,21 +95,11 @@
 #define TPM_TIS_INT_POLARITY_MASK         (3 << 3)
 #define TPM_TIS_INT_POLARITY_LOW_LEVEL    (1 << 3)
 
-#ifndef RAISE_STS_IRQ
-
-#define TPM_TIS_INTERRUPTS_SUPPORTED (TPM_TIS_INT_LOCALITY_CHANGED | \
-                                      TPM_TIS_INT_DATA_AVAILABLE   | \
-                                      TPM_TIS_INT_COMMAND_READY)
-
-#else
-
 #define TPM_TIS_INTERRUPTS_SUPPORTED (TPM_TIS_INT_LOCALITY_CHANGED | \
                                       TPM_TIS_INT_DATA_AVAILABLE   | \
                                       TPM_TIS_INT_STS_VALID | \
                                       TPM_TIS_INT_COMMAND_READY)
 
-#endif
-
 #define TPM_TIS_CAP_INTERFACE_VERSION1_3 (2 << 28)
 #define TPM_TIS_CAP_INTERFACE_VERSION1_3_FOR_TPM2_0 (3 << 28)
 #define TPM_TIS_CAP_DATA_TRANSFER_64B    (3 << 9)
@@ -377,12 +364,8 @@ static void tpm_tis_receive_bh(void *opaque)
         tpm_tis_abort(s, locty);
     }
 
-#ifndef RAISE_STS_IRQ
-    tpm_tis_raise_irq(s, locty, TPM_TIS_INT_DATA_AVAILABLE);
-#else
     tpm_tis_raise_irq(s, locty,
                       TPM_TIS_INT_DATA_AVAILABLE | TPM_TIS_INT_STS_VALID);
-#endif
 }
 
 /*
@@ -421,9 +404,7 @@ static uint32_t tpm_tis_data_read(TPMState *s, uint8_t locty)
         if (tis->loc[locty].r_offset >= len) {
             /* got last byte */
             tpm_tis_sts_set(&tis->loc[locty], TPM_TIS_STS_VALID);
-#ifdef RAISE_STS_IRQ
             tpm_tis_raise_irq(s, locty, TPM_TIS_INT_STS_VALID);
-#endif
         }
         DPRINTF("tpm_tis: tpm_tis_data_read byte 0x%02x   [%d]\n",
                 ret, tis->loc[locty].r_offset-1);
@@ -912,9 +893,8 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
             if (tis->loc[locty].w_offset > 5 &&
                 (tis->loc[locty].sts & TPM_TIS_STS_EXPECT)) {
                 /* we have a packet length - see if we have all of it */
-#ifdef RAISE_STS_IRQ
                 bool need_irq = !(tis->loc[locty].sts & TPM_TIS_STS_VALID);
-#endif
+
                 len = tpm_tis_get_size_from_buffer(&tis->loc[locty].w_buffer);
                 if (len > tis->loc[locty].w_offset) {
                     tpm_tis_sts_set(&tis->loc[locty],
@@ -923,11 +903,9 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
                     /* packet complete */
                     tpm_tis_sts_set(&tis->loc[locty], TPM_TIS_STS_VALID);
                 }
-#ifdef RAISE_STS_IRQ
                 if (need_irq) {
                     tpm_tis_raise_irq(s, locty, TPM_TIS_INT_STS_VALID);
                 }
-#endif
             }
         }
         break;
-- 
2.5.5

  parent reply	other threads:[~2017-10-19 18:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 18:02 [Qemu-devel] [PULL v1 00/21] Merge tpm 2017/10/19 Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 01/21] tpm-tis: remove unused hw_access argument Stefan Berger
2017-10-19 18:02 ` Stefan Berger [this message]
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 03/21] tpm: make tpm_get_backend_driver() static Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 04/21] tpm: lookup tpm backend class in tpm_driver_find_by_type() Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 05/21] tpm: replace tpm_get_backend_driver() to drop be_drivers Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 06/21] tpm: remove tpm_register_driver() Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 07/21] tpm: move TPMSizedBuffer to tpm_tis.h Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 08/21] tpm: remove TPMDriverOps Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 09/21] tpm: remove init() class method Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 10/21] tpm: remove configure_tpm() hop Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 11/21] tpm: remove unused TPMBackendCmd Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 12/21] tpm: remove needless cast Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 13/21] tpm: remove locty argument from receive_cb Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 14/21] tpm: add TPMBackendCmd to hold the request state Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 15/21] tpm-emulator: fix error handling Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 16/21] tpm: remove locty_data from TPMState Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 17/21] tpm-tis: move TPMState to TIS header Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 18/21] tpm-tis: remove tpm_tis.h header Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 19/21] tpm-tis: fold TPMTISEmuState in TPMState Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 20/21] tpm: add a QOM TPM interface Stefan Berger
2017-10-19 18:02 ` [Qemu-devel] [PULL v1 21/21] tpm: move recv_data_callback to " Stefan Berger
2017-10-20 11:33 ` [Qemu-devel] [PULL v1 00/21] Merge tpm 2017/10/19 Peter Maydell

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=1508436175-1596-3-git-send-email-stefanb@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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).