Michael S. Tsirkin
2015-Apr-20 20:34 UTC
[PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
On Mon, Apr 20, 2015 at 09:10:02PM +0200, Paolo Bonzini wrote:> > > On 20/04/2015 19:36, Michael S. Tsirkin wrote: > > At the implementation level, there's one big issue you seem to have > > missed: DMA to invalid memory addresses causes a crash in memory core. > > I'm not sure whether it makes sense to recover from virtio core bugs > > when we can't recover from device bugs. > > What do you mean exactly? DMA to invalid memory addresses causes > address_space_map to return a "short read". > > PaoloI mean, first of all, a bunch of virtio_XXX_phys calls. These eventually call qemu_get_ram_ptr, which internally calls qemu_get_ram_block and ramblock_ptr. Both abort on errors. -- MST
Fam Zheng
2015-Apr-21 02:39 UTC
[PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
On Mon, 04/20 22:34, Michael S. Tsirkin wrote:> On Mon, Apr 20, 2015 at 09:10:02PM +0200, Paolo Bonzini wrote: > > > > > > On 20/04/2015 19:36, Michael S. Tsirkin wrote: > > > At the implementation level, there's one big issue you seem to have > > > missed: DMA to invalid memory addresses causes a crash in memory core. > > > I'm not sure whether it makes sense to recover from virtio core bugs > > > when we can't recover from device bugs. > > > > What do you mean exactly? DMA to invalid memory addresses causes > > address_space_map to return a "short read". > > > > Paolo > > I mean, first of all, a bunch of virtio_XXX_phys calls. > These eventually call qemu_get_ram_ptr, which internally calls > qemu_get_ram_block and ramblock_ptr. > Both abort on errors. >They are VQ manipulating operations, not DMA. Anyway, can we return errors from memory core? Fam
Paolo Bonzini
2015-Apr-21 06:52 UTC
[PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
On 20/04/2015 22:34, Michael S. Tsirkin wrote:> On Mon, Apr 20, 2015 at 09:10:02PM +0200, Paolo Bonzini wrote: >> >> >> On 20/04/2015 19:36, Michael S. Tsirkin wrote: >>> At the implementation level, there's one big issue you seem to have >>> missed: DMA to invalid memory addresses causes a crash in memory core. >>> I'm not sure whether it makes sense to recover from virtio core bugs >>> when we can't recover from device bugs. >> >> What do you mean exactly? DMA to invalid memory addresses causes >> address_space_map to return a "short read". >> >> Paolo > > I mean, first of all, a bunch of virtio_XXX_phys calls. > These eventually call qemu_get_ram_ptr, which internally calls > qemu_get_ram_block and ramblock_ptr. > Both abort on errors.address_space_translate and memory_access_size should ensure they don't. Paolo
Michael S. Tsirkin
2015-Apr-21 06:58 UTC
[PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
On Tue, Apr 21, 2015 at 08:52:36AM +0200, Paolo Bonzini wrote:> > > On 20/04/2015 22:34, Michael S. Tsirkin wrote: > > On Mon, Apr 20, 2015 at 09:10:02PM +0200, Paolo Bonzini wrote: > >> > >> > >> On 20/04/2015 19:36, Michael S. Tsirkin wrote: > >>> At the implementation level, there's one big issue you seem to have > >>> missed: DMA to invalid memory addresses causes a crash in memory core. > >>> I'm not sure whether it makes sense to recover from virtio core bugs > >>> when we can't recover from device bugs. > >> > >> What do you mean exactly? DMA to invalid memory addresses causes > >> address_space_map to return a "short read". > >> > >> Paolo > > > > I mean, first of all, a bunch of virtio_XXX_phys calls. > > These eventually call qemu_get_ram_ptr, which internally calls > > qemu_get_ram_block and ramblock_ptr. > > Both abort on errors. > > address_space_translate and memory_access_size should ensure they don't. > > PaoloMore comments in this code won't hurt. It *looks* as if we assume we get a valid mr, and try to access it. In any case, no error is reported. -- MST
Apparently Analagous Threads
- [PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
- [PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
- [PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
- [PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"
- [PATCH 00/18] virtio-blk: Support "VIRTIO_CONFIG_S_NEEDS_RESET"