From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUUcU-0007GE-IP for qemu-devel@nongnu.org; Tue, 02 Aug 2016 04:00:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUUcT-0004Dk-9V for qemu-devel@nongnu.org; Tue, 02 Aug 2016 04:00:10 -0400 Received: from mail-vk0-x231.google.com ([2607:f8b0:400c:c05::231]:34492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUUcS-0004C3-1e for qemu-devel@nongnu.org; Tue, 02 Aug 2016 04:00:09 -0400 Received: by mail-vk0-x231.google.com with SMTP id s189so116821554vkh.1 for ; Tue, 02 Aug 2016 01:00:07 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160801111433.2af5c013@nial.brq.redhat.com> References: <1468975744-12587-1-git-send-email-kwangwoo.lee@sk.com> <1468975744-12587-2-git-send-email-kwangwoo.lee@sk.com> <79b91f02b26441be993e372cef44002d@nmail01.hynixad.com> <20160801094607.057cef2f@nial.brq.redhat.com> <20160801111433.2af5c013@nial.brq.redhat.com> From: Peter Maydell Date: Tue, 2 Aug 2016 08:59:46 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC PATCH 1/3] hw/arm/virt: add hotplug memory support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: "kwangwoo.lee@sk.com" , Xiao Guangrong , "Michael S. Tsirkin" , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Shannon Zhao , Shannon Zhao , QEMU Developers , qemu-arm , "woosuk.chung@sk.com" , "hyunchul3.kim@sk.com" On 1 August 2016 at 10:14, Igor Mammedov wrote: > On Mon, 1 Aug 2016 09:13:34 +0100 > Peter Maydell wrote: >> On 1 August 2016 at 08:46, Igor Mammedov wrote: >> > 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 We probably don't want to make the memory layout depend on the host architecture, though :-( >> >> > 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. Since that's always larger than TARGET_PAGE_SIZE why are we checking for an alignment here that's not actually sufficient to make things work? thanks -- PMM