qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] qemu-kvm/cpuid: fix a emulation of guest ph


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-kvm/cpuid: fix a emulation of guest physical address space
Date: Sat, 03 Nov 2012 11:54:34 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2012-11-02 06:38, Xudong Hao wrote:
> For 64 bit processor, emulate 40 bits physical address if the host physical
> address space >= 40bits, else guest physical is same as host.
> 
> Signed-off-by: Xudong Hao <address@hidden>
> ---
>  target-i386/cpu.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 423e009..3a78881 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1584,7 +1584,10 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, 
> uint32_t count,
>          if (env->cpuid_ext2_features & CPUID_EXT2_LM) {
>              /* 64 bit processor */
>  /* XXX: The physical address space is limited to 42 bits in exec.c. */
> -            *eax = 0x00003028;       /* 48 bits virtual, 40 bits physical */
> +/* XXX: 40 bits physical if host physical address space >= 40 bits */
> +            uint32_t a, b, c, d;
> +            host_cpuid(0x80000008, 0, &a, &b, &c, &d);
> +            *eax = a < 0x00003028 ? a : 0x00003028;

This variation will not only affect -cpu host, right? That can create
problems when migrating between hosts with different address widths, and
then we will need some control knob to adjust what it reported to the guest.

Jan

>          } else {
>              if (env->cpuid_features & CPUID_PSE36)
>                  *eax = 0x00000024; /* 36 bits physical */
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]