qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Default for phys-addr-bits? (was Re: [PATCH 4/5] x86: A


From: Paolo Bonzini
Subject: Re: [Qemu-devel] Default for phys-addr-bits? (was Re: [PATCH 4/5] x86: Allow physical address bits to be set)
Date: Wed, 22 Jun 2016 16:48:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1


On 22/06/2016 16:44, Andrea Arcangeli wrote:
> On Wed, Jun 22, 2016 at 04:33:18PM +0200, Paolo Bonzini wrote:
>>
>>
>> On 22/06/2016 16:24, Andrea Arcangeli wrote:
>>> Linux could not possibly crash instead if host phys bits > guest phys
>>> bits because it will never depend on GPF triggering if the must be
>>> zero bits of the guest pagetables are set. Linux won't ever try to set
>>> those bits and I'd be shocked if any other OS does.
>>
>> Well, KVM does.  It sets _all_ bits up to 51, not just one, but still we
>> have a counterexample.
> 
> How can that crash? KVM doesn't use the host phys bits (or level1 host
> phys bits), the bit to set is hardcoded up to 51 and assumed no host
> would possibly fail at that.

KVM encodes other information in the sPTE when it sets the reserved bit
(a generation count).  Instead of using all bits up to 51, KVM could
well use bit MAXPHYADDR+1 as a marker and add bits MAXPHYADDR+2...51 to
the generation count.

You cannot really rely on what the guest does, no matter how crazy it seems.

Paolo



reply via email to

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