From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Alignment issue with transparent huge pages Date: Tue, 30 Oct 2012 11:48:31 +0200 Message-ID: <508FA26F.6040603@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: KVM General , Marc Zyngier , Steve Capper , Will Deacon To: Christoffer Dall Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757055Ab2J3Jsq (ORCPT ); Tue, 30 Oct 2012 05:48:46 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 10/30/2012 03:43 AM, Christoffer Dall wrote: > Hi, > > I am seeing an interesting case on KVM/ARM where a user memory region > is not aligned with the guest physical memory address with respect to > huge page size. This clearly makes it impossible for us to leverage > transparent huge pages for stage-2 mappings on ARM. > > The question is, if this is simply something to check for inside KVM > and hope that user space aligns its memory allocations, or if this is > supposed to be forced somehow, or if I'm missing a bigger picture all > together? A #ifdef needs changing: #if defined(__linux__) && defined(__x86_64__) /* Use 2 MiB alignment so transparent hugepages can be used by KVM. Valgrind does not support alignments larger than 1 MiB, therefore we need special code which handles running on Valgrind. */ # define QEMU_VMALLOC_ALIGN (512 * 4096) # define CONFIG_VALGRIND #elif defined(__linux__) && defined(__s390x__) /* Use 1 MiB (segment size) alignment so gmap can be used by KVM. */ # define QEMU_VMALLOC_ALIGN (256 * 4096) #else # define QEMU_VMALLOC_ALIGN getpagesize() #endif -- error compiling committee.c: too many arguments to function