From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: Guest memory access within hypervisor Inbox x Date: Fri, 27 Sep 2013 12:10:37 +0200 Message-ID: <20130927101037.GD9972@stefanha-thinkpad.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Piyus Kedia Return-path: Received: from mail-wi0-f173.google.com ([209.85.212.173]:47688 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805Ab3I0KKl (ORCPT ); Fri, 27 Sep 2013 06:10:41 -0400 Received: by mail-wi0-f173.google.com with SMTP id hq15so569117wib.12 for ; Fri, 27 Sep 2013 03:10:40 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 27, 2013 at 03:19:28AM +0530, Piyus Kedia wrote: > I am working on record replay in KVM. I just want to confirm that KVM > doesn't access guest memory except for DMA. The functions > kvm_read_guest_page() and kvm_write_guest_page() in kvm_main.c are > only used for mmio emulation which access memory that is always > emulated. It will be nice if somebody else also confirm this. kvmclock comes to mind, I think it has a shared page between the guest and the host kernel where clock updates are published from host -> guest. I think kvmclock can be disabled by choosing another clocksource in the guest Linux kernel. There are other exceptions like the ivshmem device which is rarely used but can provide shared memory between guest <-> host or guest <-> guest. I think that memory is an MMIO PCI BAR in the guest just that neither kvm.ko nor QEMU may be catch the update if another process on the host is writing to it. Stefan