On Fri, Jul 08, 2016 at 04:01:36PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> > > Currently QEMU sets the x86 number of physical address bits to the > magic number 40. This is only correct on some small AMD systems; > Intel systems tend to have 36, 39, 46 bits, and large AMD systems > tend to have 48. > > Having the value different from your actual hardware is detectable > by the guest and in principal can cause problems; > The current limit of 40 stops TB VMs being created by those lucky > enough to have that much. > > This patch lets you set the physical bits by a cpu property but > defaults to the same 40bits which matches TCGs setup. > > I've removed the ancient warning about the 42 bit limit in exec.c; > I can't find that limit in there and no one else seems to know where > it is.
I think I've found it, buried in ancient commits: commit 5270589032f450ae7c3448730855aa18ff68ccff Author: Richard Henderson <r...@twiddle.net> Date: Wed Mar 10 14:33:23 2010 -0800 Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h. Removes a set of ifdefs from exec.c. Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets other than Alpha. This will be used for page_find_alloc, which is supposed to be using virtual addresses in the first place. Signed-off-by: Richard Henderson <r...@twiddle.net> [...] --- a/exec.c +++ b/exec.c [...] -#elif defined(TARGET_X86_64) -#define TARGET_PHYS_ADDR_SPACE_BITS 42 -#elif defined(TARGET_I386) -#define TARGET_PHYS_ADDR_SPACE_BITS 36 [...] --- a/target-i386/cpu.h +++ b/target-i386/cpu.h [...] +#ifdef TARGET_X86_64 +#define TARGET_PHYS_ADDR_SPACE_BITS 52 +/* ??? This is really 48 bits, sign-extended, but the only thing + accessible to userland with bit 48 set is the VSYSCALL, and that + is handled via other mechanisms. */ +#define TARGET_VIRT_ADDR_SPACE_BITS 47 +#else +#define TARGET_PHYS_ADDR_SPACE_BITS 36 +#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#endif + But I really don't understand why it was changed to 52 when the macros were moved. A (fortunate) typo? -- Eduardo