Re: [PATCH 0/1] Add uvirtio for testing

2020-04-30 Thread lepton
On Thu, Apr 30, 2020 at 12:51 AM Gerd Hoffmann wrote: > > On Wed, Apr 29, 2020 at 08:59:18PM -0700, lepton wrote: > > On Wed, Apr 29, 2020 at 4:58 AM Gerd Hoffmann wrote: > > > > > > > 3) Need to be verbose on how the vring processing work in the commit > > > > log of > > > > patch 1 > > > > >

[PATCH v3] virtio: Add uvirtio driver

2020-04-30 Thread Lepton Wu
This is for testing purpose to create virtio devices from user space. uvirtio-vga.c shows how to create a virtio-vga device. For "simple" device like virtio 2d VGA, actually we only need to handle one virtio request which return the resolution of VGA. We provide a UV_DEV_EXPECT ioctl which set

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread Andrew Morton
On Thu, 30 Apr 2020 20:43:39 +0200 David Hildenbrand wrote: > > > > Why does the firmware map support hotplug entries? > > I assume: > > The firmware memmap was added primarily for x86-64 kexec (and still, is > mostly used on x86-64 only IIRC). There, we had ACPI hotplug. When DIMMs > get

Re: [PATCH] vhost: vsock: don't send pkt when vq is not started

2020-04-30 Thread Michael S. Tsirkin
On Thu, Apr 30, 2020 at 06:25:21PM +0200, Stefano Garzarella wrote: > On Thu, Apr 30, 2020 at 10:06:26AM +, Justin He wrote: > > Hi Stefano > > > > > -Original Message- > > > From: Stefano Garzarella > > > Sent: Thursday, April 30, 2020 4:26 PM > > > To: Justin He > > > Cc: Stefan

Re: [RFC/PATCH 1/1] virtio: Introduce MMIO ops

2020-04-30 Thread Michael S. Tsirkin
On Thu, Apr 30, 2020 at 07:03:21PM +0530, Srivatsa Vaddagiri wrote: > * Jan Kiszka [2020-04-30 14:59:50]: > > > >I believe ivshmem2_virtio requires hypervisor to support PCI device > > >emulation > > >(for life-cycle management of VMs), which our hypervisor may not support. PCI is mostly just

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread Dan Williams
On Thu, Apr 30, 2020 at 11:44 AM David Hildenbrand wrote: > > >>> If the class of memory is different then please by all means let's mark > >>> it differently in struct resource so everyone knows it is different. > >>> But that difference needs to be more than hotplug. > >>> > >>> That

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread David Hildenbrand
>>> If the class of memory is different then please by all means let's mark >>> it differently in struct resource so everyone knows it is different. >>> But that difference needs to be more than hotplug. >>> >>> That difference needs to be the hypervisor loaned us memory and might >>> take it

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread Eric W. Biederman
David Hildenbrand writes: > On 30.04.20 18:33, Eric W. Biederman wrote: >> David Hildenbrand writes: >> >>> On 30.04.20 17:38, Eric W. Biederman wrote: David Hildenbrand writes: > Some devices/drivers that add memory via add_memory() and friends (e.g., > dax/kmem, but also

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread David Hildenbrand
On 30.04.20 18:33, Eric W. Biederman wrote: > David Hildenbrand writes: > >> On 30.04.20 17:38, Eric W. Biederman wrote: >>> David Hildenbrand writes: >>> Some devices/drivers that add memory via add_memory() and friends (e.g., dax/kmem, but also virtio-mem in the future) don't want

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread Eric W. Biederman
David Hildenbrand writes: > On 30.04.20 17:38, Eric W. Biederman wrote: >> David Hildenbrand writes: >> >>> Some devices/drivers that add memory via add_memory() and friends (e.g., >>> dax/kmem, but also virtio-mem in the future) don't want to create entries >>> in /sys/firmware/memmap/ -

Re: [PATCH v3 08/75] x86/umip: Factor out instruction decoding

2020-04-30 Thread Borislav Petkov
On Tue, Apr 28, 2020 at 05:16:18PM +0200, Joerg Roedel wrote: > +/** > + * insn_decode() - Decode an instruction > + * @regs:Structure with register values as seen when entering kernel mode > + * @insn:Structure to store decoded instruction > + * @buf: Buffer containing the instruction

Re: [PATCH] vhost: vsock: don't send pkt when vq is not started

2020-04-30 Thread Stefano Garzarella
On Thu, Apr 30, 2020 at 10:06:26AM +, Justin He wrote: > Hi Stefano > > > -Original Message- > > From: Stefano Garzarella > > Sent: Thursday, April 30, 2020 4:26 PM > > To: Justin He > > Cc: Stefan Hajnoczi ; Michael S. Tsirkin > > ; Jason Wang ; > > k...@vger.kernel.org;

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread Dave Hansen
On 4/30/20 8:52 AM, David Hildenbrand wrote: >> Justifying behavior by documentation that does not consider memory >> hotplug is bad thinking. > Are you maybe confusing this patch series with the arm64 approach? This > is not about ordinary hotplugged DIMMs. > > I'd love to get Dan's, Dave's and

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread David Hildenbrand
On 30.04.20 17:38, Eric W. Biederman wrote: > David Hildenbrand writes: > >> Some devices/drivers that add memory via add_memory() and friends (e.g., >> dax/kmem, but also virtio-mem in the future) don't want to create entries >> in /sys/firmware/memmap/ - primarily to hinder kexec from adding

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread Eric W. Biederman
David Hildenbrand writes: > Some devices/drivers that add memory via add_memory() and friends (e.g., > dax/kmem, but also virtio-mem in the future) don't want to create entries > in /sys/firmware/memmap/ - primarily to hinder kexec from adding this > memory to the boot memmap of the kexec

Re: [PATCH v2 3/3] device-dax: Add system ram (add_memory()) with MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread David Hildenbrand
On 30.04.20 13:23, Dave Hansen wrote: > On 4/30/20 3:29 AM, David Hildenbrand wrote: >> Currently, when adding memory, we create entries in /sys/firmware/memmap/ >> as "System RAM". This does not reflect the reality and will lead to >> kexec-tools to add that memory to the fixed-up initial memmap

Re: [PATCH 5/5] virtio: Add bounce DMA ops

2020-04-30 Thread Konrad Rzeszutek Wilk
On Wed, Apr 29, 2020 at 06:20:48AM -0400, Michael S. Tsirkin wrote: > On Wed, Apr 29, 2020 at 03:39:53PM +0530, Srivatsa Vaddagiri wrote: > > That would still not work I think where swiotlb is used for pass-thr devices > > (when private memory is fine) as well as virtio devices (when shared memory

Re: [PATCH v4] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-30 Thread Stefano Garzarella
On Thu, Apr 30, 2020 at 03:04:42PM +0100, Stefan Hajnoczi wrote: > A userspace process holding a file descriptor to a virtio_blk device can > still invoke block_device_operations after hot unplug. This leads to a > use-after-free accessing vblk->vdev in virtblk_getgeo() when > ioctl(HDIO_GETGEO)

[PATCH v4] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-30 Thread Stefan Hajnoczi
A userspace process holding a file descriptor to a virtio_blk device can still invoke block_device_operations after hot unplug. This leads to a use-after-free accessing vblk->vdev in virtblk_getgeo() when ioctl(HDIO_GETGEO) is invoked: BUG: unable to handle kernel NULL pointer dereference at

Re: [RFC/PATCH 1/1] virtio: Introduce MMIO ops

2020-04-30 Thread Jan Kiszka
On 30.04.20 13:11, Srivatsa Vaddagiri wrote: * Will Deacon [2020-04-30 11:41:50]: On Thu, Apr 30, 2020 at 04:04:46PM +0530, Srivatsa Vaddagiri wrote: If CONFIG_VIRTIO_MMIO_OPS is defined, then I expect this to be unconditionally set to 'magic_qcom_ops' that uses hypervisor-supported

Re: [PATCH v2 3/3] device-dax: Add system ram (add_memory()) with MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread Dave Hansen
On 4/30/20 3:29 AM, David Hildenbrand wrote: > Currently, when adding memory, we create entries in /sys/firmware/memmap/ > as "System RAM". This does not reflect the reality and will lead to > kexec-tools to add that memory to the fixed-up initial memmap for a > kexec kernel (loaded via

Re: [RFC/PATCH 0/1] virtio_mmio: hypervisor specific interfaces for MMIO

2020-04-30 Thread Jason Wang
On 2020/4/30 下午6:07, Michael S. Tsirkin wrote: On Thu, Apr 30, 2020 at 03:32:55PM +0530, Srivatsa Vaddagiri wrote: The Type-1 hypervisor we are dealing with does not allow for MMIO transport. How about PCI then? Or maybe you can use virtio-vdpa. Thanks

Re: [PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-30 Thread Stefano Garzarella
On Thu, Apr 30, 2020 at 06:28:21AM -0400, Michael S. Tsirkin wrote: > On Thu, Apr 30, 2020 at 11:14:10AM +0100, Stefan Hajnoczi wrote: > > On Thu, Apr 30, 2020 at 10:43:23AM +0200, Stefano Garzarella wrote: > > > On Wed, Apr 29, 2020 at 05:53:45PM +0100, Stefan Hajnoczi wrote: > > > > A userspace

Re: [RFC/PATCH 1/1] virtio: Introduce MMIO ops

2020-04-30 Thread Will Deacon
On Thu, Apr 30, 2020 at 04:04:46PM +0530, Srivatsa Vaddagiri wrote: > * Will Deacon [2020-04-30 11:14:32]: > > > > +#ifdef CONFIG_VIRTIO_MMIO_OPS > > > > > > +static struct virtio_mmio_ops *mmio_ops; > > > + > > > +#define virtio_readb(a) mmio_ops->mmio_readl((a)) > > > +#define

Re: [RFC/PATCH 0/1] virtio_mmio: hypervisor specific interfaces for MMIO

2020-04-30 Thread Will Deacon
Hi Vatsa, On Thu, Apr 30, 2020 at 03:59:39PM +0530, Srivatsa Vaddagiri wrote: > * Will Deacon [2020-04-30 11:08:22]: > > > > This patch is meant to seek comments. If its considered to be in right > > > direction, will work on making it more complete and send the next version! > > > > What's

[PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread David Hildenbrand
Some devices/drivers that add memory via add_memory() and friends (e.g., dax/kmem, but also virtio-mem in the future) don't want to create entries in /sys/firmware/memmap/ - primarily to hinder kexec from adding this memory to the boot memmap of the kexec kernel. In fact, such memory is never

[PATCH v2 1/3] mm/memory_hotplug: Prepare passing flags to add_memory() and friends

2020-04-30 Thread David Hildenbrand
We soon want to pass flags - prepare for that. This patch is based on a similar patch by Oscar Salvador: https://lkml.kernel.org/r/20190625075227.15193-3-osalva...@suse.de Acked-by: Wei Liu Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "Rafael J. Wysocki" Cc: Len

[PATCH v2 3/3] device-dax: Add system ram (add_memory()) with MHP_NO_FIRMWARE_MEMMAP

2020-04-30 Thread David Hildenbrand
Currently, when adding memory, we create entries in /sys/firmware/memmap/ as "System RAM". This does not reflect the reality and will lead to kexec-tools to add that memory to the fixed-up initial memmap for a kexec kernel (loaded via kexec_load()). The memory will be considered initial System RAM

[PATCH v2 0/3] mm/memory_hotplug: Allow to not create firmware memmap entries

2020-04-30 Thread David Hildenbrand
This is the follow up of [1]: [PATCH v1 0/3] mm/memory_hotplug: Make virtio-mem play nicely with kexec-tools I realized that this is not only helpful for virtio-mem, but also for dax/kmem - it's a fix for that use case (see patch #3) of persistent memory. Also, while testing, I

Re: [PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-30 Thread Michael S. Tsirkin
On Thu, Apr 30, 2020 at 11:14:10AM +0100, Stefan Hajnoczi wrote: > On Thu, Apr 30, 2020 at 10:43:23AM +0200, Stefano Garzarella wrote: > > On Wed, Apr 29, 2020 at 05:53:45PM +0100, Stefan Hajnoczi wrote: > > > A userspace process holding a file descriptor to a virtio_blk device can > > > still

Re: [RFC/PATCH 1/1] virtio: Introduce MMIO ops

2020-04-30 Thread Will Deacon
On Thu, Apr 30, 2020 at 03:32:56PM +0530, Srivatsa Vaddagiri wrote: > Some hypervisors may not support MMIO transport i.e trap config > space access and have it be handled by backend driver. They may > allow other ways to interact with backend such as message-queue > or doorbell API. This patch

Re: [PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-30 Thread Stefan Hajnoczi
On Thu, Apr 30, 2020 at 10:43:23AM +0200, Stefano Garzarella wrote: > On Wed, Apr 29, 2020 at 05:53:45PM +0100, Stefan Hajnoczi wrote: > > A userspace process holding a file descriptor to a virtio_blk device can > > still invoke block_device_operations after hot unplug. This leads to a > >

Re: [RFC/PATCH 0/1] virtio_mmio: hypervisor specific interfaces for MMIO

2020-04-30 Thread Will Deacon
On Thu, Apr 30, 2020 at 03:32:55PM +0530, Srivatsa Vaddagiri wrote: > The Type-1 hypervisor we are dealing with does not allow for MMIO transport. > [1] summarizes some of the problems we have in making virtio work on such > hypervisors. This patch proposes a solution for transport problem viz

Re: [RFC/PATCH 0/1] virtio_mmio: hypervisor specific interfaces for MMIO

2020-04-30 Thread Michael S. Tsirkin
On Thu, Apr 30, 2020 at 03:32:55PM +0530, Srivatsa Vaddagiri wrote: > The Type-1 hypervisor we are dealing with does not allow for MMIO transport. How about PCI then? -- MST ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug

2020-04-30 Thread Stefano Garzarella
On Wed, Apr 29, 2020 at 05:53:45PM +0100, Stefan Hajnoczi wrote: > A userspace process holding a file descriptor to a virtio_blk device can > still invoke block_device_operations after hot unplug. This leads to a > use-after-free accessing vblk->vdev in virtblk_getgeo() when > ioctl(HDIO_GETGEO)

Re: [PATCH v1 2/3] mm/memory_hotplug: Introduce MHP_DRIVER_MANAGED

2020-04-30 Thread Dan Williams
On Thu, Apr 30, 2020 at 1:21 AM David Hildenbrand wrote: > >> Just because we decided to use some DAX memory in the current kernel as > >> system ram, doesn't mean we should make that decision for the kexec > >> kernel (e.g., using it as initial memory, placing kexec binaries onto > >> it, etc.).

Re: [PATCH] vhost: vsock: don't send pkt when vq is not started

2020-04-30 Thread Stefano Garzarella
Hi Jia, thanks for the patch, some comments below: On Thu, Apr 30, 2020 at 10:13:14AM +0800, Jia He wrote: > Ning Bo reported an abnormal 2-second gap when booting Kata container [1]. > The unconditional timeout is caused by VSOCK_DEFAULT_CONNECT_TIMEOUT of > connect at client side. The vhost

Re: [PATCH v1 2/3] mm/memory_hotplug: Introduce MHP_DRIVER_MANAGED

2020-04-30 Thread David Hildenbrand
On 30.04.20 10:11, Dan Williams wrote: > On Thu, Apr 30, 2020 at 12:20 AM David Hildenbrand wrote: >> >> On 29.04.20 18:08, David Hildenbrand wrote: >>> Some paravirtualized devices that add memory via add_memory() and >>> friends (esp. virtio-mem) don't want to create entries in >>>

Re: [PATCH v1 2/3] mm/memory_hotplug: Introduce MHP_DRIVER_MANAGED

2020-04-30 Thread Dan Williams
On Thu, Apr 30, 2020 at 12:20 AM David Hildenbrand wrote: > > On 29.04.20 18:08, David Hildenbrand wrote: > > Some paravirtualized devices that add memory via add_memory() and > > friends (esp. virtio-mem) don't want to create entries in > > /sys/firmware/memmap/ - primarily to hinder kexec from

Re: [PATCH 0/1] Add uvirtio for testing

2020-04-30 Thread Gerd Hoffmann
On Wed, Apr 29, 2020 at 08:59:18PM -0700, lepton wrote: > On Wed, Apr 29, 2020 at 4:58 AM Gerd Hoffmann wrote: > > > > > 3) Need to be verbose on how the vring processing work in the commit log > > > of > > > patch 1 > > > > Ecven better a file documenting the interface somewhere in > >

Re: [PATCH v1 2/3] mm/memory_hotplug: Introduce MHP_DRIVER_MANAGED

2020-04-30 Thread David Hildenbrand
On 29.04.20 18:08, David Hildenbrand wrote: > Some paravirtualized devices that add memory via add_memory() and > friends (esp. virtio-mem) don't want to create entries in > /sys/firmware/memmap/ - primarily to hinder kexec from adding this > memory to the boot memmap of the kexec kernel. > > In