Re: [PATCH] ARM: KVM: Complain on read from WO and write to RO CP15 regs

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

 



On Fri, Aug 24, 2012 at 3:28 PM, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
> Christoffer Dall <c.dall@xxxxxxxxxxxxxxxxxxxxxx> writes:
>> On Thu, Aug 23, 2012 at 3:11 AM, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
>>> As the comment at the bottom says, if your function fails, you should
>>> complain yourself (as you have more information).  Create helpers to do
>>> this, and use them.
>>>
>>> Signed-off-by: Rusty Russell <rusty.russell@xxxxxxxxxx>
>>>
>>> diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
>>> index e36826c..824e5a3 100644
>>> --- a/arch/arm/kvm/coproc.c
>>> +++ b/arch/arm/kvm/coproc.c
>>> @@ -120,6 +120,24 @@ static bool read_zero(struct kvm_vcpu *vcpu, const struct coproc_params *p)
>>>         return true;
>>>  }
>>>
>>> +static bool write_to_read_only(struct kvm_vcpu *vcpu,
>>> +                              const struct coproc_params *params)
>>> +{
>>> +       kvm_err("CP15 write to read-only register at: %08x\n",
>>> +               vcpu->arch.regs.pc);
>>> +       print_cp_instr(params);
>>> +       return false;
>>
>> do we really want a guest to be able to flood the host kernel log?
>
> Good point.  We should ratelimit this one too:
>
>                 kvm_err("Unsupported guest CP15 access at: %08x\n",
>                         vcpu->arch.regs.pc);
>

ok, I applied this one, but made the prints debug prints as we already
tell the guest about its mistake via the undefined exception and we
don't need all this in the kernel log.

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