Re: [PATCH net-next] net, uapi: fix -Wpointer-arith warnings

2019-10-04 Thread David Miller
From: Alexey Dobriyan 
Date: Thu, 3 Oct 2019 23:29:24 +0300

> Add casts to fix these warnings:
> 
> ./usr/include/linux/netfilter_arp/arp_tables.h:200:19: error: pointer of type 
> 'void *' used in arithmetic [-Werror=pointer-arith]
> ./usr/include/linux/netfilter_bridge/ebtables.h:197:19: error: pointer of 
> type 'void *' used in arithmetic [-Werror=pointer-arith]
> ./usr/include/linux/netfilter_ipv4/ip_tables.h:223:19: error: pointer of type 
> 'void *' used in arithmetic [-Werror=pointer-arith]
> ./usr/include/linux/netfilter_ipv6/ip6_tables.h:263:19: error: pointer of 
> type 'void *' used in arithmetic [-Werror=pointer-arith]
> ./usr/include/linux/tipc_config.h:310:28: error: pointer of type 'void *' 
> used in arithmetic [-Werror=pointer-arith]
> ./usr/include/linux/tipc_config.h:410:24: error: pointer of type 'void *' 
> used in arithmetic [-Werror=pointer-arith]
> ./usr/include/linux/virtio_ring.h:170:16: error: pointer of type 'void *' 
> used in arithmetic [-Werror=pointer-arith]
> 
> Those are theoretical probably but kernel doesn't control compiler flags
> in userspace.
> 
> Signed-off-by: Alexey Dobriyan 

Applied.
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


[RESEND TRIVIAL 3/3] treewide: arch: Fix Kconfig indentation

2019-10-04 Thread Krzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in
coding style with command like:
$ sed -e 's/^/\t/' -i */Kconfig

Signed-off-by: Krzysztof Kozlowski 
---
 arch/Kconfig   |  4 ++--
 arch/alpha/Kconfig |  2 +-
 arch/arm/Kconfig.debug |  4 ++--
 arch/arm/mach-ep93xx/Kconfig   |  8 
 arch/arm/mach-hisi/Kconfig |  2 +-
 arch/arm/mach-ixp4xx/Kconfig   | 16 
 arch/arm/mach-mmp/Kconfig  |  2 +-
 arch/arm/mach-omap1/Kconfig| 14 +++---
 arch/arm/mach-prima2/Kconfig   |  6 +++---
 arch/arm/mach-s3c24xx/Kconfig  |  4 ++--
 arch/arm/mach-s3c64xx/Kconfig  |  6 +++---
 arch/arm/plat-samsung/Kconfig  |  2 +-
 arch/arm64/Kconfig |  6 +++---
 arch/arm64/Kconfig.debug   |  2 +-
 arch/h8300/Kconfig |  4 ++--
 arch/h8300/Kconfig.cpu |  4 ++--
 arch/m68k/Kconfig.bus  |  2 +-
 arch/m68k/Kconfig.debug| 16 
 arch/m68k/Kconfig.machine  |  8 
 arch/nds32/Kconfig.cpu | 18 +-
 arch/openrisc/Kconfig  | 26 +-
 arch/powerpc/Kconfig.debug | 18 +-
 arch/powerpc/platforms/Kconfig.cputype |  2 +-
 arch/riscv/Kconfig.socs|  2 +-
 arch/sh/boards/Kconfig |  2 +-
 arch/sh/mm/Kconfig |  2 +-
 arch/um/Kconfig|  2 +-
 arch/x86/Kconfig   | 18 +-
 28 files changed, 101 insertions(+), 101 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 5f8a5d84dbbe..8d4f77bbed29 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -76,7 +76,7 @@ config JUMP_LABEL
depends on HAVE_ARCH_JUMP_LABEL
depends on CC_HAS_ASM_GOTO
help
- This option enables a transparent branch optimization that
+This option enables a transparent branch optimization that
 makes certain almost-always-true or almost-always-false branch
 conditions even cheaper to execute within the kernel.
 
@@ -84,7 +84,7 @@ config JUMP_LABEL
 scheduler functionality, networking code and KVM have such
 branches and include support for this optimization technique.
 
- If it is detected that the compiler has support for "asm goto",
+If it is detected that the compiler has support for "asm goto",
 the kernel will compile such branches with just a nop
 instruction. When the condition flag is toggled to true, the
 nop will be converted to a jump instruction to execute the
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index ef179033a7c2..30a6291355cb 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -545,7 +545,7 @@ config NR_CPUS
default "4" if !ALPHA_GENERIC && !ALPHA_MARVEL
help
  MARVEL support can handle a maximum of 32 CPUs, all the others
-  with working support have a maximum of 4 CPUs.
+ with working support have a maximum of 4 CPUs.
 
 config ARCH_DISCONTIGMEM_ENABLE
bool "Discontiguous Memory Support"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 8bcbd0cd739b..0e5d52fbddbd 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -274,7 +274,7 @@ choice
select DEBUG_UART_8250
help
  Say Y here if you want the debug print routines to direct
-  their output to the CNS3xxx UART0.
+ their output to the CNS3xxx UART0.
 
config DEBUG_DAVINCI_DA8XX_UART1
bool "Kernel low-level debugging on DaVinci DA8XX using UART1"
@@ -828,7 +828,7 @@ choice
select DEBUG_UART_8250
help
  Say Y here if you want kernel low-level debugging support
-  on Rockchip RV1108 based platforms.
+ on Rockchip RV1108 based platforms.
 
config DEBUG_RV1108_UART1
bool "Kernel low-level debugging messages via Rockchip RV1108 
UART1"
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index f2db5fd38145..bf81dfab7f1b 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -126,10 +126,10 @@ config MACH_MICRO9S
  Contec Micro9-Slim board.
 
 config MACH_SIM_ONE
-bool "Support Simplemachines Sim.One board"
-help
-  Say 'Y' here if you want your kernel to support the
-  Simplemachines Sim.One board.
+   bool "Support Simplemachines Sim.One board"
+   help
+ Say 'Y' here if you want your kernel to support the
+ Simplemachines Sim.One board.
 
 config MACH_SNAPPER_CL15
bool "Support Bluewater Systems Snapper CL15 Module"
diff --git a/arch/arm/mach-hisi/Kconfig 

[RESEND TRIVIAL 2/3] treewide: Fix Kconfig indentation

2019-10-04 Thread Krzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in
coding style with command like:
$ sed -e 's/^/\t/' -i */Kconfig

Signed-off-by: Krzysztof Kozlowski 
---
 certs/Kconfig  | 14 ++---
 init/Kconfig   | 28 +-
 kernel/trace/Kconfig   |  8 
 lib/Kconfig|  2 +-
 lib/Kconfig.debug  | 36 +-
 lib/Kconfig.kgdb   |  8 
 mm/Kconfig | 28 +-
 samples/Kconfig|  2 +-
 security/apparmor/Kconfig  |  2 +-
 security/integrity/Kconfig | 24 +++
 security/integrity/ima/Kconfig | 12 ++--
 security/safesetid/Kconfig | 24 +++
 12 files changed, 94 insertions(+), 94 deletions(-)

diff --git a/certs/Kconfig b/certs/Kconfig
index c94e93d8bccf..0358c66d3d7c 100644
--- a/certs/Kconfig
+++ b/certs/Kconfig
@@ -6,14 +6,14 @@ config MODULE_SIG_KEY
default "certs/signing_key.pem"
depends on MODULE_SIG
help
- Provide the file name of a private key/certificate in PEM format,
- or a PKCS#11 URI according to RFC7512. The file should contain, or
- the URI should identify, both the certificate and its corresponding
- private key.
+Provide the file name of a private key/certificate in PEM format,
+or a PKCS#11 URI according to RFC7512. The file should contain, or
+the URI should identify, both the certificate and its corresponding
+private key.
 
- If this option is unchanged from its default "certs/signing_key.pem",
- then the kernel will automatically generate the private key and
- certificate as described in 
Documentation/admin-guide/module-signing.rst
+If this option is unchanged from its default "certs/signing_key.pem",
+then the kernel will automatically generate the private key and
+certificate as described in 
Documentation/admin-guide/module-signing.rst
 
 config SYSTEM_TRUSTED_KEYRING
bool "Provide system-wide ring of trusted keys"
diff --git a/init/Kconfig b/init/Kconfig
index b4daad2bac23..e1a6f31da281 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -169,10 +169,10 @@ config BUILD_SALT
string "Build ID Salt"
default ""
help
-  The build ID is used to link binaries and their debug info. Setting
-  this option will use the value in the calculation of the build id.
-  This is mostly useful for distributions which want to ensure the
-  build is unique between builds. It's safe to leave the default.
+ The build ID is used to link binaries and their debug info. Setting
+ this option will use the value in the calculation of the build id.
+ This is mostly useful for distributions which want to ensure the
+ build is unique between builds. It's safe to leave the default.
 
 config HAVE_KERNEL_GZIP
bool
@@ -1327,9 +1327,9 @@ menuconfig EXPERT
select DEBUG_KERNEL
help
  This option allows certain base kernel options and settings
-  to be disabled or tweaked. This is for specialized
-  environments which can tolerate a "non-standard" kernel.
-  Only use this if you really know what you are doing.
+ to be disabled or tweaked. This is for specialized
+ environments which can tolerate a "non-standard" kernel.
+ Only use this if you really know what you are doing.
 
 config UID16
bool "Enable 16-bit UID system calls" if EXPERT
@@ -1439,11 +1439,11 @@ config BUG
bool "BUG() support" if EXPERT
default y
help
-  Disabling this option eliminates support for BUG and WARN, reducing
-  the size of your kernel image and potentially quietly ignoring
-  numerous fatal conditions. You should only consider disabling this
-  option for embedded systems with no facilities for reporting errors.
-  Just say Y.
+ Disabling this option eliminates support for BUG and WARN, reducing
+ the size of your kernel image and potentially quietly ignoring
+ numerous fatal conditions. You should only consider disabling this
+ option for embedded systems with no facilities for reporting errors.
+ Just say Y.
 
 config ELF_CORE
depends on COREDUMP
@@ -1459,8 +1459,8 @@ config PCSPKR_PLATFORM
select I8253_LOCK
default y
help
-  This option allows to disable the internal PC-Speaker
-  support, saving some memory.
+ This option allows to disable the internal PC-Speaker
+ support, saving some memory.
 
 config BASE_FULL
default y
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index e08527f50d2a..0393003f102f 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -76,7 +76,7 

[RESEND TRIVIAL 1/3] treewide: drivers: Fix Kconfig indentation

2019-10-04 Thread Krzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in
coding style with command like:
$ sed -e 's/^/\t/' -i */Kconfig

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/acpi/Kconfig  |  8 +-
 drivers/ata/Kconfig   | 12 +--
 drivers/auxdisplay/Kconfig| 14 +--
 drivers/base/firmware_loader/Kconfig  |  2 +-
 drivers/block/Kconfig | 28 +++---
 drivers/block/mtip32xx/Kconfig|  2 +-
 drivers/char/Kconfig  |  6 +-
 drivers/char/agp/Kconfig  |  2 +-
 drivers/char/hw_random/Kconfig| 10 +-
 drivers/char/ipmi/Kconfig | 20 ++--
 drivers/clk/Kconfig   |  2 +-
 drivers/clk/mediatek/Kconfig  | 10 +-
 drivers/clk/versatile/Kconfig |  2 +-
 drivers/clocksource/Kconfig   | 20 ++--
 drivers/cpufreq/Kconfig.x86   |  6 +-
 drivers/cpuidle/Kconfig   |  8 +-
 drivers/cpuidle/Kconfig.arm   | 16 ++--
 drivers/crypto/Kconfig|  4 +-
 drivers/crypto/caam/Kconfig   | 14 +--
 drivers/crypto/chelsio/Kconfig| 30 +++---
 drivers/crypto/stm32/Kconfig  |  6 +-
 drivers/crypto/ux500/Kconfig  | 16 ++--
 drivers/devfreq/Kconfig   |  6 +-
 drivers/dma/Kconfig   | 46 -
 drivers/edac/Kconfig  |  2 +-
 drivers/firmware/Kconfig  |  4 +-
 drivers/firmware/efi/Kconfig  |  2 +-
 drivers/hid/Kconfig   |  2 +-
 drivers/hwmon/Kconfig | 14 +--
 drivers/i2c/busses/Kconfig| 16 ++--
 drivers/i2c/muxes/Kconfig | 18 ++--
 drivers/iio/gyro/Kconfig  |  8 +-
 drivers/infiniband/hw/bnxt_re/Kconfig | 12 +--
 drivers/input/keyboard/Kconfig|  8 +-
 drivers/input/mouse/Kconfig   |  6 +-
 drivers/input/tablet/Kconfig  | 20 ++--
 drivers/input/touchscreen/Kconfig |  2 +-
 drivers/iommu/Kconfig |  2 +-
 drivers/irqchip/Kconfig   | 10 +-
 drivers/isdn/hardware/mISDN/Kconfig   |  2 +-
 drivers/macintosh/Kconfig |  6 +-
 drivers/md/Kconfig| 54 +--
 drivers/media/Kconfig |  6 +-
 drivers/media/radio/si470x/Kconfig|  4 +-
 drivers/memstick/core/Kconfig | 18 ++--
 drivers/memstick/host/Kconfig |  4 +-
 drivers/misc/Kconfig  | 16 ++--
 drivers/mtd/nand/onenand/Kconfig  | 12 +--
 drivers/nfc/nfcmrvl/Kconfig   |  2 +-
 drivers/pci/Kconfig   | 24 ++---
 drivers/pci/controller/dwc/Kconfig|  6 +-
 drivers/pci/hotplug/Kconfig   |  2 +-
 drivers/perf/Kconfig  | 14 +--
 drivers/phy/hisilicon/Kconfig |  6 +-
 drivers/pinctrl/Kconfig   | 18 ++--
 drivers/pinctrl/freescale/Kconfig | 12 +--
 drivers/pinctrl/qcom/Kconfig  | 34 +++
 drivers/platform/chrome/Kconfig   |  6 +-
 drivers/platform/mellanox/Kconfig |  4 +-
 drivers/platform/x86/Kconfig  | 48 +-
 drivers/power/avs/Kconfig | 12 +--
 drivers/power/supply/Kconfig  | 30 +++---
 drivers/regulator/Kconfig |  8 +-
 drivers/rpmsg/Kconfig |  2 +-
 drivers/rtc/Kconfig   |  6 +-
 drivers/scsi/Kconfig  | 22 ++---
 drivers/scsi/aic7xxx/Kconfig.aic7xxx  | 14 +--
 drivers/scsi/pcmcia/Kconfig   |  2 +-
 drivers/scsi/qedf/Kconfig |  4 +-
 drivers/scsi/smartpqi/Kconfig |  8 +-
 drivers/soc/fsl/Kconfig   |  8 +-
 drivers/soc/qcom/Kconfig  | 22 ++---
 drivers/soc/rockchip/Kconfig  | 18 ++--
 drivers/spi/Kconfig   | 18 ++--
 drivers/staging/fbtft/Kconfig | 12 +--
 drivers/staging/fwserial/Kconfig  |  6 +-
 drivers/staging/most/Kconfig  |  8 +-
 drivers/staging/nvec/Kconfig  | 10 +-
 drivers/staging/pi433/Kconfig | 24 ++---
 drivers/staging/uwb/Kconfig   | 42 
 .../vc04_services/bcm2835-audio/Kconfig   | 12 +--
 drivers/staging/wusbcore/Kconfig  |  2 +-
 drivers/tty/Kconfig   | 26 ++---
 drivers/tty/hvc/Kconfig   |  4 +-
 drivers/tty/serial/8250/Kconfig   |  2 +-
 drivers/tty/serial/Kconfig   

Re: DANGER WILL ROBINSON, DANGER

2019-10-04 Thread Paolo Bonzini
On 04/10/19 11:41, Mircea CIRJALIU - MELIU wrote:
> I get it so far. I have a patch that does mirroring in a separate VMA.
> We create an extra VMA with VM_PFNMAP/VM_MIXEDMAP that mirrors the 
> source VMA in the other QEMU and is refreshed by the device MMU notifier.

So for example on the host you'd have a new ioctl on the kvm file
descriptor.  You pass a size and you get back a file descriptor for that
guest's physical memory, which is mmap-able up to the size you specified
in the ioctl.

In turn, the file descriptor would have ioctls to map/unmap ranges of
the guest memory into its mmap-able range.  Accessing an unmapped range
produces a SIGSEGV.

When asked via the QEMU monitor, QEMU will create the file descriptor
and pass it back via SCM_RIGHTS.  The management application can then
use it to hotplug memory into the destination...

> Create a new memslot based on the mirror VMA, hotplug it into the guest as
> new memory device (is this possible?) and have a guest-side driver allocate 
> pages from that area.

... using the existing ivshmem device, whose BAR can be accessed and
mmap-ed from the guest via sysfs.  In other words, the hotplugging will
use the file descriptor returned by QEMU when creating the ivshmem device.

We then need an additional mechanism to invoke the map/unmap ioctls from
the guest.  Without writing a guest-side driver it is possible to:

- pass a socket into the "create guest physical memory view" ioctl
above.  KVM will then associate that KVMI socket with the newly created
file descriptor.

- use KVMI messages to that socket to map/unmap sections of memory

> Redirect (some) GFN->HVA translations into the new VMA based on a table 
> of addresses required by the introspector process.

That would be tricky because there are multiple paths (gfn_to_page,
gfn_to_pfn, etc.).

There is some complication in this because the new device has to be
plumbed at multiple levels (KVM, QEMU, libvirt).  But it seems like a
very easily separated piece of code (except for the KVMI socket part,
which can be added later), so I suggest that you contribute the KVM
parts first.

Paolo
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: [RFC PATCH 00/13] vsock: add multi-transports support

2019-10-04 Thread Stefano Garzarella
On Fri, Oct 04, 2019 at 12:04:46AM +, Dexuan Cui wrote:
> > From: Stefano Garzarella 
> > Sent: Friday, September 27, 2019 4:27 AM
> >  ...
> > Patch 9 changes the hvs_remote_addr_init(). setting the
> > VMADDR_CID_HOST as remote CID instead of VMADDR_CID_ANY to make
> > the choice of transport to be used work properly.
> > @Dexuan Could this change break anything?
> 
> This patch looks good to me.
> 

Thank you very much for your reviews!

> > @Dexuan please can you test on HyperV that I didn't break anything
> > even without nested VMs?
> 
> I did some quick tests with the 13 patches in a Linux VM (this is not
> a nested VM) on Hyper-V and it looks nothing is broken. :-)
> 

Great :-)

> > I'll try to setup a Windows host where to test the nested VMs
> 
> I suppose you're going to run a Linux VM on a Hyper-V host,
> and the Linux VM itself runs KVM/VmWare so it can create its own child 
> VMs. IMO this is similar to the test "nested KVM ( ..., 
> virtio-transport[L1,L2]"
> you have done.

Yes, I think so. If the Hyper-V transport works well without nested VM,
it should work the same with a nested KVM/VMware.

Thanks,
Stefano
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2019-10-04 Thread David Hildenbrand
On 04.10.19 10:35, Michael S. Tsirkin wrote:
> On Fri, Oct 04, 2019 at 10:06:03AM +0200, David Hildenbrand wrote:
>> On 04.10.19 01:15, Tyler Sanderson wrote:
>>> I was mistaken, the problem with overcommit accounting is not fixed by
>>> the change to shrinker interface.
>>> This means that large allocations are stopped even if they could succeed
>>> by deflating the balloon.
>>
>> Please note that some people use the balloon for actual memory unplug -
>> so initiating to deflate the balloon under any circumstances is
>> undesired. It's different with "VIRTIO_BALLOON_F_DEFLATE_ON_OOM" being
>> set - however that is barely the case (at least in the setups I know :) ).
>>
>> So yes, free page reporting is a different thing, because it really is
>> used to "hint" and not to "agree to unplug" in any scenario.
>>
>> -- 
>>
>> Thanks,
>>
> 
> 
> VIRTIO_BALLOON_F_DEFLATE_ON_OOM isn't really well thought through
> at the spec level either. For example, when will we inflate again?
> Current code does this at the next interrupt, which requires
> host to somehow know it's time to inflate.
> 

The host has access to memory stats of the guest, so it could come up
with some heuristics - but I do agree that is not well thought through -
one reason why it is barely used :)

-- 

Thanks,

David / dhildenb
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2019-10-04 Thread Michael S. Tsirkin
On Fri, Oct 04, 2019 at 10:06:03AM +0200, David Hildenbrand wrote:
> On 04.10.19 01:15, Tyler Sanderson wrote:
> > I was mistaken, the problem with overcommit accounting is not fixed by
> > the change to shrinker interface.
> > This means that large allocations are stopped even if they could succeed
> > by deflating the balloon.
> 
> Please note that some people use the balloon for actual memory unplug -
> so initiating to deflate the balloon under any circumstances is
> undesired. It's different with "VIRTIO_BALLOON_F_DEFLATE_ON_OOM" being
> set - however that is barely the case (at least in the setups I know :) ).
> 
> So yes, free page reporting is a different thing, because it really is
> used to "hint" and not to "agree to unplug" in any scenario.
> 
> -- 
> 
> Thanks,
> 


VIRTIO_BALLOON_F_DEFLATE_ON_OOM isn't really well thought through
at the spec level either. For example, when will we inflate again?
Current code does this at the next interrupt, which requires
host to somehow know it's time to inflate.

-- 
MST
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2019-10-04 Thread David Hildenbrand
On 04.10.19 01:15, Tyler Sanderson wrote:
> I was mistaken, the problem with overcommit accounting is not fixed by
> the change to shrinker interface.
> This means that large allocations are stopped even if they could succeed
> by deflating the balloon.

Please note that some people use the balloon for actual memory unplug -
so initiating to deflate the balloon under any circumstances is
undesired. It's different with "VIRTIO_BALLOON_F_DEFLATE_ON_OOM" being
set - however that is barely the case (at least in the setups I know :) ).

So yes, free page reporting is a different thing, because it really is
used to "hint" and not to "agree to unplug" in any scenario.

-- 

Thanks,

David / dhildenb
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization