From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjwmr-00025N-S0 for qemu-devel@nongnu.org; Tue, 13 Sep 2016 19:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjwmn-0006OZ-MJ for qemu-devel@nongnu.org; Tue, 13 Sep 2016 19:06:45 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjwmn-0006ON-Ff for qemu-devel@nongnu.org; Tue, 13 Sep 2016 19:06:41 -0400 Received: by mail-wm0-f68.google.com with SMTP id b184so578836wma.3 for ; Tue, 13 Sep 2016 16:06:41 -0700 (PDT) Sender: Paolo Bonzini References: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> <147377816100.11859.1924921034992764815.stgit@brijesh-build-machine> From: Paolo Bonzini Message-ID: <1911fbd8-4476-c733-2972-0210a0afff80@redhat.com> Date: Wed, 14 Sep 2016 01:05:37 +0200 MIME-Version: 1.0 In-Reply-To: <147377816100.11859.1924921034992764815.stgit@brijesh-build-machine> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v1 15/22] i386: sev: register RAM read/write ops for BIOS and PC.RAM region List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Brijesh Singh , ehabkost@redhat.com, crosthwaite.peter@gmail.com, armbru@redhat.com, mst@redhat.com, p.fedin@samsung.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, rth@twiddle.net On 13/09/2016 16:49, Brijesh Singh wrote: > > + /* Register SEV read/write ops for the guest RAM */ > + if (kvm_sev_enabled()) > + memory_region_set_ram_ops(ram, kvm_sev_get_ram_ops()); If you don't actually need this one except for -kernel it would be very nice, because then the hooks could be limited to cpu_memory_rw_debug. address_space_write and address_space_read are the central entry point for device DMA, and calling mr->ram_ops->write from there seems very wrong. I'd rather make those hooks *ROM* read/write ops rather than RAM read/write ops. Paolo