From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzjVm-00058L-4C for qemu-devel@nongnu.org; Tue, 11 Sep 2018 10:19:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzjVh-00085v-2c for qemu-devel@nongnu.org; Tue, 11 Sep 2018 10:19:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42364 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzjVg-00084J-T3 for qemu-devel@nongnu.org; Tue, 11 Sep 2018 10:19:20 -0400 References: <20180904084648.680c564b@redhat.com> <20180906095802.7dffbf1b@redhat.com> <20180906085937.GA2639@work-vm> <20180906094245.GB2639@work-vm> <20180906172304.GF2639@work-vm> <43c91014-2ca4-681b-51e7-b8cde063014c@redhat.com> <20180910104408.GE2482@work-vm> From: Laszlo Ersek Message-ID: Date: Tue, 11 Sep 2018 16:19:13 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v10 6/6] tpm: add ACPI memory clear interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , "Dr. David Alan Gilbert" Cc: Eduardo Habkost , "Michael S. Tsirkin" , Stefan Berger , QEMU , Paolo Bonzini , Igor Mammedov , Richard Henderson , Alex Williamson +Alex, due to mention of 21e00fa55f3fd On 09/10/18 15:03, Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > On Mon, Sep 10, 2018 at 2:44 PM Dr. David Alan Gilbert > wrote: >> (I didn't know about guest_phys_block* and would have probably just us= ed >> qemu_ram_foreach_block ) >> >=20 > guest_phys_block*() seems to fit, as it lists only the blocks actually > used, and already skip the device RAM. >=20 > Laszlo, you wrote the functions > (https://git.qemu.org/?p=3Dqemu.git;a=3Dcommit;h=3Dc5d7f60f0614250bd925= 071e25220ce5958f75d0), > do you think it's appropriate to list the memory to clear, or we > should rather use qemu_ram_foreach_block() ? Originally, I would have said, "use either, doesn't matter". Namely, when I introduced the guest_phys_block*() functions, the original purpose was not related to RAM *contents*, but to RAM *addresses* (GPAs). This is evident if you look at the direct child commit of c5d7f60f0614, namely 56c4bfb3f07f, which put GuestPhysBlockList to use. And, for your use case (=3D wiping RAM), GPAs don't matter, only contents matter. However, with the commits I mentioned previously, namely e4dc3f5909ab9 and 21e00fa55f3fd, we now filter out some RAM blocks from the dumping based on contents / backing as well. I think? So I believe we should honor that for the wiping to. I guess I'd (vaguely) suggest using guest_phys_block*(). (And then, as Dave suggests, maybe extend the filter to consider pmem too, separately.) Laszlo