[PATCH 037/104] virtiofsd: passthrough_ll: add fallback for racy ops

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Miklos Szeredi We have two operations that cannot be done race-free on a symlink in certain cases: utimes and link. Add racy fallback for these if the race-free method doesn't work. We do our best to avoid races even in this case: - get absolute path by reading /proc/self/fd/NN

[PATCH 043/104] virtiofsd: check input buffer size in fuse_lowlevel.c ops

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Each FUSE operation involves parsing the input buffer. Currently the code assumes the input buffer is large enough for the expected arguments. This patch uses fuse_mbuf_iter to check the size. Most operations are simple to convert. Some are more complicated due to

[PATCH 022/104] virtiofsd: Start reading commands from queue

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Pop queue elements off queues, copy the data from them and pass that to fuse. Note: 'out' in a VuVirtqElement is from QEMU 'in' in libfuse is into the daemon So we read from the out iov's to get a fuse_in_header When we get a kick we've got to read

[PATCH 044/104] virtiofsd: prevent ".." escape in lo_do_lookup()

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi --- tools/virtiofsd/passthrough_ll.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 84e9d8916f..cf5b43531a 100644 ---

[PATCH 036/104] virtiofsd: passthrough_ll: add fd_map to hide file descriptors

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Do not expose file descriptor numbers to clients. This prevents the abuse of internal file descriptors (like stdin/stdout). Signed-off-by: Stefan Hajnoczi dgilbert: Added lseek --- tools/virtiofsd/passthrough_ll.c | 114 +-- 1 file changed,

[PATCH 039/104] virtiofsd: Plumb fuse_bufvec through to do_write_buf

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Let fuse_session_process_buf_int take a fuse_bufvec * instead of a fuse_buf; and then through to do_write_buf - where in the best case it can pass that straight through to op.write_buf without copying (other than skipping a header). Signed-off-by: Dr. David Alan

[PATCH 034/104] virtiofsd: passthrough_ll: add ino_map to hide lo_inode pointers

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Do not expose lo_inode pointers to clients. Signed-off-by: Stefan Hajnoczi --- tools/virtiofsd/passthrough_ll.c | 144 --- 1 file changed, 114 insertions(+), 30 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c

[PATCH 033/104] virtiofsd: passthrough_ll: add lo_map for ino/fh indirection

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi A layer of indirection is needed because passthrough_ll cannot expose pointers or file descriptor numbers to untrusted clients. Malicious clients could send invalid pointers or file descriptors in order to crash or exploit the file system daemon. lo_map provides an

[PATCH 021/104] virtiofsd: Poll kick_fd for queue

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" In the queue thread poll the kick_fd we're passed. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 40 ++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/tools/virtiofsd/fuse_virtio.c

[PATCH 032/104] virtiofsd: passthrough_ll: create new files in caller's context

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Vivek Goyal We need to create files in the caller's context. Otherwise after creating a file, the caller might not be able to do file operations on that file. Changed effective uid/gid to caller's uid/gid, create file and then switch back to uid/gid 0. Use syscall(setresuid, ...)

[PATCH 031/104] virtiofs: Add maintainers entry

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5e5e3e52d6..d1b3e262d2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1575,6 +1575,14 @@ T: git

[PATCH 019/104] virtiofsd: get/set features callbacks

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add the get/set features callbacks. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index

[PATCH 018/104] virtiofsd: Add main virtio loop

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Processes incoming requests on the vhost-user fd. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 42 --- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/tools/virtiofsd/fuse_virtio.c

[PATCH 028/104] virtiofsd: make -f (foreground) the default

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi According to vhost-user.rst "Backend program conventions", backend programs should run in the foregound by default. Follow the conventions so libvirt and other management tools can control virtiofsd in a standard way. Signed-off-by: Stefan Hajnoczi ---

[PATCH 030/104] virtiofsd: add --print-capabilities option

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Add the --print-capabilities option as per vhost-user.rst "Backend programs conventions". Currently there are no advertised features. Signed-off-by: Stefan Hajnoczi --- docs/interop/vhost-user.json | 4 +++- tools/virtiofsd/fuse_lowlevel.h | 1 +

[PATCH 012/104] virtiofsd: Trim out compatibility code

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" virtiofsd only supports major=7, minor>=31; trim out a lot of old compatibility code. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_lowlevel.c | 330 1 file changed, 119 insertions(+), 211 deletions(-) diff

[PATCH 027/104] virtiofsd: add --fd=FDNUM fd passing option

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Although --socket-path=PATH is useful for manual invocations, management tools typically create the UNIX domain socket themselves and pass it to the vhost-user device backend. This way QEMU can be launched immediately with a valid socket. No waiting for the vhost-user

[PATCH 024/104] virtiofsd: Keep track of replies

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Keep track of whether we sent a reply to a request; this is a bit paranoid but it means: a) We should always recycle an element even if there was an error in the request b) Never try and send two replies on one queue element Signed-off-by: Dr. David Alan

[PATCH 016/104] virtiofsd: Open vhost connection instead of mounting

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When run with vhost-user options we conect to the QEMU instead via a socket. Start this off by creating the socket. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_i.h| 7 ++- tools/virtiofsd/fuse_lowlevel.c | 55 +++---

[PATCH 014/104] virtiofsd: Add options for virtio

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add options to specify parameters for virtio-fs paths, i.e. ./virtiofsd -o vhost_user_socket=/tmp/vhostqemu Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_i.h| 1 + tools/virtiofsd/fuse_lowlevel.c | 17 -

[PATCH 020/104] virtiofsd: Start queue threads

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Start a thread for each queue when we get notified it's been started. Signed-off-by: Dr. David Alan Gilbert fix by: Signed-off-by: Jun Piao Signed-off-by: Stefan Hajnoczi --- tools/virtiofsd/fuse_virtio.c | 89 +++ 1 file

[PATCH 026/104] virtiofsd: Fast path for virtio read

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Readv the data straight into the guests buffer. Signed-off-by: Dr. David Alan Gilbert With fix by: Signed-off-by: Eryu Guan --- tools/virtiofsd/fuse_lowlevel.c | 5 + tools/virtiofsd/fuse_virtio.c | 159

[PATCH 015/104] virtiofsd: add -o source=PATH to help output

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi The -o source=PATH option will be used by most command-line invocations. Let's document it! Signed-off-by: Stefan Hajnoczi --- tools/virtiofsd/passthrough_ll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virtiofsd/passthrough_ll.c

[PATCH 004/104] virtiofsd: Add fuse_lowlevel.c

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" fuse_lowlevel is one of the largest files from the library and does most of the work. Add it separately to keep the diff sizes small. Again this is from upstream fuse-3.8.0 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_lowlevel.c | 3129

[PATCH 025/104] virtiofsd: Add Makefile wiring for virtiofsd contrib

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Wire up the building of the virtiofsd in contrib. virtiofsd relies on Linux-specific system calls and seccomp. Anyone wishing to port it to other host operating systems should do so carefully and without reducing security. Only allow building on Linux hosts.

[PATCH 013/104] virtiofsd: Make fsync work even if only inode is passed in

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Vivek Goyal If caller has not sent file handle in request, then using inode, retrieve the fd opened using O_PATH and use that to open file again and issue fsync. This will be needed when dax_flush() calls fsync. At that time we only have inode information (and not file). Signed-off-by:

[PATCH 017/104] virtiofsd: Start wiring up vhost-user

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Listen on our unix socket for the connection from QEMU, when we get it initialise vhost-user and dive into our own loop variant (currently dummy). Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_i.h | 4 ++ tools/virtiofsd/fuse_loop_mt.c

[PATCH 009/104] virtiofsd: remove unused notify reply support

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Notify reply support is unused by virtiofsd. The code would need to be updated to validate input buffer sizes. Remove this unused code since changes to it are untestable. Signed-off-by: Stefan Hajnoczi --- tools/virtiofsd/fuse_lowlevel.c | 147

[PATCH 010/104] virtiofsd: Fix fuse_daemonize ignored return values

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" QEMU's compiler enables warnings/errors for ignored values and the (void) trick used in the fuse code isn't enough. Turn all the return values into a return value on the function. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/helper.c | 33

[PATCH 011/104] virtiofsd: Fix common header and define for QEMU builds

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" All of the fuse files include config.h and define GNU_SOURCE where we don't have either under our build - remove them. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/buffer.c | 3 --- tools/virtiofsd/fuse_i.h | 3 +++

[PATCH 006/104] virtiofsd: Trim down imported files

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" There's a lot of the original fuse code we don't need; trim them down. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse.h| 8 - tools/virtiofsd/fuse_common.h | 8 - tools/virtiofsd/fuse_i.h | 22 -

[PATCH 003/104] virtiofsd: Add auxiliary .c's

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add most of the non-main .c files we need from upstream fuse-3.8.0 Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/buffer.c | 321 tools/virtiofsd/fuse_log.c | 40 +++ tools/virtiofsd/fuse_loop_mt.c | 362

[PATCH 005/104] virtiofsd: Add passthrough_ll

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" passthrough_ll is one of the examples in the upstream fuse project and is the main part of our daemon here. It passes through requests from fuse to the underlying filesystem, using syscalls as directly as possible. >From libfuse fuse-3.8.0 Signed-off-by: Dr.

[PATCH 000/104] virtiofs daemon [all]

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is a full set for virtiofsd - a daemon that implements the user space side of virtiofs. Unlike my previous post, this is a full set rather than split up into base/security etc. The set pulls in a big chunk of the upstream libfuse library (unmodified so

[PATCH 002/104] virtiofsd: Pull in kernel's fuse.h

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Update scripts/update-linux-headers.sh to add fuse.h and use it to pull in fuse.h from the kernel; from v5.5-rc1 Signed-off-by: Dr. David Alan Gilbert --- include/standard-headers/linux/fuse.h | 891 ++ scripts/update-linux-headers.sh

[PATCH 008/104] virtiofsd: remove mountpoint dummy argument

2019-12-12 Thread Dr. David Alan Gilbert (git)
From: Stefan Hajnoczi Classic FUSE file system daemons take a mountpoint argument but virtiofsd exposes a vhost-user UNIX domain socket instead. The mountpoint argument is not used by virtiofsd but the user is still required to pass a dummy argument on the command-line. Remove the mountpoint

Re: [PATCH v2] configure: simplify vhost condition with Kconfig

2019-12-12 Thread Philippe Mathieu-Daudé
On 12/12/19 1:30 AM, Paolo Bonzini wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé --- Kconfig.host| 5 + Makefile| 1 + hw/virtio/Kconfig | 3 +++

Re: [PATCH 5/5] kvm: check before accessing PCMachineState fields

2019-12-12 Thread Paolo Bonzini
On 12/12/19 17:11, Sergio Lopez wrote: >> } >> >> -if (kvm_check_extension(s, KVM_CAP_X86_SMM) && >> +if ( >> +#ifdef CONFIG_PC >> +kvm_check_extension(s, KVM_CAP_X86_SMM) && >> object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE) && >> -

Re: [PATCH 5/5] kvm: check before accessing PCMachineState fields

2019-12-12 Thread Sergio Lopez
Paolo Bonzini writes: > Signed-off-by: Paolo Bonzini > --- > roms/SLOF | 2 +- > target/i386/kvm.c | 11 +-- > 2 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/roms/SLOF b/roms/SLOF > index 8ebf2f5..bcc3c4e 16 > --- a/roms/SLOF > +++ b/roms/SLOF > @@ -1

Re: [PATCH 3/5] x86: move more functions to X86MachineState and x86.c

2019-12-12 Thread Paolo Bonzini
On 12/12/19 16:59, Sergio Lopez wrote: > > Paolo Bonzini writes: > >> These are needed by microvm too, so move them outside of PC-specific files. >> >> Signed-off-by: Paolo Bonzini >> --- >> hw/i386/pc.c | 99 >> - >> hw/i386/x86.c

Re: [PATCH 4/5] pci-stub: add more MSI functions

2019-12-12 Thread Sergio Lopez
Paolo Bonzini writes: > On x86, KVM needs some function from the PCI subsystem in order to set > up interrupt routes. Provide some stubs to support x86 machines that > lack PCI. > > Signed-off-by: Paolo Bonzini > --- > hw/pci/pci-stub.c | 27 +++ > 1 file changed, 27

Re: [PATCH 3/5] x86: move more functions to X86MachineState and x86.c

2019-12-12 Thread Sergio Lopez
Paolo Bonzini writes: > These are needed by microvm too, so move them outside of PC-specific files. > > Signed-off-by: Paolo Bonzini > --- > hw/i386/pc.c | 99 - > hw/i386/x86.c | 101 >

Re: [PATCH 2/5] fw_cfg: allow building without other devices

2019-12-12 Thread Sergio Lopez
Paolo Bonzini writes: > The microvm machine type uses fw_cfg but lacks SMBIOS and ACPI. Do not > include > the files if the symbol is not present in QEMU and remove dependencies on > machine-specific files. > > Signed-off-by: Paolo Bonzini > --- > hw/i386/fw_cfg.c | 7 +++ >

Re: [PATCH 1/5] i386: conditionally compile more files

2019-12-12 Thread Sergio Lopez
Paolo Bonzini writes: > Signed-off-by: Paolo Bonzini > --- > hw/i386/Makefile.objs | 6 +++--- > hw/i386/kvm/Makefile.objs | 6 +- > 2 files changed, 8 insertions(+), 4 deletions(-) Reviewed-by: Sergio Lopez signature.asc Description: PGP signature

Re: [PATCH v2 2/2] s390x/cpumodel: Introduce dynamic feature groups

2019-12-12 Thread David Hildenbrand
>> I think, you could if you would expand "best X" to something like >> >> -cpu X,all-features=off,featX=on,featY=on ... >> >> The "all-features" part would need a better name as discussed. Such a >> model would always have a defined feature set (all listed features) == >> static. The list could

Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver

2019-12-12 Thread Geert Uytterhoeven
Hi Linus, On Thu, Dec 12, 2019 at 3:34 PM Linus Walleij wrote: > On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven > wrote: > > GPIO controllers are exported to userspace using /dev/gpiochip* > > character devices. Access control to these devices is provided by > > standard UNIX file system

Re: [PATCH for-5.0 v11 12/20] qapi: Introduce DEFINE_PROP_INTERVAL

2019-12-12 Thread Auger Eric
Hi Markus, On 12/12/19 1:17 PM, Markus Armbruster wrote: > Eric Auger writes: > >> Introduce a new property defining a labelled interval: >> ,,label. >> >> This will be used to encode reserved IOVA regions. The label >> is left undefined to ease reuse accross use cases. > > What does the last

Re: [PATCH for-5.0 v11 00/20] VIRTIO-IOMMU device

2019-12-12 Thread Auger Eric
Hi Michael, On 12/11/19 9:40 PM, Michael S. Tsirkin wrote: > On Wed, Dec 11, 2019 at 05:48:05PM +0100, Auger Eric wrote: >> Hi Michael, >> >> On 12/11/19 5:40 PM, Michael S. Tsirkin wrote: >>> On Fri, Nov 22, 2019 at 07:29:23PM +0100, Eric Auger wrote: This series implements the QEMU

Re: [PATCH] qcow2: Use offset_into_cluster()

2019-12-12 Thread Eric Blake
On 12/12/19 4:01 AM, Alberto Garcia wrote: There's a couple of places left in the qcow2 code that still do the calculation manually, so let's replace them. Signed-off-by: Alberto Garcia --- block/qcow2.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) Reviewed-by: Eric

[PATCH] docs/specs/tpm: reST-ify TPM documentation

2019-12-12 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- docs/specs/index.rst | 1 + docs/specs/tpm.rst | 503 +++ docs/specs/tpm.txt | 445 -- 3 files changed, 504 insertions(+), 445 deletions(-) create mode 100644

Re: [PATCH v3 1/3] virtio: add ability to delete vq through a pointer

2019-12-12 Thread David Hildenbrand
On 09.12.19 03:00, pannengy...@huawei.com wrote: > From: Michael S. Tsirkin > > Devices tend to maintain vq pointers, allow deleting them through a vq > pointer. > > Signed-off-by: Michael S. Tsirkin > Signed-off-by: Pan Nengyuan > [PMM: change function name to virtio_queue_cleanup; set

Re: [PATCH v3 2/3] virtio-balloon: fix memory leak while attach virtio-balloon device

2019-12-12 Thread David Hildenbrand
On 09.12.19 03:00, pannengy...@huawei.com wrote: > From: Pan Nengyuan > > ivq/dvq/svq/free_page_vq forgot to cleanup in > virtio_balloon_device_unrealize, the memory leak stack is as follow: > > Direct leak of 14336 byte(s) in 2 object(s) allocated from: > #0 0x7f99fd9d8560 in calloc

Re: [PATCH v3 6/7] docs: gpio: Add GPIO Aggregator/Repeater documentation

2019-12-12 Thread Geert Uytterhoeven
Hi Linus, On Thu, Dec 12, 2019 at 3:42 PM Linus Walleij wrote: > On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven > wrote: > > +The GPIO Aggregator allows access control for individual GPIOs, by > > aggregating > > +them into a new gpio_chip, which can be assigned to a group or user using >

Re: [PATCH v3 6/7] docs: gpio: Add GPIO Aggregator/Repeater documentation

2019-12-12 Thread Linus Walleij
On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven wrote: > +The GPIO Aggregator allows access control for individual GPIOs, by > aggregating > +them into a new gpio_chip, which can be assigned to a group or user using > +standard UNIX file ownership and permissions. Furthermore, this

Re: [PATCH v3 2/7] gpiolib: Add support for gpiochipN-based table lookup

2019-12-12 Thread Linus Walleij
On Thu, Dec 12, 2019 at 2:33 PM Geert Uytterhoeven wrote: > On Thu, Dec 12, 2019 at 2:20 PM Linus Walleij > wrote: > > On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven > > wrote: > > > Currently GPIO controllers can only be referred to by label in GPIO > > > lookup tables. > > > > > > Add

Re: [PATCH v2] target/arm: ensure we use current exception state after SCR update

2019-12-12 Thread Richard Henderson
On 12/12/19 3:47 AM, Alex Bennée wrote: > A write to the SCR can change the effective EL by droppping the system > from secure to non-secure mode. However if we use a cached current_el > from before the change we'll rebuild the flags incorrectly. To fix > this we introduce the ARM_CP_NEWEL CP flag

Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver

2019-12-12 Thread Linus Walleij
Hi Geert! Thanks for this interesting patch! On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven wrote: > GPIO controllers are exported to userspace using /dev/gpiochip* > character devices. Access control to these devices is provided by > standard UNIX file system permissions, on an

[PATCH 5/5] kvm: check before accessing PCMachineState fields

2019-12-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- roms/SLOF | 2 +- target/i386/kvm.c | 11 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/roms/SLOF b/roms/SLOF index 8ebf2f5..bcc3c4e 16 --- a/roms/SLOF +++ b/roms/SLOF @@ -1 +1 @@ -Subproject commit

[PATCH 3/5] x86: move more functions to X86MachineState and x86.c

2019-12-12 Thread Paolo Bonzini
These are needed by microvm too, so move them outside of PC-specific files. Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 99 - hw/i386/x86.c | 101 ++ include/hw/i386/pc.h | 12

[PATCH 0/5] x86: allow building without PC machine types

2019-12-12 Thread Paolo Bonzini
With this series it is possible to build QEMU with this configuration: CONFIG_MICROVM=y CONFIG_SERIAL_ISA=y CONFIG_VIRTIO=y CONFIG_VIRTIO_BALLOON=y CONFIG_VIRTIO_BLK=y CONFIG_VIRTIO_NET=y CONFIG_VIRTIO_RNG=y CONFIG_VIRTIO_SCSI=y CONFIG_VIRTIO_SERIAL=y

[PATCH 4/5] pci-stub: add more MSI functions

2019-12-12 Thread Paolo Bonzini
On x86, KVM needs some function from the PCI subsystem in order to set up interrupt routes. Provide some stubs to support x86 machines that lack PCI. Signed-off-by: Paolo Bonzini --- hw/pci/pci-stub.c | 27 +++ 1 file changed, 27 insertions(+) diff --git

[PATCH 1/5] i386: conditionally compile more files

2019-12-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/i386/Makefile.objs | 6 +++--- hw/i386/kvm/Makefile.objs | 6 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs index 0d195b5..01ae202 100644 --- a/hw/i386/Makefile.objs +++

[PATCH 2/5] fw_cfg: allow building without other devices

2019-12-12 Thread Paolo Bonzini
The microvm machine type uses fw_cfg but lacks SMBIOS and ACPI. Do not include the files if the symbol is not present in QEMU and remove dependencies on machine-specific files. Signed-off-by: Paolo Bonzini --- hw/i386/fw_cfg.c | 7 +++ hw/i386/pc.c | 2 -- 2 files changed, 7

Re: [PATCH 23/28] target/m68k: Use cpu_*_mmuidx_ra instead of MMU_MODE{0, 1}_SUFFIX

2019-12-12 Thread Richard Henderson
On 12/12/19 1:44 AM, Laurent Vivier wrote: >> +#define cpu_lduw_kernel(e, p)cpu_lduw_mmuidx_ra(e, p, MMU_KERNEL_IDX, 0) >> +#define cpu_ldl_kernel(e, p) cpu_ldl_mmuidx_ra(e, p, MMU_KERNEL_IDX, 0) >> +#define cpu_stw_kernel(e, p, v) cpu_stw_mmuidx_ra(e, p, v, MMU_KERNEL_IDX, >> 0) >>

Re: [PATCH v2 1/2] gdbstub: change GDBState.last_packet to GByteArray

2019-12-12 Thread Luc Michel
On 12/11/19 5:05 PM, Damien Hedde wrote: > Remove the packet size upper limit by using a GByteArray > instead of a statically allocated array for last_packet. > Thus we can now send big packets. > > Also remove the last_packet_len field and use last_packet->len > instead. > > Signed-off-by:

Re: [PATCH v3 3/7] gpiolib: Add support for GPIO line table lookup

2019-12-12 Thread Linus Walleij
On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven wrote: > Currently GPIOs can only be referred to by GPIO controller and offset in > GPIO lookup tables. > > Add support for looking them up by line name. > > Signed-off-by: Geert Uytterhoeven OK I see what you want to do... > +

Re: [PATCH v2 1/2] python/qemu: Add set_qmp_monitor() to QEMUMachine

2019-12-12 Thread Cleber Rosa
On Wed, Dec 11, 2019 at 01:55:35PM -0500, Wainer dos Santos Moschetta wrote: > The QEMUMachine VM has a monitor setup on which an QMP > connection is always attempted on _post_launch() (executed > by launch()). In case the QEMU process immediatly exits > then the qmp.accept() (used to establish

Re: [PACTH v3 3/5] tpm_spapr: Support suspend and resume

2019-12-12 Thread Stefan Berger
On 12/12/19 6:00 AM, Marc-André Lureau wrote: Hi On Wed, Dec 11, 2019 at 8:27 PM Stefan Berger wrote: Extend the tpm_spapr frontend with VM suspend and resume support. Signed-off-by: Stefan Berger --- hw/tpm/tpm_spapr.c | 42 +- 1 file changed, 41

Re: [PATCH v3 2/7] gpiolib: Add support for gpiochipN-based table lookup

2019-12-12 Thread Geert Uytterhoeven
Hi Linus, On Thu, Dec 12, 2019 at 2:20 PM Linus Walleij wrote: > On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven > wrote: > > Currently GPIO controllers can only be referred to by label in GPIO > > lookup tables. > > > > Add support for looking them up by "gpiochipN" name, with "N" either

Re: [PATCH v3 2/7] gpiolib: Add support for gpiochipN-based table lookup

2019-12-12 Thread Linus Walleij
Hi Geert! On Wed, Nov 27, 2019 at 9:43 AM Geert Uytterhoeven wrote: > Currently GPIO controllers can only be referred to by label in GPIO > lookup tables. > > Add support for looking them up by "gpiochipN" name, with "N" either the > corresponding GPIO device's ID number, or the GPIO

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-12 Thread Gerd Hoffmann
On Thu, Dec 12, 2019 at 09:26:32PM +0900, David Stevens wrote: > > > > Second I think it is a bad idea > > > > from the security point of view. When explicitly exporting buffers it > > > > is easy to restrict access to the actual exports. > > > > > > Restricting access to actual exports could

[PATCH v3 2/5] python/qemu: accel: Add list_accel() method

2019-12-12 Thread Wainer dos Santos Moschetta
Since commit cbe6d6365a48 the command `qemu -accel help` returns the list of accelerators enabled in the QEMU binary. This adds the list_accel() method which return that same list. Signed-off-by: Wainer dos Santos Moschetta Reviewed-by: Alex Bennée Reviewed-by: Cleber Rosa Reviewed-by:

[PATCH 092/132] meson: convert hw/hyperv

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs| 1 - hw/hyperv/Makefile.objs | 2 -- hw/hyperv/meson.build | 2 ++ hw/meson.build | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 hw/hyperv/Makefile.objs create mode

Re: [PACTH v3 1/5] tpm_spapr: Support TPM for ppc64 using CRQ based interface

2019-12-12 Thread Stefan Berger
On 12/12/19 6:05 AM, Marc-André Lureau wrote: Hi On Wed, Dec 11, 2019 at 8:25 PM Stefan Berger wrote: Implement support for TPM on ppc64 by implementing the vTPM CRQ interface as a frontend. It can use the tpm_emulator driver backend with the external swtpm. The Linux vTPM driver for ppc64

[PATCH v3 0/5] python/qemu: New accel module and improvements

2019-12-12 Thread Wainer dos Santos Moschetta
On commit abf0bf998dcb John Snow moved some code out of __init__.py to machine.py. kvm_available() remained in though. So on patch 01 I continue his work by creating a home for that method (the new 'accel' module). Honestly I was unsure about whether move the code to any existing module or make a

[PATCH 091/132] meson: convert hw/i2c

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/i2c/Makefile.objs | 13 - hw/i2c/meson.build | 18 ++ hw/meson.build | 1 + 4 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644

[PATCH v3 5/5] python/qemu: Remove unneeded imports in __init__

2019-12-12 Thread Wainer dos Santos Moschetta
__init_.py import some sub-modules unnecessarily. So let's clean it up. Signed-off-by: Wainer dos Santos Moschetta Suggested-by: Cleber Rosa --- python/qemu/__init__.py | 6 -- 1 file changed, 6 deletions(-) diff --git a/python/qemu/__init__.py b/python/qemu/__init__.py index

[PATCH v3 1/5] python/qemu: Move kvm_available() to its own module

2019-12-12 Thread Wainer dos Santos Moschetta
This creates the 'accel' Python module to be the home for utilities that deal with accelerators. Also moved kvm_available() from __init__.py to this new module. Signed-off-by: Wainer dos Santos Moschetta Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- python/qemu/__init__.py

[PATCH 088/132] meson: convert hw/intc

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/intc/Makefile.objs | 51 -- hw/intc/meson.build | 52 +++ hw/meson.build| 1 + 4 files

[PATCH v3 4/5] python/qemu: accel: Add tcg_available() method

2019-12-12 Thread Wainer dos Santos Moschetta
This adds a method to check if the tcg accelerator is enabled in the QEMU binary. Signed-off-by: Wainer dos Santos Moschetta Reviewed-by: Alex Bennée Reviewed-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Tested-by: Cleber Rosa --- python/qemu/accel.py | 8 1 file changed, 8

[PATCH 086/132] meson: convert hw/ipmi

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/ipmi/Makefile.objs | 5 - hw/ipmi/meson.build | 8 hw/meson.build| 1 + 4 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 hw/ipmi/Makefile.objs create mode

[PATCH v3 3/5] python/qemu: accel: Strengthen kvm_available() checks

2019-12-12 Thread Wainer dos Santos Moschetta
Currently kvm_available() checks for the presence of kvm module and, if target and host arches don't mismatch. This patch adds an 3rd checking: if QEMU binary was compiled with kvm support. Signed-off-by: Wainer dos Santos Moschetta Reviewed-by: Alex Bennée Reviewed-by: Cleber Rosa

[PATCH 093/132] meson: convert hw/gpio

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/gpio/Makefile.objs | 11 --- hw/gpio/meson.build | 11 +++ hw/meson.build| 1 + 4 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 hw/gpio/Makefile.objs

[PATCH 085/132] meson: convert hw/isa

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/isa/Makefile.objs | 10 -- hw/isa/meson.build | 9 + hw/meson.build | 1 + 4 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 hw/isa/Makefile.objs create

[PATCH 090/132] meson: convert hw/ide

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/ide/Makefile.objs | 14 -- hw/ide/meson.build | 14 ++ hw/meson.build | 1 + 4 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 hw/ide/Makefile.objs

[PATCH 082/132] meson: convert hw/rdma

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/meson.build| 1 + hw/rdma/Makefile.objs | 3 --- hw/rdma/meson.build | 10 ++ 4 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 hw/rdma/Makefile.objs create

[PATCH 079/132] meson: convert hw/pci-bridge

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs| 1 - hw/meson.build | 1 + hw/pci-bridge/Makefile.objs | 10 -- hw/pci-bridge/meson.build | 14 ++ 4 files changed, 15 insertions(+), 11 deletions(-) delete mode

[PATCH 089/132] meson: convert hw/input

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/input/Makefile.objs | 17 - hw/input/meson.build | 17 + hw/meson.build | 1 + 4 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644

[PATCH 080/132] meson: convert hw/pci

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/meson.build | 1 + hw/pci/Makefile.objs | 14 -- hw/pci/meson.build | 19 +++ 4 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644

[PATCH 087/132] meson: convert hw/ipack

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/ipack/Makefile.objs | 2 -- hw/ipack/meson.build | 1 + hw/meson.build | 1 + 4 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 hw/ipack/Makefile.objs create mode 100644

[PATCH 084/132] meson: convert hw/misc

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs| 1 - hw/meson.build | 1 + hw/misc/Makefile.objs | 82 - hw/misc/macio/Makefile.objs | 5 --- hw/misc/macio/meson.build | 8 +

[PATCH 078/132] meson: convert hw/pci-host

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 2 +- hw/meson.build| 1 + hw/pci-host/Makefile.objs | 21 - hw/pci-host/meson.build | 22 ++ 4 files changed, 24 insertions(+), 22 deletions(-)

[PATCH 076/132] meson: convert hw/scsi

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/meson.build| 1 + hw/scsi/Makefile.objs | 15 --- hw/scsi/meson.build | 26 ++ 4 files changed, 27 insertions(+), 16 deletions(-) delete mode 100644

[PATCH 077/132] meson: convert hw/pcmcia

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs| 1 - hw/meson.build | 1 + hw/pcmcia/Makefile.objs | 2 -- hw/pcmcia/meson.build | 2 ++ 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 hw/pcmcia/Makefile.objs create mode

[PATCH 083/132] meson: convert hw/net

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/meson.build | 1 + hw/net/Makefile.objs | 53 - hw/net/can/Makefile.objs | 4 hw/net/can/meson.build | 4 hw/net/meson.build

[PATCH 081/132] meson: convert hw/nvram

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/meson.build | 1 + hw/nvram/Makefile.objs | 8 hw/nvram/meson.build | 11 +++ 4 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 hw/nvram/Makefile.objs

[PATCH 074/132] meson: convert hw/ssi

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/meson.build | 1 + hw/ssi/Makefile.objs | 10 -- hw/ssi/meson.build | 10 ++ 4 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 hw/ssi/Makefile.objs create

[PATCH 075/132] meson: convert hw/sd

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs| 1 - hw/meson.build | 1 + hw/sd/Makefile.objs | 10 -- hw/sd/meson.build | 10 ++ 4 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 hw/sd/Makefile.objs create mode

[PATCH 073/132] meson: convert hw/timer

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/Makefile.objs | 1 - hw/meson.build | 1 + hw/timer/Makefile.objs | 49 - hw/timer/meson.build | 43 +++ 4 files changed, 44

[PATCH 071/132] meson: convert hw/usb

2019-12-12 Thread Paolo Bonzini
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- Makefile.target | 1 + hw/Makefile.objs | 1 - hw/meson.build | 1 + hw/usb/Makefile.objs | 62 hw/usb/meson.build | 54

<    1   2   3   4   5   >