Re: [Qemu-devel] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > Currently we have a rather half-baked setup for allowing CPUs to > generate exceptions on accesses to invalid memory: the CPU has a > cpu_unassigned_access() hook which the memory system calls in > unassigned_mem_write() and unassigned_mem_read() if th

Re: [Qemu-devel] [PATCH v3 2/3] pci: add QEMU-specific PCI capability structure

2017-08-04 Thread Alexander Bezzubikov
2017-08-01 20:28 GMT+03:00 Alexander Bezzubikov : > 2017-08-01 16:38 GMT+03:00 Marcel Apfelbaum : >> On 31/07/2017 22:01, Alexander Bezzubikov wrote: >>> >>> 2017-07-31 21:57 GMT+03:00 Michael S. Tsirkin : On Mon, Jul 31, 2017 at 09:54:55PM +0300, Alexander Bezzubikov wrote: > > 2

Re: [Qemu-devel] [PATCH] block: drop bdrv_set_key from BlockDriver

2017-08-04 Thread Eric Blake
On 08/04/2017 10:26 AM, Paolo Bonzini wrote: > This is not used anymore since c01c214b69 ("block: remove all encryption > handling APIs", 2017-07-11). > > Signed-off-by: Paolo Bonzini > --- > include/block/block_int.h | 1 - > 1 file changed, 1 deletion(-) Reviewed-by: Eric Blake > > diff --

Re: [Qemu-devel] [PATCH 1/3] block: respect error code from bdrv_getlength in handle_aiocb_write_zeroes

2017-08-04 Thread Eric Blake
On 08/04/2017 10:10 AM, Denis V. Lunev wrote: > Original idea beyond the code in question was the following: we have failed > to write zeroes with fallocate(FALLOC_FL_ZERO_RANGE) as the simplest > approach and via fallocate(FALLOC_FL_PUNCH_HOLE)/fallocate(0). We have the > only chance now: if the r

Re: [Qemu-devel] [PATCH 2/3] parallels: respect error code of bdrv_getlength() in allocate_clusters()

2017-08-04 Thread Eric Blake
On 08/04/2017 10:10 AM, Denis V. Lunev wrote: > If we can not get the file length, the state of BDS is broken completely. > Return error to the caller. > > Signed-off-by: Denis V. Lunev > CC: Markus Armbruster > CC: Kevin Wolf > CC: Max Reitz > CC: Stefan Hajnoczi > --- > block/parallels.c |

Re: [Qemu-devel] [Qemu-arm] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Richard Henderson
On 08/04/2017 11:09 AM, Philippe Mathieu-Daudé wrote: > Since create_unimplemented_device() register overlapped with low priority, why > not register it as default device directly, over the whole address space? That's a good suggestion. It makes more sense to me than adding a flag on the MachineC

Re: [Qemu-devel] [PATCH 3/3] parallels: drop check that bdrv_truncate() is working

2017-08-04 Thread Eric Blake
On 08/04/2017 10:10 AM, Denis V. Lunev wrote: > This would be actually strange and error prone. If truncate() nowadays > will fail, there is something fatally wrong. Let's check for that during > the actual work. > > The only fallback case is when the file is not zero initialized. In this > case w

Re: [Qemu-devel] [PATCH 3/3] parallels: drop check that bdrv_truncate() is working

2017-08-04 Thread Denis V. Lunev
On 08/04/2017 10:32 PM, Eric Blake wrote: > On 08/04/2017 10:10 AM, Denis V. Lunev wrote: >> This would be actually strange and error prone. If truncate() nowadays >> will fail, there is something fatally wrong. Let's check for that during >> the actual work. >> >> The only fallback case is when th

Re: [Qemu-devel] [PATCH v4 03/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-08-04 Thread Eric Blake
On 08/01/2017 09:19 AM, Anton Nefedov wrote: > The flag is supposed to indicate that the region of the disk image has > to be sufficiently allocated so it reads as zeroes. The call with the flag > set has to return -ENOTSUP if allocation cannot be done efficiently > (i.e. without falling back to wr

Re: [Qemu-devel] [PATCH v4 08/15] qcow2: set inactive flag

2017-08-04 Thread Eric Blake
On 08/01/2017 09:19 AM, Anton Nefedov wrote: > Qcow2State and BlockDriverState flags have to be in sync > > Signed-off-by: Anton Nefedov > --- > block/qcow2.c | 1 + > 1 file changed, 1 insertion(+) Is this a bug fix needed for 2.10? > > diff --git a/block/qcow2.c b/block/qcow2.c > index 66aa

Re: [Qemu-devel] [PATCH 6/8] target/arm: Factor out fault delivery code

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > +if (fsc == 0x3f) { > +/* Caller doesn't have a long-format fault status code. This > + * should only happen if this fault will never actually be reported > + * to an EL that uses a syndrome register. Check that here. > +

Re: [Qemu-devel] [PATCH 7/8] target/arm: Allow deliver_fault() caller to specify EA bit

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > For external aborts, we will want to be able to specify the EA > (external abort type) bit in the syndrome field. Allow callers of > deliver_fault() to do that by adding a field to ARMMMUFaultInfo which > we use when constructing the syndrome values.

Re: [Qemu-devel] [PATCH 8/8] target/arm: Implement new do_transaction_failed hook

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > Implement the new do_transaction_failed hook for ARM, which should > cause the CPU to take a prefetch abort or data abort. > > Signed-off-by: Peter Maydell > --- > target/arm/internals.h | 10 ++ > target/arm/cpu.c | 1 + > target/arm

Re: [Qemu-devel] [PATCH v3 2/3] pci: add QEMU-specific PCI capability structure

2017-08-04 Thread Laszlo Ersek
On 08/04/17 20:59, Alexander Bezzubikov wrote: > 2017-08-01 20:28 GMT+03:00 Alexander Bezzubikov : >> 2017-08-01 16:38 GMT+03:00 Marcel Apfelbaum : >>> On 31/07/2017 22:01, Alexander Bezzubikov wrote: 2017-07-31 21:57 GMT+03:00 Michael S. Tsirkin : > > On Mon, Jul 31, 2017 at 09:5

Re: [Qemu-devel] [PATCH v3 2/3] pci: add QEMU-specific PCI capability structure

2017-08-04 Thread Alexander Bezzubikov
2017-08-04 23:28 GMT+03:00 Laszlo Ersek : > On 08/04/17 20:59, Alexander Bezzubikov wrote: >> 2017-08-01 20:28 GMT+03:00 Alexander Bezzubikov : >>> 2017-08-01 16:38 GMT+03:00 Marcel Apfelbaum : On 31/07/2017 22:01, Alexander Bezzubikov wrote: > > 2017-07-31 21:57 GMT+03:00 Michael S. T

[Qemu-devel] [PATCH for-2.11 4/5] qmp-shell: Accept QMP command as argument

2017-08-04 Thread Eduardo Habkost
This is useful for testing QMP commands in scripts. Example usage, combined with 'jq' for filtering the results: $ ./scripts/qmp/qmp-shell /tmp/qmp qom-list path=/ | jq -r .return[].name machine type chardevs backend $ Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 13 +

[Qemu-devel] [PATCH for-2.11 3/5] qmp-shell: execute_cmdargs() method

2017-08-04 Thread Eduardo Habkost
This will allow us to execute a command that was already split in a list. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 5fe6162..6113aaf 100755 --- a/scripts/q

[Qemu-devel] [PATCH for-2.11 5/5] Remove scripts/qmp/qmp

2017-08-04 Thread Eduardo Habkost
The only purpose of scripts/qmp/qmp was the ability to run QMP commands non-interactively. Now it is possible to run qmp-shell non-interactively by providing a QMP command a command-line argument, making scripts/qmp/qmp obsolete. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp | 126

[Qemu-devel] [PATCH for-2.11 0/5] qmp-shell non-interactive mode, delete scripts/qmp/qmp

2017-08-04 Thread Eduardo Habkost
This series adds the ability to run QMP commands non-interactively to qmp-shell, and deletes scripts/qmp/qmp. Eduardo Habkost (5): qmp-shell: Use argparse module qmp-shell: Pass split cmdargs to __build_cmd() qmp-shell: execute_cmdargs() method qmp-shell: Accept QMP command as argument R

[Qemu-devel] [PATCH for-2.11 1/5] qmp-shell: Use argparse module

2017-08-04 Thread Eduardo Habkost
It makes command-line parsing and generation of help text much simpler. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 61 +-- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell

[Qemu-devel] [PATCH for-2.11 2/5] qmp-shell: Pass split cmdargs to __build_cmd()

2017-08-04 Thread Eduardo Habkost
This will allow us to implement a method to run a command that is already split in a list. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index c276b90..5fe6162 10

Re: [Qemu-devel] [Qemu-arm] [PATCH 1/8] memory.h: Move MemTxResult type to memattrs.h

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:42PM +0100, Peter Maydell wrote: > Move the MemTxResult type to memattrs.h. We're going to want to > use it in cpu/qom.h, which doesn't want to include all of > memory.h. In practice MemTxResult and MemTxAttrs are pretty > closely linked since both are used for the new

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:43PM +0100, Peter Maydell wrote: > Currently we have a rather half-baked setup for allowing CPUs to > generate exceptions on accesses to invalid memory: the CPU has a > cpu_unassigned_access() hook which the memory system calls in > unassigned_mem_write() and unassigne

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:43PM +0100, Peter Maydell wrote: > Currently we have a rather half-baked setup for allowing CPUs to > generate exceptions on accesses to invalid memory: the CPU has a > cpu_unassigned_access() hook which the memory system calls in > unassigned_mem_write() and unassigne

Re: [Qemu-devel] [Qemu-arm] [PATCH 3/8] cputlb: Support generating CPU exceptions on memory transaction failures

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:44PM +0100, Peter Maydell wrote: > Call the new cpu_transaction_failed() hook at the places where > CPU generated code interacts with the memory system: > io_readx() > io_writex() > get_page_addr_code() > > Any access from C code (eg via cpu_physical_memory_rw(), >

Re: [Qemu-devel] [Qemu-arm] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:45PM +0100, Peter Maydell wrote: > Define a new MachineClass field ignore_memory_transaction_failures. > If this is flag is true then the CPU will ignore memory transaction > failures which should cause the CPU to take an exception due to an > access to an unassigned p

Re: [Qemu-devel] [Qemu-arm] [PATCH 5/8] hw/arm: Set ignore_memory_transaction_failures for most ARM boards

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:46PM +0100, Peter Maydell wrote: > Set the MachineClass flag ignore_memory_transaction_failures > for almost all ARM boards. This means they retain the legacy > behaviour that accesses to unimplemented addresses will RAZ/WI > rather than aborting, when a subsequent com

Re: [Qemu-devel] [Qemu-arm] [PATCH 6/8] target/arm: Factor out fault delivery code

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:47PM +0100, Peter Maydell wrote: > We currently have some similar code in tlb_fill() and in > arm_cpu_do_unaligned_access() for delivering a data abort or prefetch > abort. We're also going to want to do the same thing to handle > external aborts. Factor out the comm

Re: [Qemu-devel] [Qemu-arm] [PATCH 7/8] target/arm: Allow deliver_fault() caller to specify EA bit

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:48PM +0100, Peter Maydell wrote: > For external aborts, we will want to be able to specify the EA > (external abort type) bit in the syndrome field. Allow callers of > deliver_fault() to do that by adding a field to ARMMMUFaultInfo which > we use when constructing the

Re: [Qemu-devel] [Qemu-arm] [PATCH 8/8] target/arm: Implement new do_transaction_failed hook

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:49PM +0100, Peter Maydell wrote: > Implement the new do_transaction_failed hook for ARM, which should > cause the CPU to take a prefetch abort or data abort. > > Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias > --- > target/arm/internals.h | 10

Re: [Qemu-devel] [Qemu-arm] [PATCH 09/15] target/arm: Don't store M profile PRIMASK and FAULTMASK in daif

2017-08-04 Thread Edgar E. Iglesias
On Thu, Aug 03, 2017 at 03:05:17PM -0700, Richard Henderson wrote: > On 08/03/2017 08:38 AM, Edgar E. Iglesias wrote: > >> +uint32_t primask; > >> +uint32_t faultmask; > > It seems like these could be booleans? > > I was thinking the same thing until I read the v8m description as a

<    1   2   3