Re: [Qemu-devel] [PATCH 01/13] hbitmap: serialization

2015-12-02 Thread Vladimir Sementsov-Ogievskiy
On 03.12.2015 10:35, Fam Zheng wrote: On Wed, 11/11 18:16, Vladimir Sementsov-Ogievskiy wrote: +void hbitmap_deserialize_finish(HBitmap *bitmap) +{ +int64_t i, size, prev_size; +int lev; + +/* restore levels starting from penultimate to zero level, assuming + * that the last leve

Re: [Qemu-devel] [PATCH 01/13] hbitmap: serialization

2015-12-02 Thread Fam Zheng
On Wed, 11/11 18:16, Vladimir Sementsov-Ogievskiy wrote: > +void hbitmap_deserialize_finish(HBitmap *bitmap) > +{ > +int64_t i, size, prev_size; > +int lev; > + > +/* restore levels starting from penultimate to zero level, assuming > + * that the last level is ok */ > +size = MA

[Qemu-devel] [TCG only][Migration Bug? ] Occasionally, the content of VM's memory is inconsistent between Source and Destination of migration

2015-12-02 Thread Li Zhijian
Hi all, Does anyboday remember the similar issue post by hailiang months ago http://patchwork.ozlabs.org/patch/454322/ At least tow bugs about migration had been fixed since that. And now we found the same issue at the tcg vm(kvm is fine), after migration, the content VM's memory is inconsiste

Re: [Qemu-devel] [RFC PATCH 0/9] Add colo-proxy based on netfilter

2015-12-02 Thread Zhang Chen
Hi,Dave On 12/02/2015 12:44 AM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: Hi,all This patch add an colo-proxy object, COLO-Proxy is a part of COLO, based on qemu netfilter and it's a plugin for qemu netfilter. the function keep Secondary VM connect norm

Re: [Qemu-devel] [PATCH COLO-Frame v11 14/39] ram: Split host_from_stream_offset() into two helper functions

2015-12-02 Thread Hailiang Zhang
On 2015/12/3 15:19, Hailiang Zhang wrote: On 2015/12/2 2:19, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: Split host_from_stream_offset() into two parts: One is to get ram block, which the block idstr may be get from migration stream, the other is to get

Re: [Qemu-devel] [PATCH] net/vmxnet3.c: fix a build error when enabling debug output

2015-12-02 Thread Dmitry Fleytman
Acked-by: Dmitry Fleytman mailto:dmi...@daynix.com>> > On 3 Dec 2015, at 07:08 AM, Miao Yan wrote: > > Macro MAC_FMT and MAC_ARG are not defined, but used in vmxnet3_net_init(). > This will cause build error when debug level is raised in > vmxnet3_debug.h (enable all VMXNET3_DEBUG_xxx). > > Use

Re: [Qemu-devel] [PATCH COLO-Frame v11 34/39] net/filter-buffer: Add default filter-buffer for each netdev

2015-12-02 Thread Yang Hongyang
On 2015年12月03日 14:48, Hailiang Zhang wrote: On 2015/12/3 14:25, Wen Congyang wrote: On 12/03/2015 11:53 AM, Hailiang Zhang wrote: On 2015/12/3 9:17, Wen Congyang wrote: On 11/24/2015 05:25 PM, zhanghailiang wrote: We add each netdev a default filter-buffer, which will be used for COLO or Mi

Re: [Qemu-devel] [PATCH COLO-Frame v11 14/39] ram: Split host_from_stream_offset() into two helper functions

2015-12-02 Thread Hailiang Zhang
On 2015/12/2 2:19, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: Split host_from_stream_offset() into two parts: One is to get ram block, which the block idstr may be get from migration stream, the other is to get hva (host) address from block and the offs

Re: [Qemu-devel] net: vmxnet3: memory leakage issue

2015-12-02 Thread Dmitry Fleytman
Hello Prasad, The patch is good. Jason, would you apply is from attachment or should it be resent by "git send-email”? Acked-by: Dmitry Fleytman mailto:dmi...@daynix.com>> ~Dmitry > On 2 Dec 2015, at 14:17 PM, P J P wrote: > > Hello Dmitry, all > > A memory leakage issue was reported by Mr

Re: [Qemu-devel] [RFC PATCH 9/9] net/colo-proxy: add packet compare and notify checkpoint

2015-12-02 Thread Zhang Chen
Hi,Dave On 12/02/2015 12:37 AM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: From: zhangchen Lookup same connection's primary and secondary packet to compare,if same we will send primary packet and drop secondary packet,else send all of primary packets be

Re: [Qemu-devel] [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel

2015-12-02 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Friday, November 20, 2015 4:36 PM > > > > > > > So, for non-opengl rendering qemu needs the guest framebuffer data so it > > > > can feed it into the vnc server. The vfio framebuffer region is meant > > > > to support this use case. > > > > > > what's the format requir

Re: [Qemu-devel] [PATCH 0/3] block: Fix assertion failure with before write notifier again

2015-12-02 Thread Stefan Hajnoczi
On Tue, Dec 01, 2015 at 05:36:27PM +0800, Fam Zheng wrote: > This is basically a supplementary fix of 06c3916b. > > On 512 disks, the crash only happens when copy-on-read is enabled, which is > covered by the previou fix. But on 4k disks the write request that triggers > the notifier itself may b

Re: [Qemu-devel] [PATCH COLO-Frame v11 34/39] net/filter-buffer: Add default filter-buffer for each netdev

2015-12-02 Thread Hailiang Zhang
On 2015/12/3 14:25, Wen Congyang wrote: On 12/03/2015 11:53 AM, Hailiang Zhang wrote: On 2015/12/3 9:17, Wen Congyang wrote: On 11/24/2015 05:25 PM, zhanghailiang wrote: We add each netdev a default filter-buffer, which will be used for COLO or Micro-checkpoint to buffer VM's packets. The name

[Qemu-devel] [PATCH for 2.6 v2 1/1] qemu-char: append opt to stop truncation of serial file

2015-12-02 Thread Denis V. Lunev
From: Olga Krishtal Our QA team wants to preserve serial output of the guest in between QEMU runs to perform post-analysis. By default this behavior is off (file is truncated each time QEMU is started or device is plugged). Signed-off-by: Olga Krishtal Signed-off-by: Denis V. Lunev CC: Eric B

Re: [Qemu-devel] [RFC PATCH 7/9] net/colo-proxy: add packet enqueue and handle function

2015-12-02 Thread Zhang Chen
Hi,Dave On 12/02/2015 12:12 AM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: From: zhangchen Add common packet handle function and enqueue packet distinguished connection,then we can lookup one connection packet to compare Signed-off-by: zhangchen ---

Re: [Qemu-devel] [PATCH for 2.6 1/1] qemu-char: append opt to stop truncation of serial file

2015-12-02 Thread Denis V. Lunev
On 12/03/2015 09:24 AM, Denis V. Lunev wrote: From: Olga Krishtal Our QA teams wants to preserve serial output of the guest in between QEMU runs to perform post-analysis. By default this behavior is off (file is truncated each time QEMU is started or device is plugged). Signed-off-by: Olga Kr

Re: [Qemu-devel] [PATCH COLO-Frame v11 34/39] net/filter-buffer: Add default filter-buffer for each netdev

2015-12-02 Thread Wen Congyang
On 12/03/2015 11:53 AM, Hailiang Zhang wrote: > On 2015/12/3 9:17, Wen Congyang wrote: >> On 11/24/2015 05:25 PM, zhanghailiang wrote: >>> We add each netdev a default filter-buffer, which will be used for COLO >>> or Micro-checkpoint to buffer VM's packets. The name of default >>> filter-buffer >

[Qemu-devel] [PATCH for 2.6 1/1] qemu-char: append opt to stop truncation of serial file

2015-12-02 Thread Denis V. Lunev
From: Olga Krishtal Our QA teams wants to preserve serial output of the guest in between QEMU runs to perform post-analysis. By default this behavior is off (file is truncated each time QEMU is started or device is plugged). Signed-off-by: Olga Krishtal Signed-off-by: Denis V. Lunev CC: Eric

Re: [Qemu-devel] [RFC PATCH 6/9] net/colo-proxy: add packet forward function

2015-12-02 Thread Zhang Chen
Hi,Dave On 12/01/2015 11:50 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: From: zhangchen The packet recv by primary forward to secondary The packet send by secondary forward to primary Signed-off-by: zhangchen --- net/colo-proxy.c | 118 ++

Re: [Qemu-devel] [RFC 01/12] vfio: Start improving VFIO/EEH interface

2015-12-02 Thread David Gibson
On Wed, Dec 02, 2015 at 01:09:34PM -0700, Alex Williamson wrote: > On Tue, 2015-12-01 at 13:23 +1100, David Gibson wrote: > > On Mon, Nov 23, 2015 at 02:58:11PM -0700, Alex Williamson wrote: > > > On Thu, 2015-11-19 at 15:29 +1100, David Gibson wrote: > > > > At present the code handling IBM's Enha

[Qemu-devel] [PULL for-2.5 4/4] iotests: Add regresion test case for write notifier assertion failure

2015-12-02 Thread Stefan Hajnoczi
From: Fam Zheng The idea is to let the top level bs have a big request alignment with blkdebug, so that the aio_write request issued from monitor will be serialised. This tests that QEMU doesn't crash upon the read request from the backup job's write notifier, which is a very special case of "ree

[Qemu-devel] [PULL for-2.5 1/4] iothread: include id in thread name

2015-12-02 Thread Stefan Hajnoczi
From: Paolo Bonzini This makes it easier to find the desired thread. Use "IO" plus the id; even with the 14 character limit on the thread name, enough of the id should be readable (e.g. "IO iothreadNNN" with three characters for the number). Signed-off-by: Paolo Bonzini Reviewed-by: Dr. David

[Qemu-devel] [PULL for-2.5 2/4] block: Don't wait serialising for non-COR read requests

2015-12-02 Thread Stefan Hajnoczi
From: Fam Zheng The assertion problem was noticed in 06c3916b35a, but it wasn't completely fixed, because even though the req is not marked as serialising, it still gets serialised by wait_serialising_requests against other serialising requests, which could lead to the same assertion failure. Fi

[Qemu-devel] [PULL for-2.5 3/4] iotests: Add "add_drive_raw" method

2015-12-02 Thread Stefan Hajnoczi
From: Fam Zheng This offers full manual control over the "-drive" options. Signed-off-by: Fam Zheng Message-id: 1448962590-2842-3-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qemu

[Qemu-devel] [PULL for-2.5 0/4] Block patches

2015-12-02 Thread Stefan Hajnoczi
The following changes since commit cf22132367a188426ac07cf1805b214dd2d0cc80: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-12-02 17:05:34 +) are available in the git repository at: git://github.com/stefanha/qemu.git tags/block-pull-request for you to

Re: [Qemu-devel] [PATCH COLO-Frame v11 34/39] net/filter-buffer: Add default filter-buffer for each netdev

2015-12-02 Thread Hailiang Zhang
On 2015/12/3 9:17, Wen Congyang wrote: On 11/24/2015 05:25 PM, zhanghailiang wrote: We add each netdev a default filter-buffer, which will be used for COLO or Micro-checkpoint to buffer VM's packets. The name of default filter-buffer is 'nop'. For the default filter-buffer, it will not buffer an

Re: [Qemu-devel] [RFC PATCH 4/9] colo-proxy: add colo-proxy setup work

2015-12-02 Thread Zhang Chen
Hi,Dave On 12/01/2015 11:35 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: From: zhangchen Secondary setup socket server for colo-forward primary setup connect to secondary for colo-forward add data structure will be uesed I wodner if it's possible to

Re: [Qemu-devel] [RFC PATCH 2/9] jhash: add linux kernel jhashtable in qemu

2015-12-02 Thread Zhang Chen
Hi,Dave On 12/01/2015 07:23 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: From: zhangchen This used by colo-proxy to save and lookup connection info Signed-off-by: zhangchen --- include/qemu/jhash.h | 52

Re: [Qemu-devel] [Qemu-ppc] [PATCH 41/77] ppc/pnv: Add LPC controller and hook it up with a UART and RTC

2015-12-02 Thread David Gibson
On Thu, Dec 03, 2015 at 12:04:58PM +1100, Alexey Kardashevskiy wrote: > On 12/02/2015 04:29 PM, Benjamin Herrenschmidt wrote: > >On Wed, 2015-12-02 at 13:24 +1100, Alexey Kardashevskiy wrote: > >>>But on the whole I agree with you, since the LPC is part of the P8 > >>>chip, I think it makes sense t

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 2/2] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-12-02 Thread Sukadev Bhattiprolu
David Gibson [da...@gibson.dropbear.id.au] wrote: | > Should we walk the /proc/device-tree/cpus/ tree and count only dirs with | > device-type "cpu" (rather than relying on the pattern PowerPC,POWER*)? | | Yes, I think you'll have to. | Ok. Are we ok with the xscom check I have (copied below): +

Re: [Qemu-devel] [PATCH v4 08/11] dump-guest-memory: add qmp event DUMP_COMPLETED

2015-12-02 Thread Peter Xu
On Wed, Dec 02, 2015 at 09:01:16AM -0700, Eric Blake wrote: > On 12/02/2015 08:21 AM, Peter Xu wrote: > > Will the raw memory total size useful in any way? I am totally ok to > > add this, just failed to find a way for user to use it besides > > calculating finished work during dump... :( > > Good

Re: [Qemu-devel] [PATCH COLO-Frame v11 34/39] net/filter-buffer: Add default filter-buffer for each netdev

2015-12-02 Thread Wen Congyang
On 11/24/2015 05:25 PM, zhanghailiang wrote: > We add each netdev a default filter-buffer, which will be used for COLO > or Micro-checkpoint to buffer VM's packets. The name of default filter-buffer > is 'nop'. > For the default filter-buffer, it will not buffer any packets in default. > So it has

Re: [Qemu-devel] [Qemu-ppc] [PATCH 41/77] ppc/pnv: Add LPC controller and hook it up with a UART and RTC

2015-12-02 Thread Alexey Kardashevskiy
On 12/02/2015 04:29 PM, Benjamin Herrenschmidt wrote: On Wed, 2015-12-02 at 13:24 +1100, Alexey Kardashevskiy wrote: But on the whole I agree with you, since the LPC is part of the P8 chip, I think it makes sense to include it even with -nodefaults. POWER8 chips all have 8 threads per core but

[Qemu-devel] [PATCH v2 24/26] armv7m: split armv7m_init in two parts

2015-12-02 Thread Michael Davidsaver
Separate init and realize phases to allow board code the opportunity to set properties on the cpu and nvic. Assign names for cpu, nvic, and bitband regions. update stellaris and stm32 board code accordingly. --- hw/arm/armv7m.c| 42 +++--- hw/arm/stell

[Qemu-devel] [PATCH v2 26/26] armv7m: decide whether faults are MemManage or BusFault

2015-12-02 Thread Michael Davidsaver
General logic is that operations stopped by the MPU are MemManage, and those which go through the MPU and are caught by the unassigned handle are BusFault. --- target-arm/helper.c | 35 +-- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/target-arm/he

[Qemu-devel] [PATCH v2 16/26] armv7m: add some mpu debugging prints

2015-12-02 Thread Michael Davidsaver
Provide some more "-d mmu" related to the MPU translation process as an aid in debugging guest MPU configurations. Helpful since our MPU resolution is limited to the ARM7-AR page size. --- target-arm/helper.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/

[Qemu-devel] [PATCH v2 15/26] armv7m: add MPU to cortex-m3 and cortex-m4

2015-12-02 Thread Michael Davidsaver
The M series MPU is almost the same as the already implemented R series MPU. So use the M series and translate. Primary difference is that a real v7-M MPU is has much relaxed alignment and size requirements for MPU regions (32 bytes) compared with the 1K page size of the QEMU TLB which is shared

[Qemu-devel] [PATCH v2 17/26] armv7m: mpu background miss is perm fault

2015-12-02 Thread Michael Davidsaver
Set an appropriate FSR code when an access does not match any MPU region, including the background/default. --- target-arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index da99825..e73f7a6 100644 --- a/target-arm/helper.c

[Qemu-devel] [PATCH v2 25/26] armv7m: remove extra cpu_reset()

2015-12-02 Thread Michael Davidsaver
cpu_reset() is called as a side-effect of realizing the CPU. arm_cpu_reset() calls rom_ptr(0), which expects to find the image mapped. This was happening way before load_*() and was worked around with a second call to cpu_reset(). Now wait to realize until after the image is mapped. --- hw/arm/arm

[Qemu-devel] [PATCH v2 22/26] armv7m: priority field mask

2015-12-02 Thread Michael Davidsaver
Many v7m CPUs don't implement all of the 8 bits of the priority fields. Typically, only the top N bits are available. Existing practice implies that writes to unimplemented bits will be ignore, and read as zero. This allows a guest to discover the implemented bits by writing 0xff to (eg. basepri

[Qemu-devel] [PATCH v2 13/26] armv7m: implement CCR

2015-12-02 Thread Michael Davidsaver
Implement Configuration and Control register. Handle STACKALIGN and USERSETMPEND bits. --- hw/intc/armv7m_nvic.c | 15 +++ target-arm/cpu.h | 1 + target-arm/helper.c | 8 +++- target-arm/machine.c | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH v2 21/26] armv7m: CONTROL<1> handling

2015-12-02 Thread Michael Davidsaver
The ARM states that this bit indicates the stack being used, which in handler mode is always MSP. Further CONTROL<1>==1 in handler mode is reserved. With the TM4C always CONTROL<1>==0 in handler mode which inconveniently prevents the handler from knowing which stack thread mode was using... This

[Qemu-devel] [PATCH v2 23/26] qom: add cpu_generic_init_unrealized()

2015-12-02 Thread Michael Davidsaver
cpu_generic_init() without realized=true. Gives board code an opportunity to change CPU properties. --- include/qom/cpu.h | 12 qom/cpu.c | 23 +-- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 5

[Qemu-devel] [PATCH v2 19/26] armv7m: mpu not allowed to map exception return codes

2015-12-02 Thread Michael Davidsaver
Always pass these through to be caught be by the unassigned handler. --- target-arm/helper.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index e42f6d0..a5adf2d 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -7106,6 +7106,15

[Qemu-devel] [PATCH v2 08/26] armv7m: rewrite NVIC

2015-12-02 Thread Michael Davidsaver
Expand the NVIC to fully support -M priorities and masking. Doesn't use GIC code. Use PRIGROUP to configure group/sub-group split. Track group and sub-group in separate fields for quick comparison. Mix in vector # with sub-group as per tie breaking rules. NVIC now derives directly from SysBusDevi

[Qemu-devel] [PATCH v2 14/26] armv7m: prevent unprivileged write to STIR

2015-12-02 Thread Michael Davidsaver
Prevent unprivileged from writing to the Software Triggered Interrupt register --- hw/intc/armv7m_nvic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 0f9ca6a..5731146 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv

[Qemu-devel] [PATCH v2 20/26] armv7m: observable initial register state

2015-12-02 Thread Michael Davidsaver
At least for TI TM4C1294. LR==-1 XPSR==0 PRIMASK, FAULTMASK, and BASEPRI all cleared so exception handlers are unmasked. STKALIGN set. --- target-arm/cpu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 1fa1f96..8b85888 100644 ---

[Qemu-devel] [PATCH v2 18/26] armv7m: update base region policy

2015-12-02 Thread Michael Davidsaver
Update MPU background policy as per ARM. Main changes are preventing writes to ROM and no-exec for device regions. --- target-arm/helper.c | 35 +++ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index e73f7a

[Qemu-devel] [PATCH v2 12/26] armv7m: check exception return consistency

2015-12-02 Thread Michael Davidsaver
Detect use of reserved exception return codes and return to thread mode from nested exception handler. Also check consistency between NVIC and CPU wrt. the active exception. --- hw/intc/armv7m_nvic.c | 7 +++- target-arm/cpu.h | 2 +- target-arm/helper.c | 95

[Qemu-devel] [PATCH v2 11/26] arm: gic: Remove references to NVIC

2015-12-02 Thread Michael Davidsaver
armv7m_nvic.c no longer relies on the GIC. Remove REV_NVIC and conditionals which use it. --- hw/intc/arm_gic.c| 14 +++--- hw/intc/arm_gic_common.c | 23 --- hw/intc/gic_internal.h | 7 ++- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a

[Qemu-devel] [PATCH v2 10/26] armv7m: auto-clear FAULTMASK

2015-12-02 Thread Michael Davidsaver
on return from all exceptions other than NMI --- target-arm/helper.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index d1ca011..b6ec761 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -5379,8 +5379,13 @@ static v

[Qemu-devel] [PATCH v2 05/26] armv7m: add armv7m_excp_running_prio()

2015-12-02 Thread Michael Davidsaver
Implements v7m exception priority algorithm using FAULTMASK, PRIMASK, BASEPRI, and the highest priority active exception. The number returned is the current execution priority which may be in the range [-2,0x7f] when an exception is active or 0x100 when no exception is active. --- hw/intc/armv7m_

[Qemu-devel] [PATCH v2 06/26] armv7m: fix I and F flag handling

2015-12-02 Thread Michael Davidsaver
Despite having the same notation, these bits have completely different meaning than -AR. Use armv7m_excp_running_prio() and the highest pending exception priority to determine if the pending exception can interrupt preempt. --- target-arm/cpu.c | 16 ++-- 1 file changed, 6 insertions(

[Qemu-devel] [PATCH v2 00/26] armv7m: exception handling, MPU, and more

2015-12-02 Thread Michael Davidsaver
All, Second revision of ARMv7-M exception handling patchset, which now adds MPU support (as well as can be done). Parts of this series are informed by the previous work of Alex Zuepke. This time I have access to a EK-TM4C1294XL eval board (cortex-m4f), and have done some cross-checks using tes

[Qemu-devel] [PATCH v2 09/26] armv7m: implement CFSR, HFSR, BFAR, and MMFAR

2015-12-02 Thread Michael Davidsaver
Add the Configurable, HardFault, BusFault and MemManage Status registers. Note undefined instructions, violations, and escalations. No BusFaults are raised at this point. --- hw/intc/armv7m_nvic.c | 28 ++-- target-arm/cpu.h | 4 target-arm/helper.c | 3 +++

[Qemu-devel] [PATCH v2 03/26] armv7m: Explicit error for bad vector table

2015-12-02 Thread Michael Davidsaver
Give an explicit error and abort when a load from VECBASE fails. Otherwise would likely jump to 0, which for v7-m holds the reset stack pointer address. --- target-arm/helper.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-a

[Qemu-devel] [PATCH v2 07/26] armv7m: simpler/faster exception start

2015-12-02 Thread Michael Davidsaver
No need to bounce through EXCP_IRQ handling for non-IRQ exceptions. just update CPU state directly. --- target-arm/helper.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 7b76f32..4490b74 100644 --- a/target-arm/he

[Qemu-devel] [PATCH v2 01/26] armv7m: MRS/MSR handle unprivileged access

2015-12-02 Thread Michael Davidsaver
The MRS and MSR instruction handling isn't checking the current permission level. Prevent privlaged from changing writing EPSR fields. Access to unknown/undefined special registers not fatal (read 0, write ignored) w/ guest error message. --- target-arm/helper.c | 79 +

[Qemu-devel] [PATCH v2 04/26] armv7m: additional cpu state for exception handling

2015-12-02 Thread Michael Davidsaver
Track priorities and highest active and pending exception. Also the highest pending exception for faster exception handler entry. The pending exception information will be re-calculated on load, so no additional vmstate tracking is needed. --- target-arm/cpu.c | 2 ++ target-arm/cpu.h | 3 +++ 2

[Qemu-devel] [PATCH v2 02/26] armv7m: Undo armv7m.hack

2015-12-02 Thread Michael Davidsaver
Add CPU unassigned access handler in place of special MemoryRegion to catch exception returns. The unassigned handler will signal other faults as either prefetch or data exceptions, with the FSR code 0x8 to distinguish them from memory translation faults (0xd). Future code will make use of this di

Re: [Qemu-devel] [PATCH 06/18] armv7m: new NVIC utility functions

2015-12-02 Thread Peter Maydell
On 2 December 2015 at 23:18, Michael Davidsaver wrote: > On 11/20/2015 08:25 AM, Peter Maydell wrote: >> Hi; I have a lot of review comments on this patch set, but that's >> really because v7M exception logic is pretty complicated and >> our current code is a long way away from correct. You might

[Qemu-devel] [PULL 1/2] migration: Clean up use of g_poll() in socket_writev_buffer()

2015-12-02 Thread Juan Quintela
From: Markus Armbruster socket_writev_buffer() writes in a loop, using g_poll() to block. If g_poll() fails, it tries to write more before the file descriptor is ready. In theory, this could go into a tight loop. In practice, errors other than EINTR are really unlikely, and when they happen, w

[Qemu-devel] [PULL 2/2] migration: do floating-point division

2015-12-02 Thread Juan Quintela
From: Paolo Bonzini Dividing integer expressions transferred_bytes and time_spent, and then converting the integer quotient to type double. Any remainder, or fractional part of the quotient, is ignored. Fix this. Signed-off-by: Paolo Bonzini Reviewed-by: Juan Quintela Signed-off-by: Juan Qui

[Qemu-devel] [PULL 0/2] Migration PULL request

2015-12-02 Thread Juan Quintela
Hi Two small fixes - Coverity error discovered by Paole that got lost on the track (it is a needed cast). We got this one in RHEL in the past, so it is not only theoretical.v - Armbru fix for g_poll() returning one error Please, apply. The following changes since commit cf22132367a188426ac

Re: [Qemu-devel] [PATCH 11/18] armv7m: fix I and F flag handling

2015-12-02 Thread Michael Davidsaver
On 11/20/2015 08:47 AM, Peter Maydell wrote: > On 9 November 2015 at 01:11, Michael Davidsaver wrote: >> Despite having the same notation, these bits >> have completely different meaning than -AR. >> >> Add armv7m_excp_unmasked() >> to calculate the currently runable exception priority >> taking i

Re: [Qemu-devel] [PATCH 09/18] armv7m: NVIC update vmstate

2015-12-02 Thread Michael Davidsaver
On 11/17/2015 12:58 PM, Peter Maydell wrote: > On 9 November 2015 at 01:11, Michael Davidsaver wrote: >> Signed-off-by: Michael Davidsaver >> --- >> hw/intc/armv7m_nvic.c | 64 >> +-- >> 1 file changed, 62 insertions(+), 2 deletions(-) >> >> dif

Re: [Qemu-devel] [PATCH 06/18] armv7m: new NVIC utility functions

2015-12-02 Thread Michael Davidsaver
On 11/20/2015 08:25 AM, Peter Maydell wrote: > On 9 November 2015 at 01:11, Michael Davidsaver wrote: >> Internal functions for operations previously done >> by GIC internals. >> >> nvic_irq_update() recalculates highest pending/active >> exceptions. >> >> armv7m_nvic_set_pending() include excepti

Re: [Qemu-devel] [PATCH v6 05/23] qmp: Fix reference-counting of qnull on empty output visit

2015-12-02 Thread Eric Blake
On 11/27/2015 06:06 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Commit 6c2f9a15 ensured that we would not return NULL when the >> caller used an output visitor but had nothing to visit. But >> in doing so, it added a FIXME about a reference count leak >> that could abort qemu in the (u

Re: [Qemu-devel] [PATCH 04/18] armv7m: Explicit error for bad vector table

2015-12-02 Thread Peter Maydell
On 2 December 2015 at 22:55, Michael Davidsaver wrote: > On 11/17/2015 12:33 PM, Peter Maydell wrote: >> The behaviour on a failed vector table read is actually architecturally >> specified: we should take a nested exception (escalated to HardFault). >> If it happens while we're trying to take a H

Re: [Qemu-devel] [PATCH 01/18] armv7m: MRS/MSR handle unprivileged access

2015-12-02 Thread Peter Maydell
On 2 December 2015 at 22:51, Michael Davidsaver wrote: > > > On 11/17/2015 12:09 PM, Peter Maydell wrote: >> On 9 November 2015 at 01:11, Michael Davidsaver >> wrote: >>> The MRS and MSR instruction handling isn't checking >>> the current permission level. >>> >>> Signed-off-by: Michael Davidsav

Re: [Qemu-devel] [PATCH 05/18] armv7m: expand NVIC state

2015-12-02 Thread Michael Davidsaver
On 11/17/2015 01:10 PM, Peter Maydell wrote: > On 9 November 2015 at 01:11, Michael Davidsaver wrote: >> Expand the NVIC to fully support -M priorities and masking. >> Doesn't use GIC code. >> >> Move some state to ARMCPU to allow calculation of exception masking. >> >> Add storage for PRIGROUP

Re: [Qemu-devel] [PATCH 04/18] armv7m: Explicit error for bad vector table

2015-12-02 Thread Michael Davidsaver
On 11/17/2015 12:33 PM, Peter Maydell wrote: > On 9 November 2015 at 01:11, Michael Davidsaver wrote: >> Give an explicit error and abort when a load >> from VECBASE fails. Otherwise would likely >> jump to 0, which for v7-m holds the reset stack >> pointer address. >> >> Signed-off-by: Michael

Re: [Qemu-devel] [PATCH 03/18] armv7m: Complain about incorrect exception table entries.

2015-12-02 Thread Michael Davidsaver
On 11/17/2015 12:20 PM, Peter Maydell wrote: > This one's not really correct, I'm afraid (though the spec-mandated > behaviour is a bit subtle). I've dropped this patch.

Re: [Qemu-devel] [PATCH 01/18] armv7m: MRS/MSR handle unprivileged access

2015-12-02 Thread Michael Davidsaver
On 11/17/2015 12:09 PM, Peter Maydell wrote: > On 9 November 2015 at 01:11, Michael Davidsaver wrote: >> The MRS and MSR instruction handling isn't checking >> the current permission level. >> >> Signed-off-by: Michael Davidsaver >> --- >> target-arm/helper.c | 79 >> +

Re: [Qemu-devel] [PATCH 00/18] Fix exception handling and msr/mrs access

2015-12-02 Thread Michael Davidsaver
On 11/20/2015 08:59 AM, Peter Maydell wrote: > I think I've now done that at least for the earlier patches. > There are probably some other finer details that I'll get to > in a later round of patch review but hopefully you have enough > to do some of the fixes and restructuring of this patchset fo

Re: [Qemu-devel] [RFC PATCH V2 06/10] Qemu/PCI: Add macros for faked PCI migration capability

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > This patch is to extend PCI CAP id for migration cap and > add reg macros. The CAP ID is trial and we may find better one if the > solution is feasible. > > *PCI_VF_MIGRATION_CAP > For VF driver to control that triggers mailbox irq or not dur

Re: [Qemu-devel] [RFC PATCH V2 09/10] Qemu/VFIO: Add SRIOV VF migration support

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > This patch is to add SRIOV VF migration support. > Create new device type "vfio-sriov" and add faked PCI migration capability > to the type device. > > The purpose of the new capability > 1) sync migration status with VF driver in the VM > 2)

Re: [Qemu-devel] [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > Signed-off-by: Lan Tianyu > --- > linux-headers/linux/vfio.h | 16 > 1 file changed, 16 insertions(+) > > diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h > index 0508d0b..732b0bd 100644 > --- a/linux-hea

Re: [Qemu-devel] [PATCH] exec: Stop using memory after free

2015-12-02 Thread Don Slutz
On 12/01/15 04:52, Paolo Bonzini wrote: > > > On 30/11/2015 23:11, Don Slutz wrote: >> memory_region_unref(mr) can free memory. >> >> For example I got: >> >> Program received signal SIGSEGV, Segmentation fault. >> [Switching to Thread 0x7f43280d4700 (LWP 4462)] >> 0x7f43323283c0 in phys_se

Re: [Qemu-devel] [PATCH] exec: Stop using memory after free

2015-12-02 Thread Don Slutz
On 12/02/15 04:47, Paolo Bonzini wrote: > > > On 02/12/2015 08:59, Gonglei (Arei) wrote: > static void phys_section_destroy(MemoryRegion *mr) { > +bool have_sub_page = mr->subpage; > + > memory_region_unref(mr); > > -if (mr->subpage) { > +if (have_su

Re: [Qemu-devel] [PATCH v6 02/23] qapi: Require int64/uint64 implementation

2015-12-02 Thread Eric Blake
On 11/27/2015 05:05 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Now that all visitors supply both type_int64() and type_uint64() >> callbacks, we can drop the redundant type_int() callback (the >> public interface visit_type_int() remains, but calls into >> type_int64() under the hood)

Re: [Qemu-devel] [PATCH for-2.5 2/2] qom-test: fix qmp() leaks

2015-12-02 Thread Eric Blake
On 12/02/2015 01:20 PM, Markus Armbruster wrote: > From: Marc-André Lureau > > Before this patch ASAN reported: > SUMMARY: AddressSanitizer: 677165875 byte(s) leaked in 1272437 allocation(s) > > After this patch: > SUMMARY: AddressSanitizer: 465 byte(s) leaked in 32 allocation(s) > > Signed-off

Re: [Qemu-devel] [PATCH for-2.5 1/2] tests: Use proper functions types instead of void (*fn)

2015-12-02 Thread Eric Blake
On 12/02/2015 01:20 PM, Markus Armbruster wrote: > We have several function parameters declared as void (*fn). This is > just a stupid way to write void *, and the only purpose writing it > like that could serve is obscuring the sin of bypassing the type > system without need. Presumably, someone

[Qemu-devel] [PULL 8/9] virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass realize method

2015-12-02 Thread Michael S. Tsirkin
From: Shmulik Ladkani In 1811e64 'hw/virtio: Add PCIe capability to virtio devices', the QEMU_PCI_CAP_EXPRESS capability was added to virtio's pci_dev, within 'virtio_pci_realize' - the pci device object realization method. This occurs to late, as 'pci_qdev_realize' (DeviceClass.realize of TYPE_

Re: [Qemu-devel] [PULL 0/9] virtio,vhost,mmap fixes for 2.5

2015-12-02 Thread Michael S. Tsirkin
On Wed, Dec 02, 2015 at 10:35:18PM +0200, Michael S. Tsirkin wrote: > The following changes since commit 9d7b969ea6d9663a94760c6c131481b366f4d38a: > > Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20151201' into > staging (2015-12-02 10:16:53 +) > > are available in the git repos

[Qemu-devel] [PULL 7/9] virtio: handle non-virtio-1-capable backend for ccw

2015-12-02 Thread Michael S. Tsirkin
From: Cornelia Huck If you run a qemu advertising VERSION_1 with an old kernel where vhost did not yet support VERSION_1, you'll end up with a device that is {modern pci|ccw revision 1} but does not advertise VERSION_1. This is not a sensible configuration and is rejected by the Linux guest drive

[Qemu-devel] [PULL 9/9] util/mmap-alloc: fix hugetlb support on ppc64

2015-12-02 Thread Michael S. Tsirkin
Since commit 8561c9244ddf1122d "exec: allocate PROT_NONE pages on top of RAM", it is no longer possible to back guest RAM with hugepages on ppc64 hosts: mmap(NULL, 285212672, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff5700 mmap(0x3fff5700, 268435456, PROT_READ|PROT_WRITE, MAP_PRI

Re: [Qemu-devel] [PATCH v2] util/mmap-alloc: fix hugetlb support on ppc64

2015-12-02 Thread Rik van Riel
On 12/02/2015 03:04 PM, Michael S. Tsirkin wrote: > Since commit 8561c9244ddf1122d "exec: allocate PROT_NONE pages on top of > RAM", it is no longer possible to back guest RAM with hugepages on ppc64 > hosts: > > mmap(NULL, 285212672, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0x3fff5700

[Qemu-devel] [PULL 5/9] vhost: drop dead code

2015-12-02 Thread Michael S. Tsirkin
commit 1e7398a1 ("vhost: enable vhost without without MSI-X"_ dropped the implementation of vhost_dev_query, drop it from the header file as well. Signed-off-by: Michael S. Tsirkin Reviewed-by: Yuanhan Liu --- include/hw/virtio/vhost.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/

[Qemu-devel] [PULL 3/9] vhost-user-test: fix crash with glib < 2.36

2015-12-02 Thread Michael S. Tsirkin
From: Marc-André Lureau The prepare callback needs to be implemented with glib < 2.36, quoting glib documentation: "Since 2.36 this may be NULL, in which case the effect is as if the function always returns FALSE with a timeout of -1." Signed-off-by: Marc-André Lureau Reviewed-by: Michael S. Ts

[Qemu-devel] [PULL 6/9] tests/vhost-user-bridge.c: fix fd leakage

2015-12-02 Thread Michael S. Tsirkin
From: Victor Kaplansky This fixes file descriptor leakage in vhost-user-bridge application. Whenever a new callfd or kickfd is set, the previous one should be explicitly closed. File descriptors used to map guest's memory are closed immediately after mmap call. Signed-off-by: Victor Kaplansky R

[Qemu-devel] [PULL 4/9] vhost-user: verify that number of queues is non-zero

2015-12-02 Thread Michael S. Tsirkin
From: Victor Kaplansky Fix QEMU crash when -netdev type=vhost-user,queues=n is passed with zero number of queues. Signed-off-by: Victor Kaplansky Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- net/vhost-user.c | 5 + 1 file changed, 5 insertio

[Qemu-devel] [PULL 1/9] vhost-user-test: fix chardriver race

2015-12-02 Thread Michael S. Tsirkin
From: Marc-André Lureau vhost-user-tests uses a helper thread to dispatch the vhost-user servers sources. However the CharDriverState is not thread-safe. Therefore, when it's given to the thread, it shouldn't be manipulated concurrently. We dispatch cleaning the server in an idle source. By the

[Qemu-devel] [PULL 2/9] vhost-user-test: use unix port for migration

2015-12-02 Thread Michael S. Tsirkin
From: Marc-André Lureau TCP port 1234 may be used by another process concurrently. Instead use a temporary unix socket. Signed-off-by: Marc-André Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/vhost-user-test.c | 8 +++- 1 file changed, 7 insertions(+)

[Qemu-devel] [PULL 0/9] virtio,vhost,mmap fixes for 2.5

2015-12-02 Thread Michael S. Tsirkin
The following changes since commit 9d7b969ea6d9663a94760c6c131481b366f4d38a: Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20151201' into staging (2015-12-02 10:16:53 +) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstrea

Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members

2015-12-02 Thread Markus Armbruster
Eric Blake writes: > On 12/02/2015 10:19 AM, Markus Armbruster wrote: > >>> With your patch, the positive tests no longer work in isolation. You >>> were getting lucky that things sorted such that 'Foo' was checked for >>> correctness prior to 'UuidInfo'; but if you comment out the 'Foo' >>> dec

Re: [Qemu-devel] [PATCH v2] util/mmap-alloc: fix hugetlb support on ppc64

2015-12-02 Thread Greg Kurz
On Wed, 2 Dec 2015 22:04:53 +0200 "Michael S. Tsirkin" wrote: > Since commit 8561c9244ddf1122d "exec: allocate PROT_NONE pages on top of > RAM", it is no longer possible to back guest RAM with hugepages on ppc64 > hosts: > > mmap(NULL, 285212672, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = >

[Qemu-devel] [PATCH for-2.5 1/2] tests: Use proper functions types instead of void (*fn)

2015-12-02 Thread Markus Armbruster
We have several function parameters declared as void (*fn). This is just a stupid way to write void *, and the only purpose writing it like that could serve is obscuring the sin of bypassing the type system without need. The original sin is commit 49ee359: its qtest_add_func() is a wrapper for g_

[Qemu-devel] [PATCH for-2.5 2/2] qom-test: fix qmp() leaks

2015-12-02 Thread Markus Armbruster
From: Marc-André Lureau Before this patch ASAN reported: SUMMARY: AddressSanitizer: 677165875 byte(s) leaked in 1272437 allocation(s) After this patch: SUMMARY: AddressSanitizer: 465 byte(s) leaked in 32 allocation(s) Signed-off-by: Marc-André Lureau Message-Id: <1448551895-871-1-git-send-emai

[Qemu-devel] [PATCH for-2.5 0/2] tests: A cleanup and a fix

2015-12-02 Thread Markus Armbruster
PATCH 1 cleans up unnecessary type punning. PATCH 2 plugs a massive memory leak in qom-test. I think it would be nice to have in 2.5, but at this late stage, it's really up to the maintainer. Marc-André Lureau (1): qom-test: fix qmp() leaks Markus Armbruster (1): tests: Use proper functions

  1   2   3   >