qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] vhost: Can we change synchronize_rcu to call_rcu


From: Gonglei (Arei)
Subject: Re: [Qemu-devel] [RFC] vhost: Can we change synchronize_rcu to call_rcu in vhost_set_memory() in vhost kernel module?
Date: Fri, 9 May 2014 09:04:55 +0000

Hi,

> -----Original Message-----
> From: Paolo Bonzini [mailto:address@hidden
> Sent: Friday, May 09, 2014 4:15 PM
> To: Gonglei (Arei); address@hidden
> Cc: address@hidden; Herongguang (Stephen); Huangweidong (C)
> Subject: Re: [RFC] vhost: Can we change synchronize_rcu to call_rcu in
> vhost_set_memory() in vhost kernel module?
> 
> Il 09/05/2014 03:57, Gonglei (Arei) ha scritto:
> > Hi,
> >
> > Vhost devices need to do VHOST_SET_MEM_TABLE ioctl in vhost_dev_start()
> > to tell vhost kernel modules GPA to HVA memory mappings, which consume is
> expensively.
> > The reason is same as KVM_SET_GSI_ROUTING ioctl. That is, in ioctl
> processing,
> > kmod and vhost calls synchronize_rcu() to wait for grace period to free old
> memory.
> >
> > In KVM_SET_GSI_ROUTING case, we cannot simply change synchronize_rcu
> to call_rcu,
> > since this may leads to DOS attacks if guest VM keeps setting IRQ affinity.
> >
> > In VHOST_SET_MEM_TABLE case, I wonder if we can change
> synchronize_rcu() to call_rcu(),
> > i.e., is it possible to trigger DOS attack in guest? There are some cases 
> > QEMU
> would do
> > VHOST_SET_MEM_TABLE ioctl, like VM start/reboot/attach vhost devices,
> and RAM memory
> > regions in system memory address space change.
> >
> > And I'd like to know if guest activities could lead to RAM memory regions
> change?
> 
> Yes, for example enabling/disabling PCI BARs would have that effect.
> 
Yes, but PCI BARs are mapped in PCI hole, and they are not overlapped with ram 
memory regions, so disable or enable PCI BARs would not change ram MRs' 
mapping. 
Since vhost_region_add/vhost_region_del check if changed MemoryRegionSection is 
ram, 
so vhost memoey mappings will not be influenced, is this correct?


Best regards,
-Gonglei




reply via email to

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