Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest

2021-10-05 Thread Greg Kroah-Hartman
On Tue, Oct 05, 2021 at 03:33:29PM -0700, Dan Williams wrote: > On Sun, Oct 3, 2021 at 10:16 PM Mika Westerberg > wrote: > > > > Hi, > > > > On Fri, Oct 01, 2021 at 12:57:18PM -0700, Dan Williams wrote: > > > > > Ah, so are you saying that it would be sufficient for USB if the > > > > > generic

Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest

2021-10-05 Thread Dan Williams
On Sun, Oct 3, 2021 at 10:16 PM Mika Westerberg wrote: > > Hi, > > On Fri, Oct 01, 2021 at 12:57:18PM -0700, Dan Williams wrote: > > > > Ah, so are you saying that it would be sufficient for USB if the > > > > generic authorized implementation did something like: > > > > > > > > dev->authorized =

Re: [PATCH v2 3/9] x86/xen: print a warning when HVMOP_get_mem_type fails

2021-10-05 Thread Boris Ostrovsky
On 10/5/21 8:14 AM, David Hildenbrand wrote: > HVMOP_get_mem_type is not expected to fail, "This call failing is > indication of something going quite wrong and it would be good to know > about this." [1] > > Let's add a pr_warn_once(). > > [1]

Re: [PATCH v2 2/9] x86/xen: simplify xen_oldmem_pfn_is_ram()

2021-10-05 Thread Boris Ostrovsky
On 10/5/21 8:14 AM, David Hildenbrand wrote: > Let's simplify return handling. > > Signed-off-by: David Hildenbrand Reviewed-by: Boris Ostrovsky ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH v5] virtio-blk: Add validation for block size in config space

2021-10-05 Thread Martin K. Petersen
Michael, > Would it be acceptable for blk layer to validate the input instead of > having each driver do it's own thing? Maybe inside > blk_queue_logical_block_size? I think that would be fine. I believe we had some patches floating around a few years ago attempting to make that change. --

Re: [PATCH V3 5/9] fork: add helper to clone a process

2021-10-05 Thread Mike Christie
On 10/5/21 7:50 AM, Christian Brauner wrote: > On Mon, Oct 04, 2021 at 02:21:24PM -0500, Mike Christie wrote: >> The vhost layer has similar requirements as io_uring where its worker >> threads need to access the userspace thread's memory, want to inherit the >> parents's cgroups and namespaces,

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Cornelia Huck
On Tue, Oct 05 2021, Halil Pasic wrote: > On Tue, 05 Oct 2021 13:13:31 +0200 > Cornelia Huck wrote: >> Or am I misunderstanding what you're getting at? >> > > Probably. I'm talking about pre- "do transport specific legacy detection > in the device instead of looking at VERSION_1" you are

Re: [virtio-dev] Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Cornelia Huck
On Tue, Oct 05 2021, "Michael S. Tsirkin" wrote: > On Tue, Oct 05, 2021 at 01:17:51PM +0200, Halil Pasic wrote: >> On Mon, 4 Oct 2021 16:01:12 -0400 >> "Michael S. Tsirkin" wrote: >> >> > > >> > > Ok, so what about something like >> > > >> > > "If FEATURES_OK is not set, the driver MAY

[PATCH AUTOSEL 5.14 34/40] scsi: virtio_scsi: Fix spelling mistake "Unsupport" -> "Unsupported"

2021-10-05 Thread Sasha Levin
From: Colin Ian King [ Upstream commit cced4c0ec7c06f5230a2958907a409c849762293 ] There are a couple of spelling mistakes in pr_info and pr_err messages. Fix them. Link: https://lore.kernel.org/r/20210924230330.143785-1-colin.k...@canonical.com Signed-off-by: Colin Ian King Signed-off-by:

Re: [PATCH v1 2/6] mm/memory_hotplug: remove CONFIG_MEMORY_HOTPLUG_SPARSE

2021-10-05 Thread Greg Kroah-Hartman
On Wed, Sep 29, 2021 at 04:35:56PM +0200, David Hildenbrand wrote: > CONFIG_MEMORY_HOTPLUG depends on CONFIG_SPARSEMEM, so there is no need for > CONFIG_MEMORY_HOTPLUG_SPARSE anymore; adjust all instances to use > CONFIG_MEMORY_HOTPLUG and remove CONFIG_MEMORY_HOTPLUG_SPARSE. > > Signed-off-by:

Re: [PATCH] virtio_console: break out of buf poll on remove

2021-10-05 Thread Greg Kroah-Hartman
On Tue, Oct 05, 2021 at 03:04:07AM -0400, Michael S. Tsirkin wrote: > A common pattern for device reset is currently: > vdev->config->reset(vdev); > .. cleanup .. > > reset prevents new interrupts from arriving and waits for interrupt > handlers to finish. > > However if - as is common - the

Re: [PATCH 1/4] hwrng: virtio - add an internal buffer

2021-10-05 Thread Laurent Vivier
On 05/10/2021 13:55, Michael S. Tsirkin wrote: On Thu, Sep 23, 2021 at 09:34:18AM +0200, Laurent Vivier wrote: On 23/09/2021 09:04, Michael S. Tsirkin wrote: On Thu, Sep 23, 2021 at 08:26:06AM +0200, Laurent Vivier wrote: On 22/09/2021 21:02, Michael S. Tsirkin wrote: On Wed, Sep 22, 2021 at

[PATCH v2 9/9] virtio-mem: kdump mode to sanitize /proc/vmcore access

2021-10-05 Thread David Hildenbrand
Although virtio-mem currently supports reading unplugged memory in the hypervisor, this will change in the future, indicated to the device via a new feature flag. We similarly sanitized /proc/kcore access recently. [1] Let's register a vmcore callback, to allow vmcore code to check if a PFN

[PATCH v2 8/9] virtio-mem: factor out hotplug specifics from virtio_mem_remove() into virtio_mem_deinit_hotplug()

2021-10-05 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git

[PATCH v2 7/9] virtio-mem: factor out hotplug specifics from virtio_mem_probe() into virtio_mem_init_hotplug()

2021-10-05 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 87 +++-- 1 file changed, 45 insertions(+), 42

[PATCH v2 6/9] virtio-mem: factor out hotplug specifics from virtio_mem_init() into virtio_mem_init_hotplug()

2021-10-05 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 81 - 1 file changed, 44 insertions(+), 37

[PATCH v2 5/9] proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks

2021-10-05 Thread David Hildenbrand
Let's support multiple registered callbacks, making sure that registering vmcore callbacks cannot fail. Make the callback return a bool instead of an int, handling how to deal with errors internally. Drop unused HAVE_OLDMEM_PFN_IS_RAM. We soon want to make use of this infrastructure from other

[PATCH v2 4/9] proc/vmcore: let pfn_is_ram() return a bool

2021-10-05 Thread David Hildenbrand
The callback should deal with errors internally, it doesn't make sense to expose these via pfn_is_ram(). We'll rework the callbacks next. Right now we consider errors as if "it's RAM"; no functional change. Signed-off-by: David Hildenbrand --- fs/proc/vmcore.c | 8 1 file changed, 4

[PATCH v2 3/9] x86/xen: print a warning when HVMOP_get_mem_type fails

2021-10-05 Thread David Hildenbrand
HVMOP_get_mem_type is not expected to fail, "This call failing is indication of something going quite wrong and it would be good to know about this." [1] Let's add a pr_warn_once(). [1] https://lkml.kernel.org/r/3b935aa0-6d85-0bcd-100e-15098add3...@oracle.com Suggested-by: Boris Ostrovsky

[PATCH v2 2/9] x86/xen: simplify xen_oldmem_pfn_is_ram()

2021-10-05 Thread David Hildenbrand
Let's simplify return handling. Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index b242d1f4b426..d1b38c77352b 100644 --- a/arch/x86/xen/mmu_hvm.c

[PATCH v2 1/9] x86/xen: update xen_oldmem_pfn_is_ram() documentation

2021-10-05 Thread David Hildenbrand
The callback is only used for the vmcore nowadays. Reviewed-by: Boris Ostrovsky Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index

[PATCH v2 0/9] proc/vmcore: sanitize access to virtio-mem memory

2021-10-05 Thread David Hildenbrand
As so often with virtio-mem changes that mess with common MM infrastructure, this might be a good candiate to go via Andrew's tree. -- After removing /dev/kmem, sanitizing /proc/kcore and handling /dev/mem, this series tackles the last sane way how a VM could accidentially access logically

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Tue, 05 Oct 2021 13:13:31 +0200 Cornelia Huck wrote: > On Tue, Oct 05 2021, Halil Pasic wrote: > > > On Mon, 4 Oct 2021 05:07:13 -0400 > > "Michael S. Tsirkin" wrote: > >> Well we established that we can know. Here's an alternative explanation: > > > > > > I thin we established how

Re: [PATCH 1/4] hwrng: virtio - add an internal buffer

2021-10-05 Thread Michael S. Tsirkin
On Thu, Sep 23, 2021 at 09:34:18AM +0200, Laurent Vivier wrote: > On 23/09/2021 09:04, Michael S. Tsirkin wrote: > > On Thu, Sep 23, 2021 at 08:26:06AM +0200, Laurent Vivier wrote: > > > On 22/09/2021 21:02, Michael S. Tsirkin wrote: > > > > On Wed, Sep 22, 2021 at 07:09:00PM +0200, Laurent Vivier

Re: [PATCH 0/4] hwrng: virtio - add an internal buffer

2021-10-05 Thread Laurent Vivier
On 22/09/2021 19:08, Laurent Vivier wrote: hwrng core uses two buffers that can be mixed in the virtio-rng queue. This series fixes the problem by adding an internal buffer in virtio-rng. Once the internal buffer is added, we can fix two other problems: - to be able to release the driver

Re: [virtio-dev] Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 01:17:51PM +0200, Halil Pasic wrote: > On Mon, 4 Oct 2021 16:01:12 -0400 > "Michael S. Tsirkin" wrote: > > > > > > > Ok, so what about something like > > > > > > "If FEATURES_OK is not set, the driver MAY change the set of features it > > > accepts." > > > > > > in the

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 01:13:31PM +0200, Cornelia Huck wrote: > On Tue, Oct 05 2021, Halil Pasic wrote: > > > On Mon, 4 Oct 2021 05:07:13 -0400 > > "Michael S. Tsirkin" wrote: > >> Well we established that we can know. Here's an alternative explanation: > > > > > > I thin we established how

Re: [virtio-dev] Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Mon, 4 Oct 2021 16:01:12 -0400 "Michael S. Tsirkin" wrote: > > > > Ok, so what about something like > > > > "If FEATURES_OK is not set, the driver MAY change the set of features it > > accepts." > > > > in the device initialization section? > > Maybe "as long as". However Halil implied

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Cornelia Huck
On Tue, Oct 05 2021, Halil Pasic wrote: > On Mon, 4 Oct 2021 05:07:13 -0400 > "Michael S. Tsirkin" wrote: >> Well we established that we can know. Here's an alternative explanation: > > > I thin we established how this should be in the future, where a transport > specific mechanism is used to

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 12:46:34PM +0200, Halil Pasic wrote: > On Tue, 5 Oct 2021 03:53:17 -0400 > "Michael S. Tsirkin" wrote: > > > > Wouldn't a call from transport code into virtio core > > > be more handy? What I have in mind is stuff like vhost-user and vdpa. My > > > understanding is, that

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 12:43:03PM +0200, Halil Pasic wrote: > On Mon, 4 Oct 2021 05:07:13 -0400 > "Michael S. Tsirkin" wrote: > > > On Mon, Oct 04, 2021 at 04:23:23AM +0200, Halil Pasic wrote: > > > On Sat, 2 Oct 2021 14:13:37 -0400 > > > "Michael S. Tsirkin" wrote: > > > > > > > > Anyone

Re: [PATCH 2/3] vdpa: Add vhost_vdpa_section_end

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 11:52:37AM +0200, Eugenio Perez Martin wrote: > On Tue, Oct 5, 2021 at 10:15 AM Michael S. Tsirkin wrote: > > > > On Tue, Oct 05, 2021 at 10:01:30AM +0200, Eugenio Pérez wrote: > > > Abstract this operation, that will be reused when validating the region > > > against the

Re: [PATCH 3/3] vdpa: Check for iova range at mappings changes

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 11:58:12AM +0200, Eugenio Perez Martin wrote: > On Tue, Oct 5, 2021 at 10:14 AM Michael S. Tsirkin wrote: > > > > On Tue, Oct 05, 2021 at 10:01:31AM +0200, Eugenio Pérez wrote: > > > Check vdpa device range before updating memory regions so we don't add > > > any outside

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Tue, 5 Oct 2021 03:53:17 -0400 "Michael S. Tsirkin" wrote: > > Wouldn't a call from transport code into virtio core > > be more handy? What I have in mind is stuff like vhost-user and vdpa. My > > understanding is, that for vhost setups where the config is outside qemu, > > we probably need a

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Mon, 4 Oct 2021 05:07:13 -0400 "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 04:23:23AM +0200, Halil Pasic wrote: > > On Sat, 2 Oct 2021 14:13:37 -0400 > > "Michael S. Tsirkin" wrote: > > > > > > Anyone else have an idea? This is a nasty regression; we could revert > > > > the >

Re: [PATCH v5] virtio-blk: Add validation for block size in config space

2021-10-05 Thread Michael S. Tsirkin
On Mon, Oct 04, 2021 at 11:27:29AM -0400, Michael S. Tsirkin wrote: > On Mon, Aug 09, 2021 at 06:16:09PM +0800, Xie Yongji wrote: > > An untrusted device might presents an invalid block size > > in configuration space. This tries to add validation for it > > in the validate callback and clear the

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Cornelia Huck
On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 04:23:23AM +0200, Halil Pasic wrote: >> --8<- >> >> From: Halil Pasic >> Date: Thu, 30 Sep 2021 02:38:47 +0200 >> Subject: [PATCH] virtio: write back feature VERSION_1 before

Re: [PATCH 2/3] vdpa: Add vhost_vdpa_section_end

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 10:01:30AM +0200, Eugenio Pérez wrote: > Abstract this operation, that will be reused when validating the region > against the iova range that the device supports. > > Signed-off-by: Eugenio Pérez Note that as defined end is actually 1 byte beyond end of section. As such

Re: [PATCH 3/3] vdpa: Check for iova range at mappings changes

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 10:01:31AM +0200, Eugenio Pérez wrote: > Check vdpa device range before updating memory regions so we don't add > any outside of it, and report the invalid change if any. > > Signed-off-by: Eugenio Pérez > --- > include/hw/virtio/vhost-vdpa.h | 2 + >

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Michael S. Tsirkin
On Tue, Oct 05, 2021 at 09:25:39AM +0200, Halil Pasic wrote: > On Mon, 4 Oct 2021 09:11:04 -0400 > "Michael S. Tsirkin" wrote: > > > > >> static inline bool virtio_access_is_big_endian(VirtIODevice *vdev) > > > >> { > > > >> #if defined(LEGACY_VIRTIO_IS_BIENDIAN) > > > >> return

Re: [PATCH] x86/paravirt: use %rip-relative addressing in hook calls

2021-10-05 Thread Juergen Gross via Virtualization
On 30.09.21 14:40, Jan Beulich via Virtualization wrote: While using a plain (constant) address works, its use needlessly invokes a SIB addressing mode, making every call site one byte larger than necessary. Instead of using an "i" constraint with address-of operator and a 'c' operand modifier,

Re: [PATCH 0/9] More virtio hardening

2021-10-05 Thread Michael S. Tsirkin
On Mon, Sep 13, 2021 at 01:53:44PM +0800, Jason Wang wrote: > Hi All: > > This series treis to do more hardening for virito. > > patch 1 validates the num_queues for virio-blk device. > patch 2-4 validates max_nr_ports for virito-console device. > patch 5-7 harden virtio-pci interrupts to make

Re: [virtio-dev] Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Cornelia Huck
On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 05:45:06PM +0200, Cornelia Huck wrote: >> On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote: >> >> > On Mon, Oct 04, 2021 at 04:27:23PM +0200, Cornelia Huck wrote: >> >> On Mon, Oct 04 2021, "Michael S. Tsirkin" wrote:

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Mon, 4 Oct 2021 09:11:04 -0400 "Michael S. Tsirkin" wrote: > > >> static inline bool virtio_access_is_big_endian(VirtIODevice *vdev) > > >> { > > >> #if defined(LEGACY_VIRTIO_IS_BIENDIAN) > > >> return virtio_is_big_endian(vdev); > > >> #elif defined(TARGET_WORDS_BIGENDIAN) > > >> if

[PATCH] virtio_console: break out of buf poll on remove

2021-10-05 Thread Michael S. Tsirkin
A common pattern for device reset is currently: vdev->config->reset(vdev); .. cleanup .. reset prevents new interrupts from arriving and waits for interrupt handlers to finish. However if - as is common - the handler queues a work request which is flushed during the cleanup stage, we have code

Re: [PATCH] gpio: aggregator: Add interrupt support

2021-10-05 Thread Geert Uytterhoeven
Hi Viresh, On Tue, Oct 5, 2021 at 7:50 AM Viresh Kumar wrote: > On 04-10-21, 14:44, Geert Uytterhoeven wrote: > > Currently the GPIO Aggregator does not support interrupts. This means > > that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), > > and userspace applications using