From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0WIw-0002iL-HZ for qemu-devel@nongnu.org; Mon, 05 Sep 2011 06:21:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0WIv-0006I9-KI for qemu-devel@nongnu.org; Mon, 05 Sep 2011 06:21:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0WIv-0006I4-BG for qemu-devel@nongnu.org; Mon, 05 Sep 2011 06:21:25 -0400 Message-ID: <4E64A2A1.9060801@redhat.com> Date: Mon, 05 Sep 2011 13:21:21 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1315210025-17727-1-git-send-email-avi@redhat.com> <4E64A02B.9030502@siemens.com> In-Reply-To: <4E64A02B.9030502@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu_vmalloc: align properly for transparent hugepages and KVM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On 09/05/2011 01:10 PM, Jan Kiszka wrote: > On 2011-09-05 10:07, Avi Kivity wrote: > > To make good use of transparent hugepages, KVM requires that guest-physical > > and host-virtual addresses share the low 21 bits (as opposed to just the low > > 12 bits normally required). > > > > Adjust qemu_vmalloc() to honor that requirement. Ignore it for small regions > > to avoid fragmentation. > > > > Signed-off-by: Avi Kivity > > --- > > oslib-posix.c | 14 +++++++++++++- > > 1 files changed, 13 insertions(+), 1 deletions(-) > > > > diff --git a/oslib-posix.c b/oslib-posix.c > > index 196099c..a304fb0 100644 > > --- a/oslib-posix.c > > +++ b/oslib-posix.c > > @@ -35,6 +35,13 @@ > > extern int daemon(int, int); > > #endif > > > > +#if defined(__linux__)&& defined(__x86_64__) > > + /* Use 2MB alignment so transparent hugepages can be used by KVM */ > > Aren't transparent hugepages also available in TCG mode? Then just > remove "by KVM" from subject and comment. They are, but they don't require the special alignment. -- error compiling committee.c: too many arguments to function