From: Juan Quintela <quintela@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Igor Mammedov <imammedo@redhat.com>, QEMU <qemu-devel@nongnu.org>,
xiaoguangrong@tencent.com, Eduardo Habkost <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v10 3/6] tpm: allocate/map buffer for TPM Physical Presence interface
Date: Wed, 05 Sep 2018 10:36:27 +0200 [thread overview]
Message-ID: <87in3kfiic.fsf@trasno.org> (raw)
In-Reply-To: <CAJ+F1CKaRhO8sGf51SHf1mrL=RA+NmCdtLdPcpMrcufp4wfB3w@mail.gmail.com> ("Marc-André Lureau"'s message of "Wed, 5 Sep 2018 12:21:39 +0400")
Marc-André Lureau <marcandre.lureau@gmail.com> wrote:
Hi
>> > Physical RAM is multiple of TARGET_PAGE_SIZE O:-)
>> > That assumtion is held in too many places, if you can change the size to
>> > be multiple of page size, that would be greate.
>
> It needs the RAMBlock to be a multiple of TARGET_PAGE_SIZE, but the
> memory region (in guest and qemu MemoryRegion) can be less. This is
> already the case with for ex, "/rom@etc/acpi/rsdp", which is 36 bytes.
>
> I suppose 2 different MemoryRegions (backed by different RAMBlock)
> that would be placed on the same page (for ex, at offset 0x0, size
> 0x10 and offset 0x10, size 0x100) would work fine in general and with
> migration?
Honestly I don't know. But if the ramblock is correct, I think that we
have no problem at all. Migration code just does:
for each ramblock
for each page in ramblock
(Yes, I know, I have oversimplified)
>> > > Should the migration code be fixed, or should the TPM code allocate
>> > > ram differently?
>> >
>> > Migration people (i.e. me) would preffer that you fix the TPM
>> > allocation. Or you can decide that this is *not* RAM. The unit of
>> > transfer for migrate ram is ram pages, a.k.a. TARGET_PAGE_SIZE.
>> I'd loath to waste whole page in already cramped area.
>> Can we implement it as mmio region? (it will add some bolerplate
>> code for read/write
>> handlers/migration and cause vmexits on every read/write but it's
>> not a hot path so we might not care)
>>
>
>
> I have done some small adjustments to allow
> memory_region_init_ram_device_ptr() to work with a MemoryRegions size
> != backed RAMBlock, and it seems to work fine (and doesn't need to
> allocate more space of guest memory range, or fall back to mmio)
If the ramblock are full pages, everything should be ok.
Later, Juan.
next prev parent reply other threads:[~2018-09-05 8:50 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 17:24 [Qemu-devel] [PATCH v10 0/6] Add support for TPM Physical Presence interface Marc-André Lureau
2018-08-31 17:24 ` [Qemu-devel] [PATCH v10 1/6] hw/i386: add pc-i440fx-3.1 & pc-q35-3.1 Marc-André Lureau
2018-08-31 17:24 ` [Qemu-devel] [PATCH v10 2/6] tpm: add a "ppi" boolean property Marc-André Lureau
2018-08-31 17:24 ` [Qemu-devel] [PATCH v10 3/6] tpm: allocate/map buffer for TPM Physical Presence interface Marc-André Lureau
2018-08-31 23:28 ` Marc-André Lureau
2018-09-03 21:48 ` Juan Quintela
2018-09-04 6:51 ` Igor Mammedov
2018-09-05 8:21 ` Marc-André Lureau
2018-09-05 8:36 ` Juan Quintela [this message]
2018-09-05 9:17 ` Igor Mammedov
2018-08-31 17:24 ` [Qemu-devel] [PATCH v10 4/6] acpi: expose TPM/PPI configuration parameters to firmware via fw_cfg Marc-André Lureau
2018-08-31 17:24 ` [Qemu-devel] [PATCH v10 5/6] acpi: build TPM Physical Presence interface Marc-André Lureau
2018-08-31 17:24 ` [Qemu-devel] [PATCH v10 6/6] tpm: add ACPI memory clear interface Marc-André Lureau
2018-09-04 6:46 ` Igor Mammedov
2018-09-06 3:50 ` Marc-André Lureau
2018-09-06 7:58 ` Igor Mammedov
2018-09-06 8:01 ` Marc-André Lureau
2018-09-06 8:40 ` Igor Mammedov
2018-09-06 8:59 ` Dr. David Alan Gilbert
2018-09-06 9:11 ` Marc-André Lureau
2018-09-06 9:42 ` Dr. David Alan Gilbert
2018-09-06 16:50 ` Marc-André Lureau
2018-09-06 17:23 ` Dr. David Alan Gilbert
2018-09-06 18:58 ` Laszlo Ersek
2018-09-10 10:44 ` Dr. David Alan Gilbert
2018-09-10 13:03 ` Marc-André Lureau
2018-09-11 14:19 ` Laszlo Ersek
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=87in3kfiic.fsf@trasno.org \
--to=quintela@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanb@linux.vnet.ibm.com \
--cc=xiaoguangrong@tencent.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.