Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Rusty Russell
Andrey Ryabinin writes: > On 02/19/2015 02:10 AM, Rusty Russell wrote: >> This is not portable. Other archs don't use vmalloc, or don't use >> (or define) MODULES_VADDR. If you really want to hook here, you'd >> need a new flag (or maybe use PAGE_KERNEL_EXEC after an

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-19 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/19/2015 02:10 AM, Rusty Russell wrote: This is not portable. Other archs don't use vmalloc, or don't use (or define) MODULES_VADDR. If you really want to hook here, you'd need a new flag (or maybe use PAGE_KERNEL_EXEC after an audit

Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN

2015-02-18 Thread Rusty Russell
Lucas De Marchi writes: > On Wed, Feb 18, 2015 at 8:40 PM, Rusty Russell wrote: >> Lucas De Marchi writes: >>> On Wed, Feb 18, 2015 at 2:07 AM, Rusty Russell >>> wrote: >>> Yeah, I just thought (an wanted that) the attributes were being >>> creat

Re: linux-next: Tree for Feb 18 (x86)

2015-02-18 Thread Rusty Russell
been released. >>> >>> Changes since 20150217: >>> >> >> >> on i386, when CONFIG_PCI is not enabled: > > This is all lguest-related. Looks like LGUEST_GUEST should also > depend on PCI (in arch/x86/lguest/Kconfig). I've committed this to my fixes b

Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN

2015-02-18 Thread Rusty Russell
Lucas De Marchi writes: > On Wed, Feb 18, 2015 at 2:07 AM, Rusty Russell wrote: > Yeah, I just thought (an wanted that) the attributes were being > created first and then hooked up in the sysfs tree under > /sys/module/. I.e. if the directory exists and there's no > initstate

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-18 Thread Rusty Russell
etter choice. Cheers, Rusty. > Signed-off-by: Andrey Ryabinin > Cc: Dmitry Vyukov > Cc: Rusty Russell > --- > arch/x86/kernel/module.c | 11 +-- > include/linux/kasan.h| 26 +++--- > kernel/module.c | 2 -- > mm/kasan/kasan.c

Re: [PATCH] kasan, module, vmalloc: rework shadow allocation for modules

2015-02-18 Thread Rusty Russell
: Dmitry Vyukov dvyu...@google.com Cc: Rusty Russell ru...@rustcorp.com.au --- arch/x86/kernel/module.c | 11 +-- include/linux/kasan.h| 26 +++--- kernel/module.c | 2 -- mm/kasan/kasan.c | 12 +--- mm/vmalloc.c | 10

Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN

2015-02-18 Thread Rusty Russell
Lucas De Marchi lucas.de.mar...@gmail.com writes: On Wed, Feb 18, 2015 at 2:07 AM, Rusty Russell ru...@rustcorp.com.au wrote: Yeah, I just thought (an wanted that) the attributes were being created first and then hooked up in the sysfs tree under /sys/module/modulename. I.e. if the directory

Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN

2015-02-18 Thread Rusty Russell
Lucas De Marchi lucas.de.mar...@gmail.com writes: On Wed, Feb 18, 2015 at 8:40 PM, Rusty Russell ru...@rustcorp.com.au wrote: Lucas De Marchi lucas.de.mar...@gmail.com writes: On Wed, Feb 18, 2015 at 2:07 AM, Rusty Russell ru...@rustcorp.com.au wrote: Yeah, I just thought (an wanted

Re: linux-next: Tree for Feb 18 (x86)

2015-02-18 Thread Rusty Russell
-by: Rusty Russell ru...@rustcorp.com.au diff --git a/arch/x86/lguest/Kconfig b/arch/x86/lguest/Kconfig index 4a0890f815c4..21e89807244c 100644 --- a/arch/x86/lguest/Kconfig +++ b/arch/x86/lguest/Kconfig @@ -1,6 +1,6 @@ config LGUEST_GUEST bool Lguest guest support - depends on X86_32

[PULL] virtio-next

2015-02-17 Thread Rusty Russell
version Rusty Russell (53): virtio-pci: define layout for virtio 1.0 virtio_pci: macros for PCI layout offsets virtio: define VIRTIO_PCI_CAP_PCI_CFG in header. virtio: Don't expose legacy block features when VIRTIO_BLK_NO_LEGACY defined. virtio: Don't expose legacy config

Re: [PATCH 3.2 082/152] virtio: use dev_to_virtio wrapper in virtio

2015-02-17 Thread Rusty Russell
Ben Hutchings writes: > On Tue, 2015-02-17 at 15:56 +1030, Rusty Russell wrote: >> Ben Hutchings writes: >> > 3.2.67-rc1 review patch. If anyone has any objections, please let me know. >> >> Ben, what are your criteria for putting patches into 3.2? >>

Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN

2015-02-17 Thread Rusty Russell
Lucas De Marchi writes: > On Tue, Feb 17, 2015 at 10:56 AM, Harish Jenny K N > wrote: >> usecase: two sd cards are being mounted in parallel at same time on >> dual core. example modules which are getting loaded is nls_cp437. >> While one module is being loaded , it starts creating sysfs files.

Re: [PATCH 3.2 082/152] virtio: use dev_to_virtio wrapper in virtio

2015-02-17 Thread Rusty Russell
Ben Hutchings writes: > 3.2.67-rc1 review patch. If anyone has any objections, please let me know. Ben, what are your criteria for putting patches into 3.2? This patch is a trivial cleanup. It doesn't fix anything, but it does add some churn. I can see that 083 and 084 follow this, but 083

Re: [PATCH 3.2 082/152] virtio: use dev_to_virtio wrapper in virtio

2015-02-17 Thread Rusty Russell
Ben Hutchings b...@decadent.org.uk writes: 3.2.67-rc1 review patch. If anyone has any objections, please let me know. Ben, what are your criteria for putting patches into 3.2? This patch is a trivial cleanup. It doesn't fix anything, but it does add some churn. I can see that 083 and 084

Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN

2015-02-17 Thread Rusty Russell
Lucas De Marchi lucas.de.mar...@gmail.com writes: On Tue, Feb 17, 2015 at 10:56 AM, Harish Jenny K N harish_kand...@mentor.com wrote: usecase: two sd cards are being mounted in parallel at same time on dual core. example modules which are getting loaded is nls_cp437. While one module is being

[PULL] virtio-next

2015-02-17 Thread Rusty Russell
version Rusty Russell (53): virtio-pci: define layout for virtio 1.0 virtio_pci: macros for PCI layout offsets virtio: define VIRTIO_PCI_CAP_PCI_CFG in header. virtio: Don't expose legacy block features when VIRTIO_BLK_NO_LEGACY defined. virtio: Don't expose legacy config

Re: [PATCH 3.2 082/152] virtio: use dev_to_virtio wrapper in virtio

2015-02-17 Thread Rusty Russell
Ben Hutchings b...@decadent.org.uk writes: On Tue, 2015-02-17 at 15:56 +1030, Rusty Russell wrote: Ben Hutchings b...@decadent.org.uk writes: 3.2.67-rc1 review patch. If anyone has any objections, please let me know. Ben, what are your criteria for putting patches into 3.2? This patch

Re: [PATCH v11 19/19] kasan: enable instrumentation of global variables

2015-02-16 Thread Rusty Russell
Andrey Ryabinin writes: > On 02/16/2015 05:58 AM, Rusty Russell wrote: >> Andrey Ryabinin writes: >>> This feature let us to detect accesses out of bounds of >>> global variables. This will work as for globals in kernel >>> image, so for globals i

Re: [PATCH] module: do not print allocation-fail warning on bogus user buffer size

2015-02-16 Thread Rusty Russell
"Kirill A. Shutemov" writes: > init_module(2) passes user-specified buffer length directly to > vmalloc(). It makes warn_alloc_failed() to print out a lot of info into > dmesg if user specified insane size, like -1. > > Let's silence the warning. It doesn't add much value to -ENOMEM return >

Re: [PATCH] module: do not print allocation-fail warning on bogus user buffer size

2015-02-16 Thread Rusty Russell
Kirill A. Shutemov kirill.shute...@linux.intel.com writes: init_module(2) passes user-specified buffer length directly to vmalloc(). It makes warn_alloc_failed() to print out a lot of info into dmesg if user specified insane size, like -1. Let's silence the warning. It doesn't add much value

Re: [PATCH v11 19/19] kasan: enable instrumentation of global variables

2015-02-16 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: On 02/16/2015 05:58 AM, Rusty Russell wrote: Andrey Ryabinin a.ryabi...@samsung.com writes: This feature let us to detect accesses out of bounds of global variables. This will work as for globals in kernel image, so for globals in modules

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-15 Thread Rusty Russell
Define virtio_net_hdr_v1 unconditionally? Thanks, that's a good idea! Here's the incremental: virtio_net: unconditionally define struct virtio_net_hdr_v1. This was introduced in commit ed9ecb0415b97b5f9f91f146e1977bb372c74c6d, but only defined if !VIRTIO_NET_NO_LEGACY. We should always define it: easier

Re: [PATCH 1/2] virtio_pci_modern: type-safe io accessors

2015-02-15 Thread Rusty Russell
Rusty Russell writes: > "Michael S. Tsirkin" writes: >> The spec is very clear on this: >> >> 4.1.3.1 Driver Requirements: PCI Device Layout >> >> The driver MUST access each field using the “natural” access method, >> i.e. 32-bit accesses for 32

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-15 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Sun, Feb 08, 2015 at 11:59:08AM +0100, Michael S. Tsirkin wrote: >> On Fri, Feb 06, 2015 at 03:36:54PM +1030, Rusty Russell wrote: >> > In particular, the virtio header always has the u16 num_buffers field. >> > We defin

Re: [PATCH v11 18/19] module: fix types of device tables aliases

2015-02-15 Thread Rusty Russell
Andrey Ryabinin writes: > MODULE_DEVICE_TABLE() macro used to create aliases to device tables. > Normally alias should have the same type as aliased symbol. > > Device tables are arrays, so they have 'struct type##_device_id[x]' > types. Alias created by MODULE_DEVICE_TABLE() will have non-array

Re: [PATCH v11 19/19] kasan: enable instrumentation of global variables

2015-02-15 Thread Rusty Russell
Andrey Ryabinin writes: > This feature let us to detect accesses out of bounds of > global variables. This will work as for globals in kernel > image, so for globals in modules. Currently this won't work > for symbols in user-specified sections (e.g. __init, __read_mostly, ...) > > The idea of

Re: [PATCH 1/2] virtio_pci_modern: type-safe io accessors

2015-02-15 Thread Rusty Russell
"Michael S. Tsirkin" writes: > The spec is very clear on this: > > 4.1.3.1 Driver Requirements: PCI Device Layout > > The driver MUST access each field using the “natural” access method, > i.e. 32-bit accesses for 32-bit fields, 16-bit accesses for 16-bit > fields and 8-bit accesses for 8-bit

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-15 Thread Rusty Russell
Cornelia Huck writes: > On Fri, 13 Feb 2015 13:22:09 +1030 > Rusty Russell wrote: > >> "Michael S. Tsirkin" writes: >> > On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: >> >> Jason Wang writes: >> >> > This p

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-15 Thread Rusty Russell
Pawel Moll writes: > On Fri, 2015-02-13 at 02:52 +0000, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: >> >> Jason Wang writes: >> >> > This patch e

Re: [PATCH v11 19/19] kasan: enable instrumentation of global variables

2015-02-15 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: This feature let us to detect accesses out of bounds of global variables. This will work as for globals in kernel image, so for globals in modules. Currently this won't work for symbols in user-specified sections (e.g. __init, __read_mostly, ...)

Re: [PATCH 1/2] virtio_pci_modern: type-safe io accessors

2015-02-15 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: The spec is very clear on this: 4.1.3.1 Driver Requirements: PCI Device Layout The driver MUST access each field using the “natural” access method, i.e. 32-bit accesses for 32-bit fields, 16-bit accesses for 16-bit fields and 8-bit accesses for

Re: [PATCH v11 18/19] module: fix types of device tables aliases

2015-02-15 Thread Rusty Russell
Andrey Ryabinin a.ryabi...@samsung.com writes: MODULE_DEVICE_TABLE() macro used to create aliases to device tables. Normally alias should have the same type as aliased symbol. Device tables are arrays, so they have 'struct type##_device_id[x]' types. Alias created by MODULE_DEVICE_TABLE()

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-15 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Sun, Feb 08, 2015 at 11:59:08AM +0100, Michael S. Tsirkin wrote: On Fri, Feb 06, 2015 at 03:36:54PM +1030, Rusty Russell wrote: In particular, the virtio header always has the u16 num_buffers field. We define a new 'struct virtio_net_modern_hdr

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-15 Thread Rusty Russell
Cornelia Huck cornelia.h...@de.ibm.com writes: On Fri, 13 Feb 2015 13:22:09 +1030 Rusty Russell ru...@rustcorp.com.au wrote: Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: Jason Wang jasow...@redhat.com writes: This patch

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-15 Thread Rusty Russell
Pawel Moll pawel.m...@arm.com writes: On Fri, 2015-02-13 at 02:52 +, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: Jason Wang jasow...@redhat.com writes: This patch enables the interrupt coalescing

Re: [PATCH 1/2] virtio_pci_modern: type-safe io accessors

2015-02-15 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: The spec is very clear on this: 4.1.3.1 Driver Requirements: PCI Device Layout The driver MUST access each field using the “natural” access method, i.e. 32-bit accesses for 32-bit fields, 16-bit accesses

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-15 Thread Rusty Russell
conditional legacy code. Suggested-by: Michael S. Tsirkin m...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 4a9b58113d6e..7bbee79ca293 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include

[PULL] modules-next

2015-02-12 Thread Rusty Russell
The following changes since commit f8de05ca38b7bce4079b52002a6817e9582e3e01: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (2015-01-23 06:53:06 +1200) are available in the git repository at:

[PATCH] virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice.

2015-02-12 Thread Rusty Russell
I noticed this with the console device. It's not *wrong*, just a bit weird. Signed-off-by: Rusty Russell diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index b9f70dfc4751..5ce2aa48fc6e 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -236,7 +236,10

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-12 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: >> Jason Wang writes: >> > This patch enables the interrupt coalescing setting through ethtool. >> >> The problem is that there's nothing network specific a

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-12 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: Jason Wang jasow...@redhat.com writes: This patch enables the interrupt coalescing setting through ethtool. The problem is that there's nothing network specific about interrupt

[PATCH] virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice.

2015-02-12 Thread Rusty Russell
I noticed this with the console device. It's not *wrong*, just a bit weird. Signed-off-by: Rusty Russell ru...@rustcorp.com.au diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index b9f70dfc4751..5ce2aa48fc6e 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c

[PULL] modules-next

2015-02-12 Thread Rusty Russell
The following changes since commit f8de05ca38b7bce4079b52002a6817e9582e3e01: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (2015-01-23 06:53:06 +1200) are available in the git repository at:

Re: [PATCH] virtual: Documentation: simplify and generalize paravirt_ops.txt

2015-02-11 Thread Rusty Russell
"Luis R. Rodriguez" writes: > From: "Luis R. Rodriguez" > > The general documentation we have for pv_ops is currenty present > on the IA64 docs, but since this documentation covers IA64 xen > enablement and IA64 Xen support got ripped out a while ago > through commit d52eefb47 present since

Re: [PATCH] virtual: Documentation: simplify and generalize paravirt_ops.txt

2015-02-11 Thread Rusty Russell
Luis R. Rodriguez mcg...@do-not-panic.com writes: From: Luis R. Rodriguez mcg...@suse.com The general documentation we have for pv_ops is currenty present on the IA64 docs, but since this documentation covers IA64 xen enablement and IA64 Xen support got ripped out a while ago through commit

Re: [PATCH] module: Annotate nested sleep in resolve_symbol()

2015-02-10 Thread Rusty Russell
> > > Therefore replace the 'correct' but verbose wait_woken() thing with > > a simple annotation to shut up the warning. > > > > Cc: Rusty Russell > > Signed-off-by: Peter Zijlstra (Intel) > > Seems to suppress the warning, and modules still work. > &

[PATCH 2/2] virtio: Introducing virtio_pci.no_mmio, the worst boot option in history.

2015-02-10 Thread Rusty Russell
at offset cap.offset at BAR selected by cap.bar and store the first cap.length bytes in pci_cfg_data. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_common.c | 31 ++- drivers/virtio/virtio_pci_common.h | 21 + drivers/virtio/virtio_pci_legacy.c | 1

[PATCH 1/2] virtio_pci: abstract all MMIO accesses.

2015-02-10 Thread Rusty Russell
This is in preparation for testing the virtio pci config mmio backdoor. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_common.c | 47 - drivers/virtio/virtio_pci_common.h | 41 +++ drivers/virtio/virtio_pci_modern.c | 140

Re: [PATCH RFC v5 net-next 1/6] virtio_ring: fix virtqueue_enable_cb() when only 1 buffers were pending

2015-02-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Feb 10, 2015 at 11:33:52AM +1030, Rusty Russell wrote: >> Jason Wang writes: >> > We currently does: >> > >> > bufs = (avail->idx - last_used_idx) * 3 / 4; >> > >> > This is ok now si

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-10 Thread Rusty Russell
Rusty Russell writes: > "Michael S. Tsirkin" writes: >> On Fri, Feb 06, 2015 at 03:36:54PM +1030, Rusty Russell wrote: >>> In particular, the virtio header always has the u16 num_buffers field. >>> We define a new 'struct virtio_net_modern_hdr' for this (rath

Re: [PATCH v12 06/28] module: Do not inline do_init_module

2015-02-10 Thread Rusty Russell
Jan Kiszka writes: > This provides a reliable breakpoint target, required for automatic > symbol loading via the gdb helper command 'lx-symbols'. > > CC: Rusty Russell Acked-by: Rusty Russell Thanks, Rusty. > Signed-off-by: Jan Kiszka > --- > kernel/module.c | 9 ++

[RFC 0/2] virtio_pci: patches never to apply.

2015-02-10 Thread Rusty Russell
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support, but I'm pretty sure we should never allow these patches upstream. Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG. Rusty Russell (2): virtio_pci: abstract all MMIO accesses. virtio

[PATCH 1/2] virtio_pci: abstract all MMIO accesses.

2015-02-10 Thread Rusty Russell
This is in preparation for testing the virtio pci config mmio backdoor. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_pci_common.c | 47 - drivers/virtio/virtio_pci_common.h | 41 +++ drivers/virtio/virtio_pci_modern.c | 140

Re: [PATCH] module: Annotate nested sleep in resolve_symbol()

2015-02-10 Thread Rusty Russell
with a simple annotation to shut up the warning. Cc: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Peter Zijlstra (Intel) pet...@infradead.org Seems to suppress the warning, and modules still work. Tested-by: Dave Jones da...@codemonkey.org.uk OK, applied. Thanks! Rusty

[PATCH 2/2] virtio: Introducing virtio_pci.no_mmio, the worst boot option in history.

2015-02-10 Thread Rusty Russell
at offset cap.offset at BAR selected by cap.bar and store the first cap.length bytes in pci_cfg_data. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_pci_common.c | 31 ++- drivers/virtio/virtio_pci_common.h | 21 + drivers/virtio

Re: [PATCH RFC v5 net-next 1/6] virtio_ring: fix virtqueue_enable_cb() when only 1 buffers were pending

2015-02-10 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 10, 2015 at 11:33:52AM +1030, Rusty Russell wrote: Jason Wang jasow...@redhat.com writes: We currently does: bufs = (avail-idx - last_used_idx) * 3 / 4; This is ok now since we only try to enable the delayed callbacks when

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-10 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: On Fri, Feb 06, 2015 at 03:36:54PM +1030, Rusty Russell wrote: In particular, the virtio header always has the u16 num_buffers field. We define a new 'struct virtio_net_modern_hdr' for this (rather than

Re: [PATCH v12 06/28] module: Do not inline do_init_module

2015-02-10 Thread Rusty Russell
Jan Kiszka jan.kis...@siemens.com writes: This provides a reliable breakpoint target, required for automatic symbol loading via the gdb helper command 'lx-symbols'. CC: Rusty Russell ru...@rustcorp.com.au Acked-by: Rusty Russell ru...@rustcorp.com.au Thanks, Rusty. Signed-off-by: Jan

[RFC 0/2] virtio_pci: patches never to apply.

2015-02-10 Thread Rusty Russell
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support, but I'm pretty sure we should never allow these patches upstream. Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG. Rusty Russell (2): virtio_pci: abstract all MMIO accesses. virtio

[PATCH] virtio_pci: use 16-bit accessor for queue_enable.

2015-02-09 Thread Rusty Russell
and 8-bit accesses for 8-bit fields. Signed-off-by: Rusty Russell diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index f16e462cb4ef..2aa38e59db2e 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -294,7 +294,7

Re: [PATCH RFC v5 net-next 1/6] virtio_ring: fix virtqueue_enable_cb() when only 1 buffers were pending

2015-02-09 Thread Rusty Russell
Jason Wang writes: > We currently does: > > bufs = (avail->idx - last_used_idx) * 3 / 4; > > This is ok now since we only try to enable the delayed callbacks when > the queue is about to be full. This may not work well when there is > only one pending buffer in the virtqueue (this may be the case

Re: [PATCH RFC v5 net-next 2/6] virtio_ring: try to disable event index callbacks in virtqueue_disable_cb()

2015-02-09 Thread Rusty Russell
t; > Signed-off-by: Jason Wang Acked-by: Rusty Russell > --- > drivers/virtio/virtio_ring.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 545fed5..e9ffbfb 100644 > --- a/drivers/virt

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-09 Thread Rusty Russell
to coalesce by number of frames, but we can still do number of sg entries, as we do now with used_event, and we could change virtqueue_enable_cb_delayed() to take a precise number if we wanted. My feeling is that this should be a v1.0-only feature though (eg. feature bit 33). Cheers, Rusty. > Cc

Re: [PATCH RFC v5 net-next 2/6] virtio_ring: try to disable event index callbacks in virtqueue_disable_cb()

2015-02-09 Thread Rusty Russell
. Signed-off-by: Jason Wang jasow...@redhat.com Acked-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_ring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 545fed5..e9ffbfb 100644 --- a/drivers/virtio

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-09 Thread Rusty Russell
: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/virtio_net.c| 67 + include/uapi/linux/virtio_net.h | 12 2 files changed, 79 insertions

Re: [PATCH RFC v5 net-next 1/6] virtio_ring: fix virtqueue_enable_cb() when only 1 buffers were pending

2015-02-09 Thread Rusty Russell
Jason Wang jasow...@redhat.com writes: We currently does: bufs = (avail-idx - last_used_idx) * 3 / 4; This is ok now since we only try to enable the delayed callbacks when the queue is about to be full. This may not work well when there is only one pending buffer in the virtqueue (this may

[PATCH] virtio_pci: use 16-bit accessor for queue_enable.

2015-02-09 Thread Rusty Russell
and 8-bit accesses for 8-bit fields. Signed-off-by: Rusty Russell ru...@rustcorp.com.au diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index f16e462cb4ef..2aa38e59db2e 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c

Re: [PATCH 5/5] virtio: don't require a config space on the console device.

2015-02-08 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Feb 06, 2015 at 03:36:56PM +1030, Rusty Russell wrote: >> Strictly, it's only needed when we have features (size or multiport). >> >> Signed-off-by: Rusty Russell >> --- >> drivers/char/virtio_console.c | 12 ++

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-08 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Feb 06, 2015 at 03:36:54PM +1030, Rusty Russell wrote: >> In particular, the virtio header always has the u16 num_buffers field. >> We define a new 'struct virtio_net_modern_hdr' for this (rather than >> simply calling it 's

Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-08 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Feb 06, 2015 at 03:36:54PM +1030, Rusty Russell wrote: In particular, the virtio header always has the u16 num_buffers field. We define a new 'struct virtio_net_modern_hdr' for this (rather than simply calling it 'struct virtio_net_hdr

Re: [PATCH 5/5] virtio: don't require a config space on the console device.

2015-02-08 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Feb 06, 2015 at 03:36:56PM +1030, Rusty Russell wrote: Strictly, it's only needed when we have features (size or multiport). Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/char/virtio_console.c | 12 1 file

[PATCH 01/29] lguest: have --rng read from /dev/urandom not /dev/random.

2015-02-05 Thread Rusty Russell
Theoretical debates aside, now it boots. Signed-off-by: Rusty Russell --- tools/lguest/lguest.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index 32cf2ce15d69..3f7f2326cd9a 100644 --- a/tools/lguest/lguest.c +++ b

[PATCH 03/29] lguest: write more information to userspace about pending traps.

2015-02-05 Thread Rusty Russell
This is preparation for userspace handling MMIO and ioport accesses. Signed-off-by: Rusty Russell --- drivers/lguest/core.c | 7 --- drivers/lguest/hypercalls.c | 7 --- drivers/lguest/lg.h | 3 ++- drivers/lguest/lguest_user.c| 14

[PATCH 02/29] lguest: add operations to get/set a register from the Launcher.

2015-02-05 Thread Rusty Russell
We use the ptrace API struct, and we currently don't let them set anything but the normal registers (we'd have to filter the others). Signed-off-by: Rusty Russell --- drivers/lguest/core.c | 8 +++ drivers/lguest/lg.h | 3 +++ drivers/lguest/lguest_user.c| 49

[PATCH 07/29] lguest: suppress PS/2 keyboard polling.

2015-02-05 Thread Rusty Russell
While hacking on getting I/O out to the lguest launcher, I noticed that returning 0xFF for the PS/2 keyboard status made it spin for a while thinking there was a key pending. Fix this by returning 1 instead of 0xFF. Signed-off-by: Rusty Russell --- tools/lguest/lguest.c | 4 1 file

[PATCH 06/29] lguest: send trap 13 through to userspace.

2015-02-05 Thread Rusty Russell
We copy 7 bytes at eip for userspace's instruction decode; we have to carefully handle the case where eip is at the end of a page. We can't leave this to userspace since kernel has all the page table decode logic. The decode logic moves to userspace, basically unchanged. Signed-off-by: Rusty

[PATCH 05/29] lguest: add infrastructure to check mappings.

2015-02-05 Thread Rusty Russell
We normally abort the guest unconditionally when it gives us a bad address, but in the next patch we want to copy some bytes which may not be mapped. Signed-off-by: Rusty Russell --- drivers/lguest/lg.h | 1 + drivers/lguest/page_tables.c | 42

[PATCH 04/29] lguest: add infrastructure for userspace to deliver a trap to the guest.

2015-02-05 Thread Rusty Russell
This is required for instruction emulation to move to userspace. Signed-off-by: Rusty Russell --- drivers/lguest/lguest_user.c| 19 +++ include/linux/lguest_launcher.h | 1 + 2 files changed, 20 insertions(+) diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest

[PATCH 09/29] lguest: add iomem region, where guest page faults get sent to userspace.

2015-02-05 Thread Rusty Russell
This lets us implement PCI. Signed-off-by: Rusty Russell --- drivers/lguest/lg.h | 7 ++- drivers/lguest/lguest_user.c | 3 ++- drivers/lguest/page_tables.c | 33 ++--- drivers/lguest/x86/core.c| 19 ++- tools/lguest/lguest.c

[PATCH 00/29] lguest virtio PCI 1.0 adaptation.

2015-02-05 Thread Rusty Russell
) to perform early boot messages. It's slow and ugly, but it works. Finally, the last two patches remove the last of the old hypercall notification mechanism. Cheers! Rusty. Rusty Russell (29): lguest: have --rng read from /dev/urandom not /dev/random. lguest: add operations to get/set a register

[PATCH 08/29] lguest: don't disable iospace.

2015-02-05 Thread Rusty Russell
This no longer speeds up boot (IDE got better, I guess), but it does stop us probing for a PCI bus. Signed-off-by: Rusty Russell --- arch/x86/lguest/boot.c | 8 1 file changed, 8 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index c1c1544b8485..47ec7f201d27

[PATCH 2/5] virtio: Don't expose legacy block features when VIRTIO_BLK_NO_LEGACY defined.

2015-02-05 Thread Rusty Russell
This allows modern implementations to ensure they don't use legacy feature bits or SCSI commands (which are not used in v1.0 non-legacy). Signed-off-by: Rusty Russell --- include/uapi/linux/virtio_blk.h | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git

[PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-05 Thread Rusty Russell
-by: Rusty Russell --- include/uapi/linux/virtio_net.h | 30 -- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index b5f1677b291c..32754f3000e8 100644 --- a/include/uapi/linux/virtio_net.h +++ b

[PATCH 5/5] virtio: don't require a config space on the console device.

2015-02-05 Thread Rusty Russell
Strictly, it's only needed when we have features (size or multiport). Signed-off-by: Rusty Russell --- drivers/char/virtio_console.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 26afb56a8073

[PATCH 4/5] virtio: Don't expose legacy config features when VIRTIO_CONFIG_NO_LEGACY defined.

2015-02-05 Thread Rusty Russell
The VIRTIO_F_ANY_LAYOUT and VIRTIO_F_NOTIFY_ON_EMPTY features are pre-1.0 only. Signed-off-by: Rusty Russell --- include/uapi/linux/virtio_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index a6d0cdeaacd4

[PATCH 1/5] virtio: define VIRTIO_PCI_CAP_PCI_CFG in header.

2015-02-05 Thread Rusty Russell
This provides backdoor access to the device MMIOs, and every device should have one. From the virtio 1.0 spec (CS03): 4.1.4.7.1 Device Requirements: PCI configuration access capability The device MUST present at least one VIRTIO_PCI_CAP_PCI_CFG capability. Signed-off-by: Rusty Russell

[PATCH 0/5] virtio 1.0 cleanups and one fix.

2015-02-05 Thread Rusty Russell
Hi all, Some minor fixes for my virtio-next tree. Michael, does QEMU implement the (compuslory!) VIRTIO_PCI_CAP_PCI_CFG field? I'm guessing not, since it wasn't defined in the Linux header :( Rusty Russell (5): virtio: define VIRTIO_PCI_CAP_PCI_CFG in header. virtio: Don't expose

[PATCH 03/29] lguest: write more information to userspace about pending traps.

2015-02-05 Thread Rusty Russell
This is preparation for userspace handling MMIO and ioport accesses. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/lguest/core.c | 7 --- drivers/lguest/hypercalls.c | 7 --- drivers/lguest/lg.h | 3 ++- drivers/lguest/lguest_user.c| 14

[PATCH 01/29] lguest: have --rng read from /dev/urandom not /dev/random.

2015-02-05 Thread Rusty Russell
Theoretical debates aside, now it boots. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- tools/lguest/lguest.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index 32cf2ce15d69..3f7f2326cd9a 100644 --- a/tools

[PATCH 02/29] lguest: add operations to get/set a register from the Launcher.

2015-02-05 Thread Rusty Russell
We use the ptrace API struct, and we currently don't let them set anything but the normal registers (we'd have to filter the others). Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/lguest/core.c | 8 +++ drivers/lguest/lg.h | 3 +++ drivers/lguest

[PATCH 07/29] lguest: suppress PS/2 keyboard polling.

2015-02-05 Thread Rusty Russell
While hacking on getting I/O out to the lguest launcher, I noticed that returning 0xFF for the PS/2 keyboard status made it spin for a while thinking there was a key pending. Fix this by returning 1 instead of 0xFF. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- tools/lguest/lguest.c

[PATCH 06/29] lguest: send trap 13 through to userspace.

2015-02-05 Thread Rusty Russell
We copy 7 bytes at eip for userspace's instruction decode; we have to carefully handle the case where eip is at the end of a page. We can't leave this to userspace since kernel has all the page table decode logic. The decode logic moves to userspace, basically unchanged. Signed-off-by: Rusty

[PATCH 05/29] lguest: add infrastructure to check mappings.

2015-02-05 Thread Rusty Russell
We normally abort the guest unconditionally when it gives us a bad address, but in the next patch we want to copy some bytes which may not be mapped. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/lguest/lg.h | 1 + drivers/lguest/page_tables.c | 42

[PATCH 09/29] lguest: add iomem region, where guest page faults get sent to userspace.

2015-02-05 Thread Rusty Russell
This lets us implement PCI. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/lguest/lg.h | 7 ++- drivers/lguest/lguest_user.c | 3 ++- drivers/lguest/page_tables.c | 33 ++--- drivers/lguest/x86/core.c| 19 ++- tools

[PATCH 00/29] lguest virtio PCI 1.0 adaptation.

2015-02-05 Thread Rusty Russell
) to perform early boot messages. It's slow and ugly, but it works. Finally, the last two patches remove the last of the old hypercall notification mechanism. Cheers! Rusty. Rusty Russell (29): lguest: have --rng read from /dev/urandom not /dev/random. lguest: add operations to get/set a register

[PATCH 08/29] lguest: don't disable iospace.

2015-02-05 Thread Rusty Russell
This no longer speeds up boot (IDE got better, I guess), but it does stop us probing for a PCI bus. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/x86/lguest/boot.c | 8 1 file changed, 8 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index

[PATCH 04/29] lguest: add infrastructure for userspace to deliver a trap to the guest.

2015-02-05 Thread Rusty Russell
This is required for instruction emulation to move to userspace. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/lguest/lguest_user.c| 19 +++ include/linux/lguest_launcher.h | 1 + 2 files changed, 20 insertions(+) diff --git a/drivers/lguest/lguest_user.c b

[PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.

2015-02-05 Thread Rusty Russell
-by: Rusty Russell ru...@rustcorp.com.au --- include/uapi/linux/virtio_net.h | 30 -- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index b5f1677b291c..32754f3000e8 100644 --- a/include/uapi

[PATCH 5/5] virtio: don't require a config space on the console device.

2015-02-05 Thread Rusty Russell
Strictly, it's only needed when we have features (size or multiport). Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/char/virtio_console.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char

<    2   3   4   5   6   7   8   9   10   11   >