Re: [Qemu-devel] [PATCH v2 3/6] linux-user: update sparc/syscall_nr.h to linux header 4.16

2018-05-09 Thread Max Filippov
On Wed, May 9, 2018 at 4:11 PM, Laurent Vivier wrote: > And kill sys_aplib, add sys_sync_file_range: > on sparc, since linux 2.6.17, aplib syscall has been replaced > by sync_file_range syscall. > (289eee6fa78e ["SPARC]: Wire up sys_sync_file_range() into syscall tables.") > The syscall has been

Re: [Qemu-devel] [PATCH v2 6/6] linux-user: fix UNAME_MACHINE for sparc/sparc64

2018-05-09 Thread Max Filippov
On Wed, May 9, 2018 at 4:11 PM, Laurent Vivier wrote: > "sun4" is not recognized by config.guess. > linux defines sparc and sparc64 in arch/sparc/Makefile. > > Signed-off-by: Laurent Vivier > --- > linux-user/sparc/target_syscall.h | 2 +- > linux-user/sparc64/target_syscall.h | 2 +- > 2 file

Re: [Qemu-devel] [PATCH v2 5/6] linux-user: add sparc/sparc64 specific errno

2018-05-09 Thread Max Filippov
On Wed, May 9, 2018 at 4:11 PM, Laurent Vivier wrote: > Copied from linux/arch/sparc/include/uapi/asm/errno.h > > Signed-off-by: Laurent Vivier > --- > > Notes: > v2: > - move sparc errno definitions to linux-user/sparc/target_errno.h > > linux-user/sparc/target_errno.h | 207 > ++

Re: [Qemu-devel] [PATCH v2 4/6] linux-user: fix conversion of flock/flock64 l_type field

2018-05-09 Thread Max Filippov
On Wed, May 9, 2018 at 4:11 PM, Laurent Vivier wrote: > As l_type values (F_RDLCK, F_WRLCK, F_UNLCK, F_EXLCK, F_SHLCK) > are not bitmasks, we can't use target_to_host_bitmask() and > host_to_target_bitmask() to convert them. > > Introduce target_to_host_flock() and host_to_target_flock() > to conv

Re: [Qemu-devel] [PATCH v1 5/7] numa: Extend the command-line to provide memory latency and bandwidth information

2018-05-09 Thread Liu, Jingqi
> -Original Message- > From: Eric Blake [mailto:ebl...@redhat.com] > Sent: Wednesday, May 9, 2018 9:16 PM > To: Liu, Jingqi ; pbonz...@redhat.com; r...@twiddle.net; > ehabk...@redhat.com > Cc: imamm...@redhat.com; qemu-devel@nongnu.org; m...@redhat.com > Subject: Re: [Qemu-devel] [PATCH v

Re: [Qemu-devel] [PATCH v1 1/7] hmat acpi: Build Memory Subsystem Address Range Structre(s) in ACPI HMAT

2018-05-09 Thread Liu, Jingqi
> -Original Message- > From: Eric Blake [mailto:ebl...@redhat.com] > Sent: Wednesday, May 9, 2018 9:13 PM > To: Liu, Jingqi ; pbonz...@redhat.com; r...@twiddle.net; > ehabk...@redhat.com > Cc: imamm...@redhat.com; qemu-devel@nongnu.org; m...@redhat.com > Subject: Re: [Qemu-devel] [PATCH v

Re: [Qemu-devel] [PATCH v1 2/4] hw/riscv/sifive_plic: Use gpios instead of irqs

2018-05-09 Thread Philippe Mathieu-Daudé
Hi Alistair, On 05/04/2018 05:13 PM, Alistair Francis wrote: > Instead of creating the interrupt in lines with qemu_allocate_irq() use > qdev_init_gpio_in() as this gives us the ability to use the qdev*gpio*() > helpers later on. This is a good idea, but your patch is incomplete: The devices prev

Re: [Qemu-devel] [PATCH V5 0/9] nvdimm: guarantee persistence of QEMU writes to persistent memory

2018-05-09 Thread He, Junyan
> > > > > > 2. The migration/ram code is invasive. Is it really necessary to > > >persist data each time pages are loaded from a migration stream? It > > >seems simpler to migrate as normal and call pmem_persist() just once > > >after RAM has been migrated but before the migration co

[Qemu-devel] [PATCH 6/9 V5] migration/ram: ensure write persistence on loading normal pages to PMEM

2018-05-09 Thread junyan . he
From: Junyan He When loading a normal page to persistent memory, load its data by libpmem function pmem_memcpy_nodrain() instead of memcpy(). Combined with a call to pmem_drain() at the end of memory loading, we can guarantee all those normal pages are persistenly loaded to PMEM. Signed-off-by:

[Qemu-devel] [PATCH 4/9 V5] mem/nvdimm: ensure write persistence to PMEM in label emulation

2018-05-09 Thread junyan . he
From: Junyan He Guest writes to vNVDIMM labels are intercepted and performed on the backend by QEMU. When the backend is a real persistent memort, QEMU needs to take proper operations to ensure its write persistence on the persistent memory. Otherwise, a host power failure may result in the loss

[Qemu-devel] [PATCH 3/9 V5] configure: add libpmem support

2018-05-09 Thread junyan . he
From: Junyan He Add a pair of configure options --{enable,disable}-libpmem to control whether QEMU is compiled with PMDK libpmem [1]. QEMU may write to the host persistent memory (e.g. in vNVDIMM label emulation and live migration), so it must take the proper operations to ensure the persistence

[Qemu-devel] [PATCH 9/9 V5] migration/ram: Add check and info message to nvdimm post copy.

2018-05-09 Thread junyan . he
From: Junyan He The nvdimm kind memory does not support post copy now. We disable post copy if we have nvdimm memory and print some log hint to user. Signed-off-by: Junyan He --- migration/ram.c | 9 + 1 file changed, 9 insertions(+) diff --git a/migration/ram.c b/migration/ram.c inde

[Qemu-devel] [PATCH 1/9 V5] memory, exec: switch file ram allocation functions to 'flags' parameters

2018-05-09 Thread junyan . he
From: Junyan He As more flag parameters besides the existing 'share' are going to be added to following functions memory_region_init_ram_from_file qemu_ram_alloc_from_fd qemu_ram_alloc_from_file let's switch them to use the 'flags' parameters so as to ease future flag additions. The existi

[Qemu-devel] [PATCH 7/9 V5] migration/ram: ensure write persistence on loading compressed pages to PMEM

2018-05-09 Thread junyan . he
From: Junyan He When loading a compressed page to persistent memory, flush CPU cache after the data is decompressed. Combined with a call to pmem_drain() at the end of memory loading, we can guarantee those compressed pages are persistently loaded to PMEM. Signed-off-by: Haozhong Zhang --- inc

[Qemu-devel] [PATCH 8/9 V5] migration/ram: ensure write persistence on loading xbzrle pages to PMEM

2018-05-09 Thread junyan . he
From: Junyan He When loading a xbzrle encoded page to persistent memory, load the data via libpmem function pmem_memcpy_nodrain() instead of memcpy(). Combined with a call to pmem_drain() at the end of memory loading, we can guarantee those xbzrle encoded pages are persistently loaded to PMEM. S

[Qemu-devel] [PATCH 5/9 V5] migration/ram: ensure write persistence on loading zero pages to PMEM

2018-05-09 Thread junyan . he
From: Junyan He When loading a zero page, check whether it will be loaded to persistent memory If yes, load it by libpmem function pmem_memset_nodrain(). Combined with a call to pmem_drain() at the end of RAM loading, we can guarantee all those zero pages are persistently loaded. Depending on t

[Qemu-devel] [PATCH 2/9 V5] hostmem-file: add the 'pmem' option

2018-05-09 Thread junyan . he
From: Junyan He When QEMU emulates vNVDIMM labels and migrates vNVDIMM devices, it needs to know whether the backend storage is a real persistent memory, in order to decide whether special operations should be performed to ensure the data persistence. This boolean option 'pmem' allows users to s

[Qemu-devel] [PATCH V5 0/9] nvdimm: guarantee persistence of QEMU writes to persistent memory

2018-05-09 Thread junyan . he
From: Junyan He QEMU writes to vNVDIMM backends in the vNVDIMM label emulation and live migration. If the backend is on the persistent memory, QEMU needs to take proper operations to ensure its writes persistent on the persistent memory. Otherwise, a host power failure may result in the loss the

Re: [Qemu-devel] [PATCH v2 2/3] block/file-posix: File locking during creation

2018-05-09 Thread Fam Zheng
On Wed, 05/09 23:53, Max Reitz wrote: > When creating a file, we should take the WRITE and RESIZE permissions. > We do not need either for the creation itself, but we do need them for > clearing and resizing it. So we can take the proper permissions by > replacing O_TRUNC with an explicit truncati

Re: [Qemu-devel] [PATCH] iscsi: Avoid potential for get_status overflow

2018-05-09 Thread Philippe Mathieu-Daudé
On 05/08/2018 06:27 PM, Eric Blake wrote: > Detected by Coverity: Multiplying two 32-bit int and assigning > the result to a 64-bit number is a risk of overflow. Prior to > the conversion to byte-based interfaces, the block layer took > care of ensuring that a status request never exceeded 2G in >

Re: [Qemu-devel] [PATCH v1] RISC-V: Add misa to DisasContext

2018-05-09 Thread Philippe Mathieu-Daudé
On 05/09/2018 06:39 AM, Michael Clark wrote: > gen methods should access state from DisasContext. Add misa > field to the DisasContext struct and remove CPURISCVState > argument from all gen methods. > > Cc: Palmer Dabbelt > Cc: Sagar Karandikar > Cc: Bastian Koppelmann > Cc: Alistair Francis

Re: [Qemu-devel] [PATCH v2 6/6] linux-user: fix UNAME_MACHINE for sparc/sparc64

2018-05-09 Thread Philippe Mathieu-Daudé
On 05/09/2018 08:11 PM, Laurent Vivier wrote: > "sun4" is not recognized by config.guess. > linux defines sparc and sparc64 in arch/sparc/Makefile. > > Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé > --- > linux-user/sparc/target_syscall.h | 2 +- > linux-user/sparc64/ta

Re: [Qemu-devel] [PATCH v2 1/4] sdcard: Update the SDState documentation

2018-05-09 Thread Philippe Mathieu-Daudé
On 05/09/2018 12:42 PM, Alistair Francis wrote: > On Tue, May 8, 2018 at 11:01 PM, Philippe Mathieu-Daudé > wrote: >> Add more descriptive comments to keep a clear separation >> between static property vs runtime changeable. >> >> Suggested-by: Peter Maydell >> Signed-off-by: Philippe Mathieu-Da

Re: [Qemu-devel] [PATCH v2 04/14] sdcard: Extract sd_frame48/136_calc_checksum()

2018-05-09 Thread Philippe Mathieu-Daudé
On 05/09/2018 08:04 PM, Alistair Francis wrote: > On Wed, May 9, 2018 at 12:15 PM, Philippe Mathieu-Daudé > wrote: >> Hi Alistair, >> >> On 05/09/2018 03:00 PM, Alistair Francis wrote: >>> On Tue, May 8, 2018 at 8:46 PM, Philippe Mathieu-Daudé >>> wrote: It will help when moving this aroun

[Qemu-devel] [PATCH 2/2] vfio-ccw: remove orb.c64 (64 bit data addresses) check

2018-05-09 Thread Halil Pasic
The vfio-ccw module does the check too, and there is actually no technical obstacle for supporting fmt 1 idaws. Let us be ready for the beautiful day when fmt 1 idaws become supported by the vfio-ccw kernel module. QEMU does not have to do a thing for that, except not insisting on this check. Sign

[Qemu-devel] [PATCH 1/2] vfio-ccw: add force unlimited prefetch property

2018-05-09 Thread Halil Pasic
There is at least one control program (guest) that although it does not rely on the guarantees provided by ORB 1 word 9 bit (aka unlimited prefetch, aka P bit) not being set, fails to tell this to the machine. Usually this ain't a big deal, as the story is usually about performance optimizations o

[Qemu-devel] [PATCH 0/2] vfio-ccw: loosen orb flags checks

2018-05-09 Thread Halil Pasic
See the individual patches. The second one makes even more sense with the corresponding kernel patch. Halil Pasic (2): vfio-ccw: add force unlimited prefetch property vfio-ccw: remove orb.c64 (64 bit data addresses) check hw/s390x/css.c | 12 hw/vfio/ccw.c | 13 + 2

Re: [Qemu-devel] [PATCH v2 08/14] sdcard: Extract sd_frame48_verify_checksum() out for qtesting

2018-05-09 Thread Alistair Francis
On Tue, May 8, 2018 at 8:46 PM, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair > --- > include/hw/sd/sd.h | 10 ++ > hw/sd/sd.c | 2 +- > hw/sd/sdmmc-internal.c | 6 ++ > 3 files changed, 17 insertion

[Qemu-devel] [PATCH v2 5/6] linux-user: add sparc/sparc64 specific errno

2018-05-09 Thread Laurent Vivier
Copied from linux/arch/sparc/include/uapi/asm/errno.h Signed-off-by: Laurent Vivier --- Notes: v2: - move sparc errno definitions to linux-user/sparc/target_errno.h linux-user/sparc/target_errno.h | 207 linux-user/sparc/target_syscall.h |

[Qemu-devel] [PATCH v2 6/6] linux-user: fix UNAME_MACHINE for sparc/sparc64

2018-05-09 Thread Laurent Vivier
"sun4" is not recognized by config.guess. linux defines sparc and sparc64 in arch/sparc/Makefile. Signed-off-by: Laurent Vivier --- linux-user/sparc/target_syscall.h | 2 +- linux-user/sparc64/target_syscall.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/sp

[Qemu-devel] [PATCH v2 3/6] linux-user: update sparc/syscall_nr.h to linux header 4.16

2018-05-09 Thread Laurent Vivier
And kill sys_aplib, add sys_sync_file_range: on sparc, since linux 2.6.17, aplib syscall has been replaced by sync_file_range syscall. (289eee6fa78e ["SPARC]: Wire up sys_sync_file_range() into syscall tables.") The syscall has been removed in linux v2.5.71 (6196166fad "[SPARC64]: Kill sys_aplib."

[Qemu-devel] [PATCH v2 2/6] linux-user: fix flock/flock64 padding

2018-05-09 Thread Laurent Vivier
include/uapi/asm-generic/fcntl.h insert a padding macro at the end of the structures flock and flock64. This macro is defined to "short __unused;" on sparc, and "long pad[4]" on mips. Signed-off-by: Laurent Vivier Reviewed-by: Max Filippov --- linux-user/syscall_defs.h | 16 +--- 1

[Qemu-devel] [PATCH v2 4/6] linux-user: fix conversion of flock/flock64 l_type field

2018-05-09 Thread Laurent Vivier
As l_type values (F_RDLCK, F_WRLCK, F_UNLCK, F_EXLCK, F_SHLCK) are not bitmasks, we can't use target_to_host_bitmask() and host_to_target_bitmask() to convert them. Introduce target_to_host_flock() and host_to_target_flock() to convert values between host and target. Signed-off-by: Laurent Vivier

[Qemu-devel] [PATCH v2 0/6] linux-user: fix sparc32plus

2018-05-09 Thread Laurent Vivier
This series fixes several problems with sparc and allows to debootstrap a chroot using qemu-sparc32plus and debian sparc/wheezy. For the moment, networking doesn't work. v2: - Add a patch to fix UNAME_MACHINE - move sparc errno definitions to linux-user/sparc/target_errno.h - add common

[Qemu-devel] [PATCH v2 1/6] linux-user: define correct fcntl() values for sparc

2018-05-09 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Max Filippov --- linux-user/syscall_defs.h | 9 + 1 file changed, 9 insertions(+) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 361bb83a29..ec3f561685 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_de

Re: [Qemu-devel] [RFC PATCH v2 14/14] hw/sd/ssi-sd: Enable CRC validation

2018-05-09 Thread Alistair Francis
On Tue, May 8, 2018 at 8:46 PM, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair > --- > hw/sd/ssi-sd.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c > index 77e446bb94..0

Re: [Qemu-devel] [PATCH v2 04/14] sdcard: Extract sd_frame48/136_calc_checksum()

2018-05-09 Thread Alistair Francis
On Wed, May 9, 2018 at 12:15 PM, Philippe Mathieu-Daudé wrote: > Hi Alistair, > > On 05/09/2018 03:00 PM, Alistair Francis wrote: >> On Tue, May 8, 2018 at 8:46 PM, Philippe Mathieu-Daudé >> wrote: >>> It will help when moving this around for qtesting in the next commit. >>> >>> Signed-off-by: P

Re: [Qemu-devel] [PATCH v2 2/7] block: Add Error parameter to bdrv_amend_options

2018-05-09 Thread John Snow
On 05/09/2018 05:00 PM, Max Reitz wrote: > Looking at the qcow2 code that is riddled with error_report() calls, > this is really how it should have been from the start. > > Along the way, turn the target_version/current_version comparisons at > the beginning of qcow2_downgrade() into assertions

Re: [Qemu-devel] [PATCH 0/3] qemu-io/img: Fix -U/force-share conflict testing

2018-05-09 Thread Max Reitz
On 2018-05-02 22:20, Max Reitz wrote: > qemu-img and qemu-io try to detect when you use both -U and force-share > manually, but a conflict is not rejected with an error message but with > a segmentation fault. I guess that works, but it's probably not the way > it was meant to be. > > > Max Reit

[Qemu-devel] [PATCH v2 2/3] block/file-posix: File locking during creation

2018-05-09 Thread Max Reitz
When creating a file, we should take the WRITE and RESIZE permissions. We do not need either for the creation itself, but we do need them for clearing and resizing it. So we can take the proper permissions by replacing O_TRUNC with an explicit truncation to 0, and by taking the appropriate file lo

[Qemu-devel] [PATCH v2 1/3] block/file-posix: Pass FD to locking helpers

2018-05-09 Thread Max Reitz
raw_apply_lock_bytes() and raw_check_lock_bytes() currently take a BDRVRawState *, but they only use the lock_fd field. During image creation, we do not have a BDRVRawState, but we do have an FD; so if we want to reuse the functions there, we should modify them to receive only the FD. Signed-off-

[Qemu-devel] [PATCH v2 3/3] iotests: Add creation test to 153

2018-05-09 Thread Max Reitz
This patch adds a test case to 153 which tries to overwrite an image (using qemu-img create) while it is in use. Without the original user explicitly sharing the necessary permissions (writing and truncation), this should not be allowed. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng --- test

[Qemu-devel] [PATCH v2 0/3] block/file-posix: File locking during creation

2018-05-09 Thread Max Reitz
[Unchanged text from v1 ahead] Currently we do not take permissions on a file while it is being created. That is a bit sad. The simplest way to test this is the following: $ qemu-img create -f qcow2 foo.qcow2 64M Formatting 'foo.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 lazy_r

Re: [Qemu-devel] [PATCH v2 36/36] target-microblaze: Use tcg_gen_movcond in eval_cond_jmp

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Cleanup eval_cond_jmp to use tcg_gen_movcond_i64(). > No functional change. > > Suggested-by: Richard Henderson > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/translate.c | 9 +++-- > 1 file cha

Re: [Qemu-devel] [PATCH v2 35/36] target-microblaze: Convert env_btarget to i64

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Convert env_btarget to i64. > No functional change. > > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/cpu.h | 2 +- > target/microblaze/op_helper.c | 3 ++- > target/microblaze/translate.c | 3

Re: [Qemu-devel] [PATCH v2 2/7] block: Add Error parameter to bdrv_amend_options

2018-05-09 Thread Eric Blake
On 05/09/2018 04:00 PM, Max Reitz wrote: Looking at the qcow2 code that is riddled with error_report() calls, this is really how it should have been from the start. Along the way, turn the target_version/current_version comparisons at the beginning of qcow2_downgrade() into assertions (the calle

Re: [Qemu-devel] [PATCH v2 33/36] target-microblaze: Remove argument b in eval_cc()

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Remove argument b in eval_cc() as it is always set to zero. > No functional change. > > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/translate.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 delet

Re: [Qemu-devel] [PATCH v2 32/36] target-microblaze: Use table based condition-codes conversion

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Use a table based conversion to map condition-codes between > MicroBlaze ISA encoding and TCG. > No functional change. > > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/translate.c | 41 ++

Re: [Qemu-devel] [PATCH v2 31/36] target-microblaze: mmu: Cleanup debug log messages

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Cleanup debug log messages: > * Avoid long 80+ character lines. > * Remove D() macro and use qemu_log_mask. > * Remove logs that are not very useful > > Suggested-by: Alistair Francis > Signed-off-by: Edgar E. Igle

Re: [Qemu-devel] [PATCH v2 30/36] target-microblaze: Simplify address computation using tcg_gen_addi_i32()

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Simplify address computation using tcg_gen_addi_i32(). > tcg_gen_addi_i32() already optimizes the case when the > immediate is zero. > > No functional change. > > Suggested-by: Richard Henderson > Signed-off-by: E

Re: [Qemu-devel] [PATCH v2 28/36] target-microblaze: Add support for extended access to TLBLO

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > +if (to) { > +gen_helper_mmu_write(cpu_env, tcg_const_i32(extended), > + tcg_const_i32(sr), cpu_R[dc->ra]); > +} else { > +gen_helper_mmu_read(cpu_R[dc->rd], cpu_env, > +

Re: [Qemu-devel] [PATCH v2 27/36] target-microblaze: mmu: Add a configurable output address mask

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add a configurable output address mask, used to mimic the > configurable physical address bit width. > > Reviewed-by: Alistair Francis > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/cpu.c | 1 + > t

Re: [Qemu-devel] [PATCH v2 26/36] target-microblaze: mmu: Prepare for 64-bit addresses

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Prepare for 64-bit addresses. > This makes no functional difference as the upper parts of > the 64-bit addresses are not yet reachable. > > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/mmu.c | 14 +++

Re: [Qemu-devel] [PATCH v2 25/36] target-microblaze: mmu: Remove unused register state

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add explicit handling for MMU_R_TLBX and log accesses to > invalid MMU registers. We can now remove the state for > all regs but PID, ZPR and TLBX (0 - 2). > > Signed-off-by: Edgar E. Iglesias > --- > target/micro

Re: [Qemu-devel] [PATCH v2 24/36] target-microblaze: mmu: Add R_TBLX_MISS macros

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add a R_TBLX_MISS MASK and SHIFT macros. > > Reviewed-by: Alistair Francis > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/mmu.c | 5 +++-- > target/microblaze/mmu.h | 4 > 2 files changed, 7 in

Re: [Qemu-devel] [PATCH v2 22/36] target-microblaze: Add Extended Addressing

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add support for Extended Addressing. Load/stores with EA > enabled concatenate two 32bit registers to form an extended > address. > > We don't allow users to enable address sizes larger than > 32 bits quite yet thou

[Qemu-devel] [PATCH v2 7/7] iotests: Rework 113

2018-05-09 Thread Max Reitz
This test case has been broken since 398e6ad014df261d (roughly half a year). qemu-img amend requires its output image to be R/W, so it opens it as such; the node is then turned into an read-only node automatically which is now accompanied by a warning, however. This warning has not been part of t

Re: [Qemu-devel] [PATCH v2 23/36] target-microblaze: Implement MFSE EAR

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Implement MFSE EAR to enable access to the upper part of EAR. > > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/translate.c | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) Reviewed-by

[Qemu-devel] [PATCH v2 4/7] qemu-img: Add print_amend_option_help()

2018-05-09 Thread Max Reitz
The more generic print_block_option_help() function is not really suitable for qemu-img amend, for a couple of reasons: (1) We do not need to append the protocol-level options, as amendment happens only on one node and does not descend downwards to its children. (2) print_block_option_help(

[Qemu-devel] [PATCH v2 2/7] block: Add Error parameter to bdrv_amend_options

2018-05-09 Thread Max Reitz
Looking at the qcow2 code that is riddled with error_report() calls, this is really how it should have been from the start. Along the way, turn the target_version/current_version comparisons at the beginning of qcow2_downgrade() into assertions (the caller has to make sure these conditions are met

[Qemu-devel] [PATCH v2 5/7] qemu-img: Recognize no creation support in -o help

2018-05-09 Thread Max Reitz
The only users of print_block_option_help() are qemu-img create and qemu-img convert for the output image, so this function is always used for image creation (it used to be used for amendment also, but that is no longer the case). So if image creation is not supported by either the format or the p

[Qemu-devel] [PATCH v2 0/7] qemu-img: Improve option help for amend

2018-05-09 Thread Max Reitz
[Unchanged text from v1 ahead] Currently, "qemu-img amend -f $format -o help" prints many things which it claims to be supported, but most of the time it's wrong. Usually that starts with the format already: No format but qcow2 supports option amendment, so we should never claim that a format sup

[Qemu-devel] [PATCH v2 3/7] qemu-option: Pull out "Supported options" print

2018-05-09 Thread Max Reitz
It really is up to the caller to decide what this list of options means. Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Eric Blake --- qemu-img.c | 1 + util/qemu-option.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 34

[Qemu-devel] [PATCH v2 6/7] iotests: Test help option for unsupporting formats

2018-05-09 Thread Max Reitz
This adds test cases to 082 for qemu-img create/convert/amend "-o help" on formats that do not support creation or amendment, respectively. Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/082 | 9 + tests/qemu-iotests/082.out | 9 +

[Qemu-devel] [PATCH v2 1/7] qemu-img: Amendment support implies create_opts

2018-05-09 Thread Max Reitz
Instead of checking whether a driver has a non-NULL create_opts we should check whether it supports image amendment in the first place. If it does, it must have create_opts. On the other hand, if it does not have create_opts (so it does not support amendment either), the error message "does not s

Re: [Qemu-devel] [PATCH v2 14/36] target-microblaze: Name special registers we support

2018-05-09 Thread Alistair Francis
On Tue, May 8, 2018 at 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Name special registers we support. > > Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Alistair > --- > target/microblaze/translate.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 delet

Re: [Qemu-devel] [PATCH v2 10/36] target-microblaze: Bypass MMU with MMU_NOMMU_IDX

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > +if (cpu->cfg.use_mmu && (env->sregs[SR_MSR] & MSR_VM) > +&& mmu_idx != MMU_NOMMU_IDX) { For future cleanup, the first condition should be moved to cpu_mmu_index (the second condition is already there). At which point here you need ch

Re: [Qemu-devel] [PATCH v2 08/36] target-microblaze: Remove USE_MMU PVR checks

2018-05-09 Thread Richard Henderson
On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > We already have a CPU property to control if a core has > an MMU or not. Remove USE_MMU PVR checks in favor of > looking at the property. > > Reviewed-by: Alistair Francis > Signed-off-by: Edgar E. Iglesias > ---

Re: [Qemu-devel] [PATCH] block: Document BDRV_REQ_WRITE_UNCHANGED support

2018-05-09 Thread Max Reitz
On 2018-05-02 16:03, Max Reitz wrote: > Add BDRV_REQ_WRITE_UNCHANGED to the list of flags honored during pwrite > and pwrite_zeroes, and also add a note on when you absolutely need to > support it. > > Signed-off-by: Max Reitz > --- > I did not include a note on how this might be useful to protoc

Re: [Qemu-devel] [PATCH V2 0/1] virtio-balloon: fix internal stat name array to match Linux kernel

2018-05-09 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 1525895585-79023-1-git-send-email-thomas@oracle.com Subject: [Qemu-devel] [PATCH V2 0/1] virtio-balloon: fix internal stat name array to match Linux kernel === TEST SCRI

[Qemu-devel] [PATCH v2 0/2] qcow2: Repair OFLAG_COPIED when fixing leaks

2018-05-09 Thread Max Reitz
Suppose you have an image with consistent OFLAG_COPIED and refcounts. Now further suppose that image has leaked clusters (single reference, but refcount 2). When checking such an image with qemu-img check, it will notify you of the leakage, and that's it. Now when trying to repair that image, you

[Qemu-devel] [PATCH v2 2/2] iotests: Repairing error during snapshot deletion

2018-05-09 Thread Max Reitz
This adds a test for an I/O error during snapshot deletion, and maybe more importantly, for how to repair the resulting image. If the snapshot has been deleted before the error occurs, the only negative result will be leaked clusters -- and those should be repairable with qemu-img check -r leaks.

[Qemu-devel] [PATCH v2 1/2] qcow2: Repair OFLAG_COPIED when fixing leaks

2018-05-09 Thread Max Reitz
Repairing OFLAG_COPIED is usually safe because it is done after the refcounts have been repaired. Therefore, it we did not find anyone else referencing a data or L2 cluster, it makes no sense to not set OFLAG_COPIED -- and the other direction (clearing OFLAG_COPIED) is always safe, anyway, it may

[Qemu-devel] [PATCH v2 2/5] qemu-io: Let command functions return error code

2018-05-09 Thread Max Reitz
This is basically what everything else in the qemu code base does, so we can do it here, too. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/qemu-io.h | 9 +- qemu-io-cmds.c| 346 -- qemu-io.c | 34 -- 3 files

Re: [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register

2018-05-09 Thread Philippe Mathieu-Daudé
On 02/01/2018 06:09 AM, Michael Walle wrote: > > Hi Peter, > > do you apply this patch? Or do I have to send a pull request? Cc'ing Paolo. > > -michael > > Am 2018-01-09 18:01, schrieb Michael Walle: >> Writing to these registers may raise an interrupt request. Actually, >> this prevents the

Re: [Qemu-devel] [PATCH v12 11/21] migration: Create multifd packet

2018-05-09 Thread Juan Quintela
"Dr. David Alan Gilbert" wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> "Dr. David Alan Gilbert" wrote: >> > * Juan Quintela (quint...@redhat.com) wrote: >> > I think that needs validating to ensure that the source didn't >> > send us junk and cause us to overwrite after the end of bloc

[Qemu-devel] [PATCH v2 5/5] iotests: Let 216 make use of qemu-io's exit code

2018-05-09 Thread Max Reitz
As a showcase of how you can use qemu-io's exit code to determine success or failure (same for qemu-img), this test is changed to use qemu_io_silent() instead of qemu_io(), and to assert the exit code instead of logging the filtered result. One real advantage of this is that in case of an error, y

Re: [Qemu-devel] [PATCH v12 13/21] migration: Calculate transferred ram correctly

2018-05-09 Thread Juan Quintela
"Dr. David Alan Gilbert" wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> On multifd we send data from more places that main channel. >> >> Signed-off-by: Juan Quintela >> --- >> migration/migration.c | 11 +-- >> 1 file changed, 9 insertions(+), 2 deletions(-) >> >> diff --git

Re: [Qemu-devel] lm32: tcg_handle_interrupt: assertion failed: (qemu_mutex_iothread_locked())

2018-05-09 Thread Philippe Mathieu-Daudé
On 05/09/2018 12:06 PM, Michael Walle wrote: > Am 2018-05-09 13:51, schrieb Paolo Bonzini: >> On 08/05/2018 03:49, Philippe Mathieu-Daudé wrote: >>> #2  0x7fe17d5eefa5 in g_assertion_message () at >>> /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 >>> #3  0x7fe17d5ef00a in g_assertion_message_e

[Qemu-devel] KVM call for 2018-05-22

2018-05-09 Thread Juan Quintela
Hi Please, send any topic that you are interested in covering. At the end of Monday I will send an email with the agenda or the cancellation of the call, so hurry up. Call details: By popular demand, a google calendar public entry with it https://www.google.com/calendar/embed?src=dG9iMXR

[Qemu-devel] [PATCH v2 3/5] qemu-io: Exit with error when a command failed

2018-05-09 Thread Max Reitz
Currently, qemu-io basically always returns success when it gets to interactive mode (so once the whole command line has been parsed; even before the commands on the command line are interpreted). That is not very useful. This patch makes qemu-io return failure when any of the executed commands f

[Qemu-devel] KVM call for 2018-05-22

2018-05-09 Thread Juan Quintela
Hi Please, send any topic that you are interested in covering. nAt the end of Monday I will send an email with the agenda or the cancellation of the call, so hurry up. Call details: By popular demand, a google calendar public entry with it https://www.google.com/calendar/embed?src=dG9iMX

[Qemu-devel] [PATCH v2 4/5] iotests.py: Add qemu_io_silent

2018-05-09 Thread Max Reitz
With qemu-io now returning a useful exit code, some tests may find it sufficient to just query that instead of logging (and filtering) the whole output. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 9 + 1 file changed, 9 insertions(+) diff --git

[Qemu-devel] [PATCH v2 1/5] qemu-io: Drop command functions' return values

2018-05-09 Thread Max Reitz
For qemu-io, a function returns an integer with two possible values: 0 for "qemu-io may continue execution", or 1 for "qemu-io should exit". However, there is only a single command that returns 1, and that is "quit". So let's turn this case into a global variable instead so we can make better use

[Qemu-devel] [PATCH v2 0/5] qemu-io: Exit with error when a command failed

2018-05-09 Thread Max Reitz
Right now, qemu-io's exit code is rather useless as it is usually 0. Except sometimes, then it's 1 in case of an error (mostly when you specify a filename as an argument and it cannot open that). At the same time, most command functions' return values are rather useless as they are usually 0 (mean

Re: [Qemu-devel] [PATCH v12 16/21] migration: Synchronize multifd threads with main thread

2018-05-09 Thread Juan Quintela
"Dr. David Alan Gilbert" wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> We synchronize all threads each RAM_SAVE_FLAG_EOS. Bitmap >> synchronizations don't happen inside a ram section, so we are safe >> about two channels trying to overwrite the same memory. > > OK, that's quite neat -

Re: [Qemu-devel] [PATCH v2] qemu-img: Check post-truncation size

2018-05-09 Thread Max Reitz
On 2018-04-21 18:39, Max Reitz wrote: > Some block drivers (iscsi and file-posix when dealing with device files) > do not actually support truncation, even though they provide a > .bdrv_truncate() method and will happily return success when providing a > new size that does not exceed the current si

Re: [Qemu-devel] [PATCH v2 1/2] qemu-img: Resolve relative backing paths in rebase

2018-05-09 Thread Max Reitz
On 2018-05-09 20:51, Eric Blake wrote: > On 05/09/2018 01:20 PM, Max Reitz wrote: >> Currently, rebase interprets a relative path for the new backing image >> as follows: >> (1) Open the new backing image with the given relative path (thus >> relative to >> qemu-img's working directory). >> (2

[Qemu-devel] [PATCH V2 1/1] virtio-balloon: fix internal stat name array to match Linux kernel

2018-05-09 Thread Thomas Tai
The Linux kernel commit b4325044 ("virtio_balloon: add array of stat names") defines an array of stat name strings for consumers of the virtio interface to use via the virtio_balloon.h header file, rather than requiring each consumer to define its own. But at present, the stat names defined in

[Qemu-devel] [PATCH V2 0/1] virtio-balloon: fix internal stat name array to match Linux kernel

2018-05-09 Thread Thomas Tai
Hi Michael, As you have suggested I have imported the kernel header file and use the new macro to create the string array. Would you kindly review the patch for me? Please feel free to comment. Thank you, Thomas

Re: [Qemu-devel] [PATCH v2 04/14] sdcard: Extract sd_frame48/136_calc_checksum()

2018-05-09 Thread Philippe Mathieu-Daudé
Hi Alistair, On 05/09/2018 03:00 PM, Alistair Francis wrote: > On Tue, May 8, 2018 at 8:46 PM, Philippe Mathieu-Daudé > wrote: >> It will help when moving this around for qtesting in the next commit. >> >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> hw/sd/sd.c | 21 ++--- >>

Re: [Qemu-devel] [PATCH 3/5] vmdk: Implement .bdrv_co_create callback

2018-05-09 Thread Markus Armbruster
Fam Zheng writes: > On Wed, 05/09 14:41, Markus Armbruster wrote: >> Beware, I'm only looking at QAPI-related aspects. >> >> Fam Zheng writes: >> >> > This makes VMDK support x-blockdev-create. The implementation reuses the >> > image creation code in vmdk_co_create_opts which now acceptes a c

Re: [Qemu-devel] [PATCH v2 1/2] qemu-img: Resolve relative backing paths in rebase

2018-05-09 Thread Eric Blake
On 05/09/2018 01:20 PM, Max Reitz wrote: Currently, rebase interprets a relative path for the new backing image as follows: (1) Open the new backing image with the given relative path (thus relative to qemu-img's working directory). (2) Write it directly into the overlay's backing path field

Re: [Qemu-devel] [PATCH v2 07/14] sdcard: Invert the sd_req_crc_is_valid() logic

2018-05-09 Thread Alistair Francis
On Tue, May 8, 2018 at 8:46 PM, Philippe Mathieu-Daudé wrote: > Let's return TRUE when the CRC is valid. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair > --- > hw/sd/sd.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/sd/

Re: [Qemu-devel] [PATCH v2 04/14] sdcard: Extract sd_frame48/136_calc_checksum()

2018-05-09 Thread Alistair Francis
On Tue, May 8, 2018 at 8:46 PM, Philippe Mathieu-Daudé wrote: > It will help when moving this around for qtesting in the next commit. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sd/sd.c | 21 ++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/hw/sd

[Qemu-devel] [PULL 27/28] target/riscv: convert to DisasContextBase

2018-05-09 Thread Richard Henderson
From: "Emilio G. Cota" Notes: - Did not convert {num,max}_insns, since the corresponding code will go away in the next patch. - ctx->pc becomes ctx->base.pc_next, and ctx->next_pc becomes ctx->pc_succ_insn. While at it, convert the remaining tb->cflags readers to tb_cflags(). Reviewed-by:

[Qemu-devel] [PATCH v2 2/2] iotests: Add test for rebasing with relative paths

2018-05-09 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/024 | 82 -- tests/qemu-iotests/024.out | 30 + 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024

[Qemu-devel] [PULL 26/28] target/riscv: convert to DisasJumpType

2018-05-09 Thread Richard Henderson
From: "Emilio G. Cota" Reviewed-by: Bastian Koppelmann Reviewed-by: Richard Henderson Cc: Michael Clark Cc: Palmer Dabbelt Cc: Sagar Karandikar Cc: Bastian Koppelmann Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- target/riscv/translate.c | 72

[Qemu-devel] [PATCH v2 1/2] qemu-img: Resolve relative backing paths in rebase

2018-05-09 Thread Max Reitz
Currently, rebase interprets a relative path for the new backing image as follows: (1) Open the new backing image with the given relative path (thus relative to qemu-img's working directory). (2) Write it directly into the overlay's backing path field (thus relative to the overlay). If the

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] iotests: Add test for rebasing with relative paths

2018-05-09 Thread Max Reitz
On 2018-05-09 19:24, Eric Blake wrote: > On 05/09/2018 10:49 AM, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >>   tests/qemu-iotests/024 | 82 >> -- >>   tests/qemu-iotests/024.out | 30 + >>   2 files changed, 109 insertions(+)

  1   2   3   4   >