From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43591 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHEFX-00068A-IM for qemu-devel@nongnu.org; Wed, 26 May 2010 06:54:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHEFS-0003uP-DG for qemu-devel@nongnu.org; Wed, 26 May 2010 06:54:07 -0400 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:56082 helo=TX2EHSOBE005.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHEFS-0003u0-9s for qemu-devel@nongnu.org; Wed, 26 May 2010 06:54:06 -0400 Message-ID: <4BFCFD6D.8090005@amd.com> Date: Wed, 26 May 2010 12:52:29 +0200 From: Andre Przywara MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] resent: x86/cpuid: propagate further CPUID leafs when -cpu host References: <1274428240-10801-1-git-send-email-andre.przywara@amd.com> <4BFAF941.1010604@codemonkey.ws> <4BFBCEEA.4030101@amd.com> <4BFBCFF0.70506@codemonkey.ws> In-Reply-To: <4BFBCFF0.70506@codemonkey.ws> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "avi@redhat.com" , "aurelien@aurel32.net" , "qemu-devel@nongnu.org" Anthony Liguori wrote: > On 05/25/2010 08:21 AM, Andre Przywara wrote: >>> What's the benefit of exposing this information to the guest? >> That is mostly to propagate the cache size and organization parameters >> to the guest: >>>> +/* safe CPUID leafs to propagate to guest if -cpu host is specified >>>> + * Intel defined leafs: >>>> + * Cache descriptors (0x02) >>>> + * Deterministic cache parameters (0x04) >>>> + * Monitor/MWAIT parameters (0x05) >>>> + * >>>> + * AMD defined leafs: >>>> + * L1 Cache and TLB (0x05) >>>> + * L2+L3 TLB (0x06) >>>> + * LongMode address size (0x08) >>>> + * 1GB page TLB (0x19) >>>> + * Performance optimization (0x1A) >>>> + */ >> Since at least L1 and L2 caches are mostly private to vCPUs, I see no >> reason to disguise them. > > But in practice, what is it useful for? Just because we can expose it > doesn't mean we should. Beside the obvious high performance libraries (like the AMD ACML) also JVMs (and probably other managed code runtimes) use the cache information for optimization. Given the fact that we have a fairly large range of actual L2 cache sizes (from 256KB to 6MB on Intel) the fixed cache size that QEMU reports (1MB) is quite a bit off most of the times. -cpu host is targeted to give the best performance to the user, with the drawback of missing or very limited migration experience. So we should expose as many features as possible. Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 448-3567-12