Re: [PATCH] KVM: ARM: Don't use set_pte_ext (a.k.a. Fix the voodoo bug!)

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

 



On Fri, Nov 23, 2012 at 8:12 AM, Marc Zyngier <marc.zyngier@xxxxxxx> wrote:
> On 23/11/12 00:59, Christoffer Dall wrote:
>> From: Christoffer Dall <cdall@xxxxxxxxxxxxxxx>
>>
>> The set_pte_ext function orr'ed the RDONLY bit onto the PTEs, which is
>> bit[7], which is HAP[1] and causes writable access to the pages.
>>
>> This was unfortunate.
>>
>> Cc: Nicolas Viennot <nviennot@xxxxxxxxxxxxxxx>
>> Cc: Jeremy C. Andrus <jeremya@xxxxxxxxxxxxxxx>
>> Signed-off-by: Christoffer Dall <c.dall@xxxxxxxxxxxxxxxxxxxxxx>
>> ---
>>  arch/arm/kvm/mmu.c |   27 +++++++++++++++------------
>>  1 file changed, 15 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
>> index 7b0e6e5..720bbd5 100644
>> --- a/arch/arm/kvm/mmu.c
>> +++ b/arch/arm/kvm/mmu.c
>> @@ -41,6 +41,16 @@ static void kvm_tlb_flush_vmid(struct kvm *kvm)
>>       kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>>  }
>>
>> +static void set_pte(pte_t *pte, pte_t new_pte)
>> +{
>> +     *pte = new_pte;
>
> One last nit: consider using "pte_val(*pte) = new_pte;" instead, so we
> can still compile with STRICT_MM_TYPECHECKS.
>
I'll rename and change to pte_val and get that out right away.

thanks,
-Christoffer
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm


[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux