Hi, Thank you for the alignment information and discussion, Igor and Peter!
I'll try to find out proper alignment by looking at the codes. Best Regards, Kwangwoo Lee > -----Original Message----- > From: Igor Mammedov [mailto:imamm...@redhat.com] > Sent: Monday, August 01, 2016 6:15 PM > To: Peter Maydell > Cc: 이광우(LEE KWANGWOO) MS SW; Xiao Guangrong; Michael S. Tsirkin; Paolo > Bonzini; Richard Henderson; > Eduardo Habkost; Shannon Zhao; Shannon Zhao; QEMU Developers; qemu-arm; > 정우석(CHUNG WOO SUK) MS SW; 김 > 현철(KIM HYUNCHUL) MS SW > Subject: Re: [RFC PATCH 1/3] hw/arm/virt: add hotplug memory support > > On Mon, 1 Aug 2016 09:13:34 +0100 > Peter Maydell <peter.mayd...@linaro.org> wrote: > > > On 1 August 2016 at 08:46, Igor Mammedov <imamm...@redhat.com> wrote: > > > On Mon, 1 Aug 2016 00:35:35 +0000 > > > "kwangwoo....@sk.com" <kwangwoo....@sk.com> wrote: > > > > >> > > +/* 1GB alignment for hotplug memory region */ > > >> > > +#define ARCH_VIRT_HOTPLUG_MEM_ALIGN (1ULL << 30) > > >> > > > >> > Where does the 1GB alignment come from? Why do we need 1GB > > >> > alignment for the base but only 1KB alignment for the size? > > >> > > >> The alignment value of hotplug_memory.base referred from i386 pc.c and > > >> ppc spapr.c. > > >> Could you suggest a proper range for this? > > > > > Base alignment comes from max supported hugepage size, > > > > Max hugepage size for any host? (if so, should be defined > > in a common header somewhere) > > Max hugepage size for ARM hosts? (if so, why is TCG > > different from KVM?, and should still be in a common > > header somewhere) > It's the same for TCG but it probably doesn't matter much there, > main usage is to provide better performance with KVM. > > So I'd say it's host depended (for x86 it's 1Gb), > probably other values for ARM and PPC > > > > > > while > > > size alignment should depend on backend's page size > > > > Which page size do you have in mind here? TARGET_PAGE_SIZE > > is often not the right answer, since it doesn't > > correspond either to the actual page size being used > > by the host kernel or to the actual page size used > > by the guest kernel... > alignment comes from here: memory_region_get_alignment() > > exec:c > MAX(page_size, QEMU_VMALLOC_ALIGN) > so it's either backend's page size or a min chunk QEMU > allocates memory to make KVM/valgrind/whatnot happy. > > > > > thanks > > -- PMM