From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] kvm: Fix memory slot page alignment logic Date: Mon, 10 Nov 2014 14:54:49 +0100 Message-ID: <5460C3A9.30706@redhat.com> References: <1415395125-18926-1-git-send-email-agraf@suse.de> <20141110133101.194f5ea0@nial.usersys.redhat.com> <5460BACA.9000702@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: qemu-ppc@nongnu.org, stuart.yoder@freescale.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, qemu-stable@nongnu.org To: Alexander Graf , Igor Mammedov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52865 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752629AbaKJNzC (ORCPT ); Mon, 10 Nov 2014 08:55:02 -0500 In-Reply-To: <5460BACA.9000702@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 10/11/2014 14:16, Alexander Graf wrote: > No, because in that case you would map something as RAM that really > isn't RAM. > > Imagine you have the following memory layout: > > 0x1000 page size > > 1) 0x00000 - 0x10000 RAM > 2) 0x10000 - 0x10100 MMIO > 3) 0x10100 - 0x20000 RAM > > Then you want to map 1) as memory slot and 4) from 0x11000 onwards as > memory slot. > > You can't map the page from 0x10000 - 0x11000 as memory slot, because > part of it is MMIO. Right. The partial RAM page remains marked as MMIO as far as KVM is concerned, so accesses are slow and you cannot run code from it. However, it is fundamental that MMIO areas are not marked as RAM. Paolo