]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
xen vtpm: Initialize the comms ring with zeroes.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 8 Jan 2008 09:55:29 +0000 (09:55 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 8 Jan 2008 09:55:29 +0000 (09:55 +0000)
Initialize the ring with zeroes on the backend side and on the
frontend set the 'unused' member to zeroes.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
drivers/char/tpm/tpm_xen.c
drivers/xen/tpmback/interface.c

index d6628335b7fd042ba39e87d1ba7ec65ab29817d4..a0ac589675361a2d31dc93c61872e35ba1ce98de 100644 (file)
@@ -617,6 +617,7 @@ static int tpm_xmit(struct tpm_private *tp,
                tx = &tp->tx->ring[i].req;
                tx->addr = virt_to_machine(txb->data);
                tx->size = txb->len;
+               tx->unused = 0;
 
                DPRINTK("First 4 characters sent by TPM-FE are "
                        "0x%02x 0x%02x 0x%02x 0x%02x\n",
index 3ae227a01bbe7bfa2d4e75ae0ed0c03832b4c212..604f69eb88ed554d9738513477a529d8a05815fd 100644 (file)
@@ -126,6 +126,7 @@ int tpmif_map(tpmif_t *tpmif, unsigned long shared_page, unsigned int evtchn)
        }
 
        tpmif->tx = (tpmif_tx_interface_t *)tpmif->tx_area->addr;
+       memset(tpmif->tx, 0, PAGE_SIZE);
 
        err = bind_interdomain_evtchn_to_irqhandler(
                tpmif->domid, evtchn, tpmif_be_int, 0, tpmif->devname, tpmif);