On 08/07/2016 17:01, Dr. David Alan Gilbert (git) wrote:
> +            uint32_t host_phys_bits = x86_host_phys_bits();
> +            static bool warned;
> +
> +            if (cpu->host_phys_bits) {
> +                /* The user asked for us to use the host physical bits */
> +                cpu->phys_bits = host_phys_bits;
> +            }
> +
> +            /* Print a warning if the user set it to a value that's not the
> +             * host value.
> +             */
> +            if (cpu->phys_bits != host_phys_bits && cpu->phys_bits != 0 &&
> +                !warned) {
> +                error_report("Warning: Host physical bits (%u)"
> +                                 " does not match phys-bits property (%u)",
> +                                 host_phys_bits, cpu->phys_bits);
> +                warned = true;
> +            }
> +
> +            if (cpu->phys_bits &&
> +                (cpu->phys_bits > TARGET_PHYS_ADDR_SPACE_BITS ||
> +                cpu->phys_bits < 32)) {
>                  error_setg(errp, "phys-bits should be between 32 and %u "
>                                   " (but is %u)",
>                                   TARGET_PHYS_ADDR_SPACE_BITS, 
> cpu->phys_bits);

Michael Tsirkin suggested a way to support guest-phys-bits <
host-phys-bits in KVM.  I plan to implement it soonish.  In the
meanwhile I guess this patch is fine, we can refine it later.

Paolo

Reply via email to