* Alignment issue with transparent huge pages
@ 2012-10-30 1:43 Christoffer Dall
2012-10-30 9:48 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Christoffer Dall @ 2012-10-30 1:43 UTC (permalink / raw)
To: KVM General; +Cc: Marc Zyngier, Steve Capper, Will Deacon
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?
Thanks,
-Christoffer
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Alignment issue with transparent huge pages
2012-10-30 1:43 Alignment issue with transparent huge pages Christoffer Dall
@ 2012-10-30 9:48 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2012-10-30 9:48 UTC (permalink / raw)
To: Christoffer Dall; +Cc: KVM General, Marc Zyngier, Steve Capper, Will Deacon
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-30 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-30 1:43 Alignment issue with transparent huge pages Christoffer Dall
2012-10-30 9:48 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).