Re: [Qemu-devel] [[RFC]PATCH:hw/sd:sd_init()] hw/sd : modified the sd_init() function

2017-04-18 Thread Tejaswini Poluri
Hii, A gentle reminder on the same! Regards, Tejaswini On Sun, Apr 9, 2017 at 5:44 AM, Tejaswini Poluri wrote: > Hii Paolo, > Waiting for your comments on this patch > > Regards, > Tejaswini > On 28 Mar 2017 11:01 a.m., "Tejaswini Poluri" > wrote: > >> >> >> On Mon, Mar 27, 2017 at 4:43 PM, S

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-18 Thread Peter Xu
On Tue, Apr 18, 2017 at 06:02:44AM +, Liu, Yi L wrote: > > > Hi Peter, > > > > > > Skip address space switching is a good idea to support Passthru mode. > > > However, without the address space, the vfio notifier would not be > > > registered, thus vIOMMU emulator has no way to connect to host.

Re: [Qemu-devel] [PATCH v4 0/4] X86/HMP: Expose x86 model specific registers via human monitor

2017-04-18 Thread Julian Kirsch
Hi Eduardo, don't worry, it's not urgent anyway. I'll resend the patches right away. (No idea why they don't show up in the archives, though.) Best, Julian On 18.04.2017 01:26, Eduardo Habkost wrote: > > Hi Julian, > > Sorry for taking so long to reply. > > I can't find the original series on

Re: [Qemu-devel] [PATCH 1/7] target/openrisc: Fixes for memory debugging

2017-04-18 Thread Richard Henderson
On 04/16/2017 04:23 PM, Stafford Horne wrote: When debugging in gdb you might want to inspect instructions in mapped pages or in exception vectors like 0x800 etc. This was previously not possible in qemu since the *get_phys_page_debug() routine only looked into the data tlb. Change to fall back

Re: [Qemu-devel] [PATCH 2/7] target/openrisc: add shutdown logic

2017-04-18 Thread Richard Henderson
On 04/16/2017 04:23 PM, Stafford Horne wrote: In openrisc simulators we use hooks like 'l.nop 1' to cause the simulator to exit. Implement that for qemu too. Reported-by: Waldemar Brodkorb Signed-off-by: Stafford Horne As I said the first time this was posted: This is horrible. If you want

[Qemu-devel] [PATCH for-2.10] iotests: 109: Filter out "len" of failed jobs

2017-04-18 Thread Fam Zheng
Mirror calculates job len from current I/O progress: s->common.len = s->common.offset + (cnt + s->sectors_in_flight) * BDRV_SECTOR_SIZE; The final "len" of a failed mirror job in iotests 109 depends on the subtle timing of the completion of read and write issued in the fir

Re: [Qemu-devel] [PATCH 3/7] target/openrisc: add numcores and coreid support

2017-04-18 Thread Richard Henderson
On 04/16/2017 04:23 PM, Stafford Horne wrote: These are used to identify the processor in SMP system. Their definition has been defined in verilog cores but it not yet part of the spec but it will be soon. The proposal for this is available: https://openrisc.io/proposals/core-identifier-and-n

Re: [Qemu-devel] [PATCH 4/7] target/openrisc: implement shadow registers

2017-04-18 Thread Richard Henderson
On 04/16/2017 04:23 PM, Stafford Horne wrote: Shadow registers are part of the openrisc spec along with sr[cid], as part of the fast context switching feature. When exceptions occur, instead of having to save registers to the stack if enabled the CID will increment and a new set of registers wil

Re: [Qemu-devel] [PATCH v2] char: Fix removing wrong GSource that be found by fd_in_tag

2017-04-18 Thread Marc-André Lureau
Hi - Original Message - > We use fd_in_tag to find a GSource, fd_in_tag is return value of > g_source_attach(GSource *source, GMainContext *context), the return > value is unique only in the same context, so we may get the same > values with different 'context' parameters. > > It is no pr

Re: [Qemu-devel] [PATCH 7/7] target/openrisc: Implement full vmstate serialization

2017-04-18 Thread Richard Henderson
On 04/16/2017 04:23 PM, Stafford Horne wrote: Previously serialization did not persist the tlb, timer, pic and other key state items. This meant snapshotting and restoring a running os would crash. After adding these I am able to take snapshots of a running linux os and restore at a later time.

Re: [Qemu-devel] [PATCH for-2.9-rc5 v2] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Paolo Bonzini
On 17/04/2017 05:33, Fam Zheng wrote: > BDRV_POLL_WHILE in both IOThread and main loop has aio_context_acquire(ctx) > around it; in the branch where main loop calls aio_poll(ctx, false), > there is also no aio_context_release(ctx). So I thinki it is protected by the > AioContext lock, and is safe

Re: [Qemu-devel] [PATCH for-2.9-rc5 v2] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Paolo Bonzini
On 17/04/2017 10:27, Fam Zheng wrote: > At this point it's even unclear to me what should be the plan for 2.9. v1 IMO > was the least intrusive, but didn't cover bdrv_drain_all_begin. v2 has this > controversial "aio_poll(ctx_, false)", v1 has it too: -bdrv_drain_recurse(bs); +while (t

Re: [Qemu-devel] [PATCH for-2.9-rc5 v2] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Fam Zheng
On Tue, 04/18 10:18, Paolo Bonzini wrote: > > > On 17/04/2017 10:27, Fam Zheng wrote: > > At this point it's even unclear to me what should be the plan for 2.9. v1 > > IMO > > was the least intrusive, but didn't cover bdrv_drain_all_begin. v2 has this > > controversial "aio_poll(ctx_, false)",

[Qemu-devel] [PATCH 1/2] net/socket: convert non-blocking connect to use QIOChannel

2017-04-18 Thread Mao Zhongyi
The non-blocking connect mechanism doesn't work well in net connection, it still blocks on DNS lookups. So it is obsolete. Supersede it with QIOchannel. Signed-off-by: Mao Zhongyi --- The test steps like this: $ qemu-system-x86_64 -net nic -net socket,listen=:1234 ~/img/test.img $ qe

[Qemu-devel] [PATCH 2/2] net/socket: Improve -net socket error reporting

2017-04-18 Thread Mao Zhongyi
When -net socket fails, it first reports a specific error, then a generic one, like this: $ qemu-system-x86_64 -net socket, qemu-system-x86_64: -net socket: exactly one of fd=, listen=, connect=, mcast= or udp= is required qemu-system-x86_64: -net socket: Device 'socket' could not be

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-18 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, April 18, 2017 3:27 PM > To: Liu, Yi L > Cc: qemu-devel@nongnu.org; Lan, Tianyu ; Michael S . > Tsirkin ; Jason Wang ; Marcel > Apfelbaum ; David Gibson > Subject: Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu

Re: [Qemu-devel] [PATCH 03/10] vga: add vga_scanline_invalidated helper

2017-04-18 Thread Gerd Hoffmann
> > +static bool vga_scanline_invalidated(VGACommonState *s, int y) > > +{ > > +if (y >= VGA_MAX_HEIGHT) { > > +return false; > > +} > > +return s->invalidated_y_table[y >> 5] |= 1 << (y & 0x1f); > > +} > The return stmt doesn't match what you're replacing. Are you really > i

Re: [Qemu-devel] [Qemu-block] [PATCH RFC 04/16] block: Propagate BLK_PERM_AIO_CONTEXT_CHANGE down the graph

2017-04-18 Thread Fam Zheng
On Mon, 04/10 09:57, Stefan Hajnoczi wrote: > On Tue, Mar 21, 2017 at 11:16:23AM +0800, Fam Zheng wrote: > > @@ -1713,21 +1714,22 @@ void bdrv_format_default_perms(BlockDriverState > > *bs, BdrvChild *c, > > perm |= BLK_PERM_CONSISTENT_READ; > > shared &= ~(BLK_PERM_WRITE | BLK_P

Re: [Qemu-devel] [PATCH 18/19] monitor: move hmp_savevm() to monitor.c

2017-04-18 Thread Paolo Bonzini
On 17/04/2017 22:00, Juan Quintela wrote: > hmp_loadvm is already there, so be consistent. Can you move both to hmp.c instead? Paolo > Signed-off-by: Juan Quintela > --- > include/sysemu/sysemu.h | 1 - > migration/savevm.c | 5 - > monitor.c | 5 + > 3 files chang

Re: [Qemu-devel] [PATCH 19/19] monitor: remove monitor parameter from save_vmstate

2017-04-18 Thread Paolo Bonzini
On 17/04/2017 22:00, Juan Quintela wrote: > load_vmstate() already use error_report, so be consistent. Better: make both return Error* via an Error** parameter, and add hmp_handle_error(mon, &err); to hmp_savevm and error_report_err(err) on the loading side. Paolo > Signed-off-by: Juan Q

Re: [Qemu-devel] [PATCH 05/19] migration: Export exec.c functions in its own file

2017-04-18 Thread Paolo Bonzini
On 17/04/2017 22:00, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > include/migration/exec.h | 20 Good cleanup, but please move it to migration/exec.h and include it with "exec.h". This is the standard for files that are not needed outside that particula

Re: [Qemu-devel] [PATCH 19/19] monitor: remove monitor parameter from save_vmstate

2017-04-18 Thread Paolo Bonzini
On 18/04/2017 11:44, Paolo Bonzini wrote: > > > On 17/04/2017 22:00, Juan Quintela wrote: >> load_vmstate() already use error_report, so be consistent. > > Better: make both return Error* via an Error** parameter, and add > > hmp_handle_error(mon, &err); > > to hmp_savevm and error_repor

Re: [Qemu-devel] define constant in .risu file

2017-04-18 Thread Peter Maydell
On 18 April 2017 at 05:20, G 3 wrote: > Is there a way to define a constant in a .risu file? Something like this: > > my $upper_imm_limit = 500; No - the risu file is just a bunch of patterns, with a few fragments of executable code mixed in. Currently constants defined in the perl source will b

Re: [Qemu-devel] [PATCH v3 00/21] chardev clean-ups & tests (after 2.9)

2017-04-18 Thread Marc-André Lureau
Hi On Mon, Apr 10, 2017 at 5:58 PM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > On Thu, Mar 16, 2017 at 10:23 AM Marc-André Lureau < > marcandre.lur...@redhat.com> wrote: > >> Hi, >> >> The following series contains various patches: >> - replace "chardevs" list for a /chardevs contain

Re: [Qemu-devel] What's the next QEMU version after 2.9 ? (or: when is a good point in time to get rid of old interfaces)

2017-04-18 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 02:53:00PM +0200, Markus Armbruster wrote: > Stefan Hajnoczi writes: > > > On Mon, Mar 27, 2017 at 01:49:44PM +0100, Peter Maydell wrote: > >> On 27 March 2017 at 13:01, Stefan Hajnoczi wrote: > >> > It would be nice to get rid of the legacy -net option in 3.0.0. I have

Re: [Qemu-devel] [PATCH] timer.h: Provide monotonic time for ARM guests

2017-04-18 Thread Paolo Bonzini
On 17/04/2017 20:55, Pranith Kumar wrote: >>> +/* ARM does not have a user-space readble cycle counter available. >>> + * This is a compromise to get monotonically increasing time. >>> + */ >>> +static inline int64_t cpu_get_host_ticks(void) >>> +{ >>> +return get_clock(); >>> +} >> This does

Re: [Qemu-devel] [PATCH v9 1/9] memory: add section range info for IOMMU notifier

2017-04-18 Thread Peter Xu
On Tue, Apr 11, 2017 at 11:56:54AM +1000, David Gibson wrote: > On Mon, Apr 10, 2017 at 03:09:50PM +0800, Peter Xu wrote: > > On Mon, Apr 10, 2017 at 02:39:22PM +1000, David Gibson wrote: > > > On Fri, Apr 07, 2017 at 06:59:07PM +0800, Peter Xu wrote: > > > > In this patch, IOMMUNotifier.{start|end

Re: [Qemu-devel] QEMU build breakage on ARM against Xen 4.9 caused by libxendevicemodel

2017-04-18 Thread Paul Durrant
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 15 April 2017 01:40 > To: Stefano Stabellini > Cc: Paul Durrant ; qemu-devel@nongnu.org; > Anthony Perard ; Wei Liu > ; jgr...@suse.com; julien.gr...@arm.com; xen- > de...@lists.xenproject.org > Subject

Re: [Qemu-devel] [PATCH 18/19] monitor: move hmp_savevm() to monitor.c

2017-04-18 Thread Juan Quintela
Paolo Bonzini wrote: > On 17/04/2017 22:00, Juan Quintela wrote: >> hmp_loadvm is already there, so be consistent. > > Can you move both to hmp.c instead? Discussed on irc with David. On my tree is already on hmp.c. Thanks, Juan.

Re: [Qemu-devel] [PATCH 19/19] monitor: remove monitor parameter from save_vmstate

2017-04-18 Thread Juan Quintela
Paolo Bonzini wrote: > On 18/04/2017 11:44, Paolo Bonzini wrote: >> >> >> On 17/04/2017 22:00, Juan Quintela wrote: >>> load_vmstate() already use error_report, so be consistent. >> >> Better: make both return Error* via an Error** parameter, and add >> >> hmp_handle_error(mon, &err); >>

Re: [Qemu-devel] [PATCH 05/19] migration: Export exec.c functions in its own file

2017-04-18 Thread Juan Quintela
Paolo Bonzini wrote: > On 17/04/2017 22:00, Juan Quintela wrote: >> Signed-off-by: Juan Quintela >> --- >> include/migration/exec.h | 20 > > Good cleanup, but please move it to migration/exec.h and include it with > "exec.h". This is the standard for files that are not

Re: [Qemu-devel] [RFC PATCH 0/4] nvdimm: enable flush hint address structure

2017-04-18 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 02:34:26PM +0800, Haozhong Zhang wrote: > On 04/06/17 10:43 +0100, Stefan Hajnoczi wrote: > > On Fri, Mar 31, 2017 at 04:41:43PM +0800, Haozhong Zhang wrote: > > > This patch series constructs the flush hint address structures for > > > nvdimm devices in QEMU. > > > > > > I

Re: [Qemu-devel] DMG chunk size independence

2017-04-18 Thread Ashijeet Acharya
On Tue, Apr 18, 2017 at 01:59 John Snow wrote: > > > On 04/15/2017 04:38 AM, Ashijeet Acharya wrote: > > Hi, > > > > Some of you are already aware but for the benefit of the open list, > > this mail is regarding the task mentioned > > Here -> http://wiki.qemu-project.org/ToDo/Block/DmgChunkSizeIn

[Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete

2017-04-18 Thread Denis V. Lunev
From: Anton Nefedov We should wait for other coroutines on error path, i.e. one of coroutines terminates with i/o error, before cleaning the common structures. In the other case we would crash in a lot of different places. This behaviour was introduced by commit 2d9187bc65. Signed-off-by: Anton

Re: [Qemu-devel] DMG chunk size independence

2017-04-18 Thread Kevin Wolf
Am 15.04.2017 um 10:38 hat Ashijeet Acharya geschrieben: > Hi, > > Some of you are already aware but for the benefit of the open list, > this mail is regarding the task mentioned > Here -> http://wiki.qemu-project.org/ToDo/Block/DmgChunkSizeIndependence > > I had a chat with Fam regarding this an

Re: [Qemu-devel] [PATCH v2 0/7] VT-d: PT (passthrough) mode support and misc fixes

2017-04-18 Thread Paolo Bonzini
On 17/04/2017 13:32, Peter Xu wrote: > v2: > - resending v1 since my patch script had a regression, which failed to > send the patches to the list... trying again. sorry for the noise! > > This series is for 2.10, and based on following series: > > [PATCH v8 0/9] VT-d: vfio enablement and

[Qemu-devel] [PATCH for-2.9-rc5 v3] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Fam Zheng
During block job completion, nothing is preventing block_job_defer_to_main_loop_bh from being called in a nested aio_poll(), which is a trouble, such as in this code path: qmp_block_commit commit_active_start bdrv_reopen bdrv_reopen_multiple bdrv_reopen_prep

Re: [Qemu-devel] [RFC 4/7] pci: Change pci_register_bus() 'parent' parameter to PCIHostState

2017-04-18 Thread Cornelia Huck
On Mon, 17 Apr 2017 18:59:13 -0300 Eduardo Habkost wrote: > pci_register_bus() already requires the 'parent' argument to be a > PCI_HOST_BRIDGE object. Change the parameter type to reflect that. > > Cc: Richard Henderson > Cc: Aurelien Jarno > Cc: Yongbok Kim > Cc: Alexander Graf > Cc: Scott

Re: [Qemu-devel] [RFC 5/7] pci: Set phb->bus inside pci_register_bus()

2017-04-18 Thread Cornelia Huck
On Mon, 17 Apr 2017 18:59:14 -0300 Eduardo Habkost wrote: > Every single caller of of pci_register_bus() saves the return value in > phb->bus. Do that inside pci_register_bus() to avoid code duplication > and make it harder to break. > > Most (but not all) conversions done using the following Co

Re: [Qemu-devel] qemu memory manage question

2017-04-18 Thread jack.chen
Hello, now I am confused about some structures in qemu related to memory management,they are MemoryRegion、AddressSpace、FlatView、FlatRange、MemoryRegionSection、RAMList、RAMBlock、KVMSlot、kvm_userspace_memory_region,who can tell me the concrete connection among these structures. thanks a lot! 2017-04-1

Re: [Qemu-devel] [PATCH for-2.9-rc5 v3] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Kevin Wolf
Am 18.04.2017 um 12:39 hat Fam Zheng geschrieben: > During block job completion, nothing is preventing > block_job_defer_to_main_loop_bh from being called in a nested > aio_poll(), which is a trouble, such as in this code path: > > qmp_block_commit > commit_active_start > bdrv_re

Re: [Qemu-devel] [PATCH 0/3 for 2.10] migration/i386 cleanup

2017-04-18 Thread Dr. David Alan Gilbert
* Eduardo Habkost (ehabk...@redhat.com) wrote: > On Wed, Apr 05, 2017 at 08:00:21PM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Hi, > > This removes some qemu_get_ and qemu_put_ use from i386/machine.c > > and cleans out some very old code. > > It bre

Re: [Qemu-devel] [PATCH 1/3] migration/i386: Remove old non-softfloat 64bit FP support

2017-04-18 Thread Dr. David Alan Gilbert
* Eduardo Habkost (ehabk...@redhat.com) wrote: > On Wed, Apr 05, 2017 at 08:00:22PM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Long long ago, we used to support storing the x86 FP registers in > > a 64bit format. > > > > Then c31da136a0bf8caad70c348f5ff

Re: [Qemu-devel] [PATCH for-2.9-rc5 v3] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Jeff Cody
On Tue, Apr 18, 2017 at 06:39:48PM +0800, Fam Zheng wrote: > During block job completion, nothing is preventing > block_job_defer_to_main_loop_bh from being called in a nested > aio_poll(), which is a trouble, such as in this code path: > > qmp_block_commit > commit_active_start >

Re: [Qemu-devel] [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-18 Thread Kevin Wolf
Am 14.04.2017 um 06:17 hat Denis V. Lunev geschrieben: > [skipped...] > > > Hi Denis, > > > > I've read this entire thread now and I really like Berto's summary which > > I think is one of the best recaps of existing qcow2 problems and this > > discussion so far. > > > > I understand your opinion

Re: [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete

2017-04-18 Thread Peter Lieven
Am 18.04.2017 um 12:27 schrieb Denis V. Lunev: From: Anton Nefedov We should wait for other coroutines on error path, i.e. one of coroutines terminates with i/o error, before cleaning the common structures. In the other case we would crash in a lot of different places. This behaviour was introd

Re: [Qemu-devel] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-18 Thread Alberto Garcia
On Thu 13 Apr 2017 05:17:21 PM CEST, Denis V. Lunev wrote: > On 04/13/2017 06:04 PM, Alberto Garcia wrote: >> On Thu 13 Apr 2017 03:30:43 PM CEST, Denis V. Lunev wrote: >>> Yes, block size should be increased. I perfectly in agreement with >>> your. But I think that we could do that by plain incre

Re: [Qemu-devel] [RFC 2/7] pci: Change pci_bus_init() 'parent' parameter to PCIHostState

2017-04-18 Thread Eduardo Habkost
On Tue, Apr 18, 2017 at 01:51:02PM +1000, David Gibson wrote: > On Mon, Apr 17, 2017 at 06:59:11PM -0300, Eduardo Habkost wrote: > > pci_bus_init() already requires 'parent' to be a PCI_HOST_BRIDGE object, > > so change the parameter type to reflect that. > > > > Cc: "Michael S. Tsirkin" > > Cc:

Re: [Qemu-devel] What's the next QEMU version after 2.9 ? (or: when is a good point in time to get rid of old interfaces)

2017-04-18 Thread Gerd Hoffmann
Hi, > > Just like -device is a general way to plug in devices, replacing > > multiple special ways (-net, -drive, -usb, ...), we could use a general > > way to configure onboard devices. > > I looked at the -device implementation to see if the bus= parameter > could be used to specify onboard d

Re: [Qemu-devel] [PATCH 20/31] parallels: Switch to .bdrv_co_block_status()

2017-04-18 Thread Denis V. Lunev
On 04/18/2017 04:33 AM, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the parallels driver accordingly. Note that > the internal function block_status() is still sector-based, because > it is still in use by other sector-based function

Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: Test postcopy migration

2017-04-18 Thread Dr. David Alan Gilbert
* Kevin Wolf (kw...@redhat.com) wrote: > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/181 | 117 > + > tests/qemu-iotests/181.out | 38 +++ > tests/qemu-iotests/group | 1 + > 3 files changed, 156 insertions(+) > create mo

Re: [Qemu-devel] migrate -b problems

2017-04-18 Thread Juan Quintela
Kevin Wolf wrote: > Hi all, Hi > after getting assertion failure reports for block migration in the last > minute, we just hacked around it by commenting out op blocker assertions > for the 2.9 release, but now we need to see how to fix things properly. > Luckily, get_maintainer.pl doesn't repor

Re: [Qemu-devel] [PATCH 0/3 for 2.10] migration/i386 cleanup

2017-04-18 Thread Paolo Bonzini
On 18/04/2017 13:00, Dr. David Alan Gilbert wrote: >> It would be nice if we could allow kvm-unit-tests test cases >> trigger a migration operation at a specific instruction. I assume >> we don't have an existing mechanism that could be used for that? > Not that I know of, do we have any type of

Re: [Qemu-devel] [PATCH for-2.9-rc5 v3] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Paolo Bonzini
On 18/04/2017 12:39, Fam Zheng wrote: > +QLIST_FOREACH_SAFE(child, &bs->children, next, tmp) { > +BlockDriverState *bs = child->bs; > +assert(bs->refcnt > 0); > +bdrv_ref(bs); > +waited |= bdrv_drain_recurse(bs); > +bdrv_unref(bs); > } I think thi

Re: [Qemu-devel] [PATCH 2/2] target/openrisc: Implement EPH bit

2017-04-18 Thread Stafford Horne
On Tue, Apr 18, 2017 at 04:15:51PM +1000, Tim 'mithro' Ansell wrote: > Exception Prefix High (EPH) control bit of the Supervision Register > (SR). > > The significant bits (31-12) of the vector offset address for each > exception depend on the setting of the Supervision Register (SR)'s EPH > bit a

Re: [Qemu-devel] [PATCH 1/2] target/openrisc: Implement EVBAR register

2017-04-18 Thread Stafford Horne
On Tue, Apr 18, 2017 at 04:15:50PM +1000, Tim 'mithro' Ansell wrote: > Exception Vector Base Address Register (EVBAR) - This optional register > can be used to apply an offset to the exception vector addresses. > > The significant bits (31-12) of the vector offset address for each > exception depe

Re: [Qemu-devel] [RFC 1/7] pci: Change pci_host_bus_register() parameter to PCIHostState

2017-04-18 Thread Marcel Apfelbaum
On 04/18/2017 12:59 AM, Eduardo Habkost wrote: The function requires a PCI_HOST_BRIDGE object, so change the parameter type to reflect that. Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Signed-off-by: Eduardo Habkost --- hw/pci/pci.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletion

Re: [Qemu-devel] [ANNOUNCE] QEMU 2.9.0-rc4 is now available

2017-04-18 Thread Peter Maydell
On 11 April 2017 at 20:28, Michael Roth wrote: > Hello, > > On behalf of the QEMU Team, I'd like to announce the availability of the > fifth release candidate for the QEMU 2.9 release. This release is meant > for testing purposes and should not be used in a production environment. > > http://do

Re: [Qemu-devel] [PATCH RFC 1/3] block: Introduce BDRV_O_UNSAFE_READ

2017-04-18 Thread Eric Blake
On 03/13/2017 09:39 PM, Fam Zheng wrote: > This flag clears out the "consistent read" permission that blk_new_open > requests. > > Signed-off-by: Fam Zheng > --- > block/block-backend.c | 2 +- > include/block/block.h | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/blo

Re: [Qemu-devel] [PATCH RFC 2/3] qemu-img: Add --unsafe-read option to subcommands

2017-04-18 Thread Eric Blake
On 03/13/2017 09:39 PM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > qemu-img.c | 148 > +++-- > 1 file changed, 114 insertions(+), 34 deletions(-) > > @@ -2711,9 +2751,10 @@ static int img_map(int argc, char **argv) >

Re: [Qemu-devel] [RFC 2/7] pci: Change pci_bus_init() 'parent' parameter to PCIHostState

2017-04-18 Thread Marcel Apfelbaum
On 04/18/2017 02:48 PM, Eduardo Habkost wrote: On Tue, Apr 18, 2017 at 01:51:02PM +1000, David Gibson wrote: On Mon, Apr 17, 2017 at 06:59:11PM -0300, Eduardo Habkost wrote: pci_bus_init() already requires 'parent' to be a PCI_HOST_BRIDGE object, so change the parameter type to reflect that. C

Re: [Qemu-devel] [PATCH v2 3/4] versatile: remove cannot_destroy_with_object_finalize_yet

2017-04-18 Thread Markus Armbruster
Laurent Vivier writes: > cannot_destroy_with_object_finalize_yet was added by 4c315c2 > ("qdev: Protect device-list-properties against broken devices") > because "realview_pci" and "versatile_pci" were hanging > during "device-list-properties" cleanup (an infinite loop in > bus_unparent()). > > W

Re: [Qemu-devel] [PATCH v2 4/4] qdev: remove cannot_destroy_with_object_finalize_yet

2017-04-18 Thread Markus Armbruster
Laurent Vivier writes: > As all users have been removed, we can remove > cannot_destroy_with_object_finalize_yet field > from the DeviceClass structure. > > Signed-off-by: Laurent Vivier Huzzah! Reviewed-by: Markus Armbruster

Re: [Qemu-devel] [PATCH RFC 3/3] qemu-io: Add --unsafe-read option

2017-04-18 Thread Eric Blake
On 03/13/2017 09:39 PM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > qemu-io.c | 28 +--- > 1 file changed, 21 insertions(+), 7 deletions(-) > > @@ -108,6 +112,7 @@ static void open_help(void) > " -r, -- open file read-only\n" > " -s, -- use snapshot file\n" > "

Re: [Qemu-devel] [RFC 3/7] pci: Change pci_bus_new*() parameter to PCIHostState

2017-04-18 Thread Marcel Apfelbaum
On 04/18/2017 12:59 AM, Eduardo Habkost wrote: The pci_bus_new*() functions already require the 'parent' argument to be a PCI_HOST_BRIDGE object. Change the parameter type to reflect that. Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Cc: "Hervé Poussineau" Cc: Peter Maydell Cc: qemu-...@non

Re: [Qemu-devel] [RFC 3/7] pci: Change pci_bus_new*() parameter to PCIHostState

2017-04-18 Thread Eduardo Habkost
On Tue, Apr 18, 2017 at 04:27:23PM +0300, Marcel Apfelbaum wrote: [...] > > @@ -431,7 +430,7 @@ PCIBus *pci_register_bus(DeviceState *parent, const > > char *name, > > { > > PCIBus *bus; > > > > -bus = pci_bus_new(parent, name, address_space_mem, > > +bus = pci_bus_new(PCI_HOST_BRID

Re: [Qemu-devel] [PATCH] char: Fix removing wrong GSource that be found by fd_in_tag

2017-04-18 Thread Eric Blake
On 04/14/2017 05:10 AM, Marc-André Lureau wrote: > Hi > > - Original Message - >> We use fd_in_tag to find a GSource, fd_in_tag is return value of >> g_source_attach(GSource *source, GMainContext *context), the return >> value is unique only in the same context, so we may get the same >> v

Re: [Qemu-devel] [RFC 3/7] pci: Change pci_bus_new*() parameter to PCIHostState

2017-04-18 Thread Marcel Apfelbaum
On 04/18/2017 04:30 PM, Eduardo Habkost wrote: On Tue, Apr 18, 2017 at 04:27:23PM +0300, Marcel Apfelbaum wrote: [...] @@ -431,7 +430,7 @@ PCIBus *pci_register_bus(DeviceState *parent, const char *name, { PCIBus *bus; -bus = pci_bus_new(parent, name, address_space_mem, +bus = pci

Re: [Qemu-devel] [RFC 4/7] pci: Change pci_register_bus() 'parent' parameter to PCIHostState

2017-04-18 Thread Marcel Apfelbaum
On 04/18/2017 12:59 AM, Eduardo Habkost wrote: pci_register_bus() already requires the 'parent' argument to be a PCI_HOST_BRIDGE object. Change the parameter type to reflect that. Cc: Richard Henderson Cc: Aurelien Jarno Cc: Yongbok Kim Cc: Alexander Graf Cc: Scott Wood Cc: Paul Burton Cc:

Re: [Qemu-devel] [RFC 5/7] pci: Set phb->bus inside pci_register_bus()

2017-04-18 Thread Marcel Apfelbaum
On 04/18/2017 12:59 AM, Eduardo Habkost wrote: Every single caller of of pci_register_bus() saves the return value in phb->bus. Do that inside pci_register_bus() to avoid code duplication and make it harder to break. I personally find that more difficult to follow, maybe the function name is m

Re: [Qemu-devel] [PATCH for-2.9-rc5 v3] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Fam Zheng
On Tue, 04/18 14:36, Paolo Bonzini wrote: > > > On 18/04/2017 12:39, Fam Zheng wrote: > > +QLIST_FOREACH_SAFE(child, &bs->children, next, tmp) { > > +BlockDriverState *bs = child->bs; > > +assert(bs->refcnt > 0); > > +bdrv_ref(bs); > > +waited |= bdrv_drain_rec

Re: [Qemu-devel] [RFC 5/7] pci: Set phb->bus inside pci_register_bus()

2017-04-18 Thread Eduardo Habkost
On Tue, Apr 18, 2017 at 04:43:48PM +0300, Marcel Apfelbaum wrote: > On 04/18/2017 12:59 AM, Eduardo Habkost wrote: > > Every single caller of of pci_register_bus() saves the return value in > > phb->bus. Do that inside pci_register_bus() to avoid code duplication > > and make it harder to break. >

[Qemu-devel] [PATCH v5 0/9] qemu-img: add measure sub-command

2017-04-18 Thread Stefan Hajnoczi
v5: * Use UINT64_MAX instead of ~0ULL [Berto] * Document qemu-img measure ofmt, fmt, output_fmt, and snapshot_param [Berto] v4: * Make qcow2 refcount calculation conservative [Maor] * Include actual qemu-img convert image size in test cases v3: * Drop RFC, this is ready to go for QEMU 2.1

[Qemu-devel] [PATCH v5 6/9] qcow2: add bdrv_measure() support

2017-04-18 Thread Stefan Hajnoczi
Use qcow2_calc_prealloc_size() to get the required file size. Signed-off-by: Stefan Hajnoczi --- block/qcow2.c | 122 ++ 1 file changed, 122 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 0181d72..a2c7f97 100644 --- a/block

[Qemu-devel] [PATCH v5 1/9] block: add bdrv_measure() API

2017-04-18 Thread Stefan Hajnoczi
bdrv_measure() provides a conservative maximum for the size of a new image. This information is handy if storage needs to be allocated (e.g. a SAN or an LVM volume) ahead of time. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia --- qapi/block-core.json | 25

[Qemu-devel] [PATCH v5 7/9] qemu-img: add measure subcommand

2017-04-18 Thread Stefan Hajnoczi
The measure subcommand calculates the size required by a new image file. This can be used by users or management tools that need to allocate space on an LVM volume, SAN LUN, etc before creating or converting an image file. Suggested-by: Maor Lipchuk Signed-off-by: Stefan Hajnoczi --- v5: * Use

[Qemu-devel] [PATCH v5 2/9] raw-format: add bdrv_measure() support

2017-04-18 Thread Stefan Hajnoczi
Maximum size calculation is trivial for the raw format: it's just the requested image size (because there is no metadata). Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia --- block/raw-format.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/block/raw-form

[Qemu-devel] [PATCH v5 4/9] qcow2: make refcount size calculation conservative

2017-04-18 Thread Stefan Hajnoczi
The refcount metadata size calculation is inaccurate and can produce numbers that are too small. This is bad because we should calculate a conservative number - one that is guaranteed to be large enough. This patch switches the approach to a fixed point calculation because the existing equation i

[Qemu-devel] [PATCH v5 8/9] qemu-iotests: support per-format golden output files

2017-04-18 Thread Stefan Hajnoczi
Some tests produce format-dependent output. Either the difference is filtered out and ignored, or the test case is format-specific so we don't need to worry about per-format output differences. There is a third case: the test script is the same for all image formats and the format-dependent outpu

[Qemu-devel] [PATCH v5 3/9] qcow2: extract preallocation calculation function

2017-04-18 Thread Stefan Hajnoczi
Calculating the preallocated image size will be needed to implement .bdrv_measure(). Extract the code out into a separate function. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia --- block/qcow2.c | 134 +- 1 file changed, 76

[Qemu-devel] [PATCH v5 5/9] qcow2: extract image creation option parsing

2017-04-18 Thread Stefan Hajnoczi
The image creation options parsed by qcow2_create() are also needed to implement .bdrv_measure(). Extract the parsing code, including input validation. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia --- block/qcow2.c | 109 +++---

Re: [Qemu-devel] [PATCH v9 1/9] memory: add section range info for IOMMU notifier

2017-04-18 Thread David Gibson
On Tue, Apr 18, 2017 at 05:56:37PM +0800, Peter Xu wrote: > On Tue, Apr 11, 2017 at 11:56:54AM +1000, David Gibson wrote: > > On Mon, Apr 10, 2017 at 03:09:50PM +0800, Peter Xu wrote: > > > On Mon, Apr 10, 2017 at 02:39:22PM +1000, David Gibson wrote: > > > > On Fri, Apr 07, 2017 at 06:59:07PM +080

[Qemu-devel] [PATCH v5 9/9] iotests: add test 178 for qemu-img measure

2017-04-18 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/178 | 168 +++ tests/qemu-iotests/178.out.qcow2 | 278 +++ tests/qemu-iotests/178.out.raw | 146 tests/qemu-iotests/group | 1 + 4 files changed

Re: [Qemu-devel] [PATCH 1/7] target/openrisc: Fixes for memory debugging

2017-04-18 Thread Stafford Horne
On Tue, Apr 18, 2017 at 12:47:30AM -0700, Richard Henderson wrote: > On 04/16/2017 04:23 PM, Stafford Horne wrote: > > When debugging in gdb you might want to inspect instructions in mapped > > pages or in exception vectors like 0x800 etc. This was previously not > > possible in qemu since the *ge

Re: [Qemu-devel] [PATCH 2/7] target/openrisc: add shutdown logic

2017-04-18 Thread Stafford Horne
On Tue, Apr 18, 2017 at 12:52:52AM -0700, Richard Henderson wrote: > On 04/16/2017 04:23 PM, Stafford Horne wrote: > > In openrisc simulators we use hooks like 'l.nop 1' to cause the > > simulator to exit. Implement that for qemu too. > > > > Reported-by: Waldemar Brodkorb > > Signed-off-by: Sta

Re: [Qemu-devel] [PATCH 4/7] target/openrisc: implement shadow registers

2017-04-18 Thread Stafford Horne
On Tue, Apr 18, 2017 at 01:11:53AM -0700, Richard Henderson wrote: > On 04/16/2017 04:23 PM, Stafford Horne wrote: > > Shadow registers are part of the openrisc spec along with sr[cid], as > > part of the fast context switching feature. When exceptions occur, > > instead of having to save register

Re: [Qemu-devel] [PATCH 7/7] target/openrisc: Implement full vmstate serialization

2017-04-18 Thread Stafford Horne
On Tue, Apr 18, 2017 at 01:14:19AM -0700, Richard Henderson wrote: > On 04/16/2017 04:23 PM, Stafford Horne wrote: > > Previously serialization did not persist the tlb, timer, pic and other > > key state items. This meant snapshotting and restoring a running os > > would crash. After adding these

[Qemu-devel] [PATCH for-2.9-rc5 v4 0/2] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Fam Zheng
v4: Split patch, and fix the unsafe bdrv_unref. [Paolo] Fam Zheng (2): block: Walk bs->children carefully in bdrv_drain_recurse block: Drain BH in bdrv_drained_begin block/io.c| 23 --- include/block/block.h | 22 ++ 2 files changed, 34 ins

Re: [Qemu-devel] guest host time synchronization

2017-04-18 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 09:01:40AM +0200, Jiahuan Zhang wrote: > I made a test to check the time difference of QEMU emulated ARM-based Linux > guest and the Windows host. The result is, the guest time is around 0.2 > second faster than the host. I used the "-rtc base" option. > > So can I say that

[Qemu-devel] [PATCH for-2.9-rc5 v4 1/2] block: Walk bs->children carefully in bdrv_drain_recurse

2017-04-18 Thread Fam Zheng
The recursive bdrv_drain_recurse may run a block job completion BH that drops nodes. The coming changes will make that more likely and use-after-free would happen without this patch Stash the bs pointer and use bdrv_ref/bdrv_unref in addition to QLIST_FOREACH_SAFE to prevent such a case from happe

Re: [Qemu-devel] [RFC for-2.10 2/3] pci: Allow host bridges to override PCI/PCIe hybrid device behaviour

2017-04-18 Thread Eduardo Habkost
On Tue, Apr 18, 2017 at 12:21:51PM +1000, David Gibson wrote: > On Mon, Apr 17, 2017 at 03:30:46PM -0300, Eduardo Habkost wrote: > > On Tue, Mar 28, 2017 at 01:16:50PM +1100, David Gibson wrote: > > > Currently PCI/PCIe hybrid devices - that is, devices which can appear as > > > either plain PCI or

[Qemu-devel] [PATCH for-2.9-rc5 v4 2/2] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Fam Zheng
During block job completion, nothing is preventing block_job_defer_to_main_loop_bh from being called in a nested aio_poll(), which is a trouble, such as in this code path: qmp_block_commit commit_active_start bdrv_reopen bdrv_reopen_multiple bdrv_reopen_prep

Re: [Qemu-devel] [PATCH 03/14] cg3: remove unused width and height variables

2017-04-18 Thread Mark Cave-Ayland
On 15/04/17 11:54, Richard Henderson wrote: > On 04/05/2017 01:35 AM, Mark Cave-Ayland wrote: >> These aren't required since we can use the display width and height >> directly. >> >> Signed-off-by: Mark Cave-Ayland >> --- >> hw/display/cg3.c | 15 ++- >> 1 file changed, 6 insertio

Re: [Qemu-devel] [Qemu-block] migrate -b problems

2017-04-18 Thread Stefan Hajnoczi
On Wed, Apr 12, 2017 at 05:51:23PM +0800, 858585 jemmy wrote: > it this bug? > https://bugs.launchpad.net/qemu/+bug/1681688 Yes. This discussion is about the long-term fix instead of a short-term hack for QEMU 2.9. Stefan signature.asc Description: PGP signature

Re: [Qemu-devel] [PATCH for-2.9-rc5 v4 0/2] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Paolo Bonzini
On 18/04/2017 16:30, Fam Zheng wrote: > v4: Split patch, and fix the unsafe bdrv_unref. [Paolo] > > Fam Zheng (2): > block: Walk bs->children carefully in bdrv_drain_recurse > block: Drain BH in bdrv_drained_begin > > block/io.c| 23 --- > include/block/bloc

Re: [Qemu-devel] [PATCH 05/14] tcx: alter tcx_set_dirty() to accept address and length parameters

2017-04-18 Thread Mark Cave-Ayland
On 15/04/17 15:27, Philippe Mathieu-Daudé wrote: Hi Philippe, > Hi Mark, > > On 04/05/2017 05:35 AM, Mark Cave-Ayland wrote: >> Signed-off-by: Mark Cave-Ayland >> --- >> hw/display/tcx.c | 12 ++-- >> 1 file changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/hw/display/tcx.c

Re: [Qemu-devel] [PATCH for-2.9-rc5 v4 1/2] block: Walk bs->children carefully in bdrv_drain_recurse

2017-04-18 Thread Kevin Wolf
Am 18.04.2017 um 16:30 hat Fam Zheng geschrieben: > The recursive bdrv_drain_recurse may run a block job completion BH that > drops nodes. The coming changes will make that more likely and use-after-free > would happen without this patch > > Stash the bs pointer and use bdrv_ref/bdrv_unref in addi

Re: [Qemu-devel] [Qemu-block] migrate -b problems

2017-04-18 Thread Stefan Hajnoczi
On Wed, Apr 12, 2017 at 11:18:19AM +0200, Kevin Wolf wrote: > after getting assertion failure reports for block migration in the last > minute, we just hacked around it by commenting out op blocker assertions > for the 2.9 release, but now we need to see how to fix things properly. > Luckily, get_m

Re: [Qemu-devel] help for code

2017-04-18 Thread Stefan Hajnoczi
On Wed, Apr 12, 2017 at 04:36:58PM +0430, ali saeedi wrote: > I am new in qemu vm live migration. why we have this condition > "current_time >= initial_time + BUFFER_DELAY" in qemu? BUFFER_DELAY is used for rate-limiting. The maximum network throughput can be set by the user so that QEMU doesn't

Re: [Qemu-devel] [PATCH for-2.9-rc5 v4 0/2] block: Drain BH in bdrv_drained_begin

2017-04-18 Thread Jeff Cody
On Tue, Apr 18, 2017 at 10:30:42PM +0800, Fam Zheng wrote: > v4: Split patch, and fix the unsafe bdrv_unref. [Paolo] > > Fam Zheng (2): > block: Walk bs->children carefully in bdrv_drain_recurse > block: Drain BH in bdrv_drained_begin > > block/io.c| 23 --- >

  1   2   3   >