Re: [Qemu-devel] savevm/loadvm

2013-10-09 Thread Alexey Kardashevskiy
On 10/08/2013 08:33 PM, Paolo Bonzini wrote: > Il 08/10/2013 11:23, Kevin Wolf ha scritto: I think you need to modify qcow2_save_vmstate to save and restore bs->total_sectors. Can you test that and if so post the patch? >> It's a regression introduced by commit df2a6f29, right? > > Yes,

Re: [Qemu-devel] [PATCH v2 2/4] Curling: cmdline interface.

2013-10-09 Thread junqing . wang
At 2013-10-01 06:16:34,"Eric Blake" wrote: >On 09/29/2013 02:14 PM, Jules Wang wrote: >> Add an option '-f' to migration cmdline. >> Indicating whether to enable fault tolerant or not. >> >> Signed-off-by: Jules Wang >> --- >> .help = "migrate to URI (using -d to not wait for

Re: [Qemu-devel] [PATCH v5 2/5] hpet: entitle more irq pins for hpet

2013-10-09 Thread Michael S. Tsirkin
On Wed, Oct 09, 2013 at 11:27:24AM +0800, liu ping fan wrote: > On Mon, Sep 30, 2013 at 11:58 PM, Michael S. Tsirkin wrote: > > On Mon, Sep 30, 2013 at 05:48:03PM +0200, Paolo Bonzini wrote: > >> Il 30/09/2013 11:30, Michael S. Tsirkin ha scritto: > >> > I was really only talking about q35 here. >

[Qemu-devel] [PATCH v2] scsi: Allocate SCSITargetReq r->buf dynamically

2013-10-09 Thread Asias He
r->buf is hardcoded to 2056 which is (256 + 1) * 8, allowing 256 luns at most. If more than 256 luns are specified by user, we have buffer overflow in scsi_target_emulate_report_luns. To fix, we allocate the buffer dynamically. Signed-off-by: Asias He Tested-by: Michael Roth --- Changes in v2:

Re: [Qemu-devel] [PATCH v5 2/5] hpet: entitle more irq pins for hpet

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 09:24, Michael S. Tsirkin ha scritto: >> > Sorry, out of office for a long time, and did not keep up with this >> > thread in time. >> > When letting the caller set the intcap, we should consider the >> > compatibility of q35. For pc-q35-1.7 or later, the caller should set >> > the pr

Re: [Qemu-devel] [patch 0/2] force -mem-path RAM allocation

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 00:03, Marcelo Tosatti ha scritto: > It would be important for the new option to be backportable > independently. Therefore mixing it with -numa is not an option. Why is it important to backport it independently? In any case you need management support for the new option. Paolo

Re: [Qemu-devel] savevm/loadvm

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 09:15, Alexey Kardashevskiy ha scritto: > Sorry for my ignorance (I never ever touched this part of qemu) but how can > you possibly avoid block.c while doing savevm? The qcow2 driver must not > use posix read()/write(), right? So no matter how, all writes end up in > bdrv_co_do_write

Re: [Qemu-devel] [PATCH v5 2/5] hpet: entitle more irq pins for hpet

2013-10-09 Thread Michael S. Tsirkin
On Wed, Oct 09, 2013 at 09:41:29AM +0200, Paolo Bonzini wrote: > Il 09/10/2013 09:24, Michael S. Tsirkin ha scritto: > >> > Sorry, out of office for a long time, and did not keep up with this > >> > thread in time. > >> > When letting the caller set the intcap, we should consider the > >> > compati

Re: [Qemu-devel] [patch 1/2] qemu: mempath: prefault pages manually

2013-10-09 Thread Paolo Bonzini
Il 08/10/2013 23:51, Marcelo Tosatti ha scritto: > On Tue, Oct 08, 2013 at 10:03:48AM +0200, Paolo Bonzini wrote: >> Il 08/10/2013 02:41, Marcelo Tosatti ha scritto: >>> +/* unblock SIGBUS */ >>> +pthread_sigmask(SIG_BLOCK, NULL, &oldset); >>> +sigemptyset(&set); >>> +

Re: [Qemu-devel] [PATCH] qemu-iotests: Correct 026 output

2013-10-09 Thread Stefan Hajnoczi
On Tue, Oct 08, 2013 at 02:37:12PM +0200, Kevin Wolf wrote: > Am 02.10.2013 um 16:45 hat Max Reitz geschrieben: > > Because l2_allocate now frees the unused L2 cluster on error, the > > according test cases in 026 don't result in one leaked cluster anymore. > > > > Signed-off-by: Max Reitz > > --

Re: [Qemu-devel] [PATCH] osdep: initialize glib threads in all QEMU tools

2013-10-09 Thread Stefan Hajnoczi
On Tue, Oct 08, 2013 at 03:58:24PM +0200, Kevin Wolf wrote: > Am 08.10.2013 um 15:08 hat Paolo Bonzini geschrieben: > > Il 08/10/2013 14:25, Kevin Wolf ha scritto: > > > The glib documentation says: > > > > > > Since version 2.24, calling g_thread_init() multiple times is > > > allowed, bu

[Qemu-devel] [PATCH] qcow2: Alignment of snapshot table entries

2013-10-09 Thread Max Reitz
The qcow2 specification does not explicitly state so far that every snapshot table entry is aligned to 8 bytes. QEMU, in contrast, does this alignment, thus it should be properly documented (which this patch does). Signed-off-by: Max Reitz --- docs/specs/qcow2.txt | 3 +++ 1 file changed, 3 inse

Re: [Qemu-devel] [PATCH v5 2/5] hpet: entitle more irq pins for hpet

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 10:01, Michael S. Tsirkin ha scritto: > > So you're suggesting skipping the mechanism we have for compatibility > > properties, and instead using a global variable or something like that? > > That's one option. > Or we can use global properties - just set for 1.7 too. That's better.

[Qemu-devel] [PATCH] qcow2: Use pread for inactive L1 in overlap check

2013-10-09 Thread Max Reitz
Currently, qcow2_check_metadata_overlap uses bdrv_read to read inactive L1 tables from disk. The number of sectors to read is calculated through a truncating integer division, therefore, if the L1 table size is not a multiple of the sector size, the final entries will not be read and their entries

[Qemu-devel] [PATCH] qcow2: Free preallocated zero clusters

2013-10-09 Thread Max Reitz
In qcow2_free_any_clusters, preallocated zero clusters should be freed just as normal clusters are. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 2d67885..9dd5e

[Qemu-devel] [PATCH v8 5/6] qemu-iotests: Discard specific info in _img_info

2013-10-09 Thread Max Reitz
In _img_info, filter out additional information specific to the image format provided by qemu-img info, since tests designed for multiple image formats would produce different outputs for every image format otherwise. In a human-readable dump, that new information will always be last for each "ima

Re: [Qemu-devel] [PATCH v2] scsi: Allocate SCSITargetReq r->buf dynamically

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 09:41, Asias He ha scritto: > r->buf is hardcoded to 2056 which is (256 + 1) * 8, allowing 256 luns at > most. If more than 256 luns are specified by user, we have buffer > overflow in scsi_target_emulate_report_luns. > > To fix, we allocate the buffer dynamically. > > Signed-off-by

[Qemu-devel] [PATCH v8 0/6] Provide additional info through qemu-img info

2013-10-09 Thread Max Reitz
qemu-img info provides only pretty general information about an image. For any image format, there might be specific options which cannot be represented in a universal way; for instance, qcow2 provides the compatibility and lazy_refcount options whose values are certainly interesting but currently

[Qemu-devel] [PATCH v8 1/6] qapi: Add ImageInfoSpecific type

2013-10-09 Thread Max Reitz
Add a new type ImageInfoSpecific as a union for image format specific information in ImageInfo. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- qapi-schema.json | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index

[Qemu-devel] [PATCH v8 3/6] block/qapi: Human-readable ImageInfoSpecific dump

2013-10-09 Thread Max Reitz
Add a function for generically dumping the ImageInfoSpecific information in a human-readable format to block/qapi.c. Use this function in bdrv_image_info_dump and qemu-io-cmds.c:info_f to allow qemu-img info resp. qemu-io -c info to print that format specific information. Signed-off-by: Max Reitz

[Qemu-devel] [PATCH v8 6/6] qemu-iotests: Additional info from qemu-img info

2013-10-09 Thread Max Reitz
Add a test for the additional information now provided by qemu-img info when used on qcow2 images. It also tests the qemu QMP output from the query-block command when running qemu with different runtime options than specified in the image (ImageInfoSpecific should always refer to the image). Signe

[Qemu-devel] [PATCH v8 4/6] qcow2: Add support for ImageInfoSpecific

2013-10-09 Thread Max Reitz
Add a new ImageInfoSpecificQCow2 type as a subtype of ImageInfoSpecific. This contains the compatibility level as a string and an optional lazy_refcounts boolean (optional means mandatory for compat >= 1.1 and not available for compat == 0.10). Also, add qcow2_get_specific_info, which returns this

[Qemu-devel] [PATCH v8 2/6] block: Add bdrv_get_specific_info

2013-10-09 Thread Max Reitz
Add a function for retrieving an ImageInfoSpecific object from a block driver. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c | 9 + block/qapi.c | 3 +++ include/block/block.h | 1 + include/block/block_int.h | 1 + 4 files changed, 14 i

[Qemu-devel] [PATCH 2/3] qcow2: Free allocated snapshot table on error

2013-10-09 Thread Max Reitz
If an error occurs during qcow2_write_snapshots, the newly allocated snapshot table clusters are leaked and should thus be freed. Signed-off-by: Max Reitz --- block/qcow2-snapshot.c | 4 1 file changed, 4 insertions(+) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 3337

[Qemu-devel] [PATCH 0/3] qcow2: Small error path fixes for snapshot writing

2013-10-09 Thread Max Reitz
Errors in qcow2_write_snapshots should always go down the error path. If this path is taken, the newly allocated snapshot table clusters are abandoned and should thus be freed. Furthermore, we should safeguard against a possible future increase of QEMU's maximum snapshot name/ID length. Max Reitz

[Qemu-devel] [PATCH 1/3] qcow2: Always use error path on writing snapshots

2013-10-09 Thread Max Reitz
qcow2_write_snapshots does contain a fail label and there is no reason not to use it on some errors; therefore, we should always jump there on error. Signed-off-by: Max Reitz --- block/qcow2-snapshot.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/qcow2-snapsho

[Qemu-devel] [PATCH 3/3] qcow2: Assert against snapshot name/ID overflow

2013-10-09 Thread Max Reitz
qcow2_write_snapshots relies on the length of every snapshot ID and name fitting into an unsigned 16 bit integer. This is currently ensured by QEMU through generally only allowing 128 byte IDs and 256 byte names. However, if this should change in the future, the length written to the image file sho

Re: [Qemu-devel] [PATCH 03/13] usb-host-libusb: Detach kernel drivers earlier

2013-10-09 Thread Gerd Hoffmann
On Di, 2013-10-08 at 21:58 +0200, Hans de Goede wrote: > If we detach the kernel drivers on the first set_config, then they will > be still attached when the device gets its initial reset. Causing the drivers > to re-initialize the device after the reset, dirtying the device state. > @@ -1051,7 +1

Re: [Qemu-devel] [PATCH v8 0/6] Provide additional info through qemu-img info

2013-10-09 Thread Kevin Wolf
Am 09.10.2013 um 10:46 hat Max Reitz geschrieben: > qemu-img info provides only pretty general information about an image. > For any image format, there might be specific options which cannot be > represented in a universal way; for instance, qcow2 provides the > compatibility and lazy_refcount opt

Re: [Qemu-devel] [PATCH] qcow2: Alignment of snapshot table entries

2013-10-09 Thread Kevin Wolf
Am 09.10.2013 um 10:34 hat Max Reitz geschrieben: > The qcow2 specification does not explicitly state so far that every > snapshot table entry is aligned to 8 bytes. QEMU, in contrast, does this > alignment, thus it should be properly documented (which this patch > does). > > Signed-off-by: Max Re

Re: [Qemu-devel] [PATCH] qcow2: Use pread for inactive L1 in overlap check

2013-10-09 Thread Kevin Wolf
Am 09.10.2013 um 10:42 hat Max Reitz geschrieben: > Currently, qcow2_check_metadata_overlap uses bdrv_read to read inactive > L1 tables from disk. The number of sectors to read is calculated through > a truncating integer division, therefore, if the L1 table size is not a > multiple of the sector s

Re: [Qemu-devel] [PATCH] qcow2: Free preallocated zero clusters

2013-10-09 Thread Kevin Wolf
Am 09.10.2013 um 10:44 hat Max Reitz geschrieben: > In qcow2_free_any_clusters, preallocated zero clusters should be freed > just as normal clusters are. > > Signed-off-by: Max Reitz Thanks, applied to the block branch. Do you have a test case that would cause a leak previously? Kevin

[Qemu-devel] [RFC qom-cpu v4 03/10] apic: remove local_apics array and using CPU_FOREACH instead

2013-10-09 Thread Chen Fan
Using CPU_FOREACH() marco instead of scaning the entire local_apics array for fast searching apic. Signed-off-by: Chen Fan --- hw/intc/apic.c | 73 ++--- include/hw/i386/apic_internal.h | 2 -- 2 files changed, 32 insertions(+), 43 deletions(

[Qemu-devel] [RFC qom-cpu v4 06/10] qom cpu: rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier'

2013-10-09 Thread Chen Fan
Rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier', for adding vcpu-remove notifier support. Signed-off-by: Chen Fan --- hw/acpi/piix4.c | 10 +- hw/i386/pc.c| 2 +- include/sysemu/sysemu.h | 2 +- qom/cpu.c | 10 +- 4 files changed

[Qemu-devel] [RFC qom-cpu v4 02/10] apic: remove redundant variable 'apic_no' from apic_init_common()

2013-10-09 Thread Chen Fan
In struct APICCommonState, there is an id field yet, which was set earlier, qdev_prop_set_uint8(env->apic_state, "id", env->cpuid_apic_id); so we use the id field instead of the variable 'apic_no' to represent the unique apic index. Signed-off-by: Chen Fan --- hw/intc/apic_common.c | 6 +-

[Qemu-devel] [RFC qom-cpu v4 04/10] x86: add x86_cpu_unrealizefn() for cpu apic remove

2013-10-09 Thread Chen Fan
Implement x86_cpu_unrealizefn() for corresponding x86_cpu_realizefn(), which is mostly used to clear the apic related information at here. and refactor apic initialization, use QOM realizefn. Signed-off-by: Chen Fan --- hw/i386/kvm/apic.c | 18 -- hw/intc/apic.c

[Qemu-devel] [RFC qom-cpu v4 01/10] x86: move apic_state field from CPUX86State to X86CPU

2013-10-09 Thread Chen Fan
This motion is preparing for refactoring vCPU apic subsequently. Signed-off-by: Chen Fan --- cpu-exec.c| 2 +- cpus.c| 5 ++--- hw/i386/kvmvapic.c| 8 +++- hw/i386/pc.c | 17 - target-i386/cpu-qom.h | 4 ta

[Qemu-devel] [RFC qom-cpu v4 08/10] i386: implement pc interface pc_hot_del_cpu()

2013-10-09 Thread Chen Fan
Implement cpu interface pc_hot_del_cpu() for unrealizing device vCPU. emiting vcpu-remove notifier to ACPI, then ACPI could send sci interrupt to OS for hot-remove vcpu. Signed-off-by: Chen Fan --- hw/i386/pc.c | 30 -- qom/cpu.c| 12 2 files changed,

[Qemu-devel] [RFC qom-cpu v4 00/10] i386: add cpu hot remove support

2013-10-09 Thread Chen Fan
Via implementing ACPI standard methods _EJ0 in bios, after Guest OS hot remove one vCPU, it is able to send a signal to QEMU, then QEMU could notify the assigned vCPU of exiting. meanwhile, and intruduce the QOM command 'cpu-del' to remove vCPU from QEMU itself. this work is based on Andreas Färb

[Qemu-devel] [RFC qom-cpu v4 09/10] piix4: implement function cpu_status_write() for vcpu ejection

2013-10-09 Thread Chen Fan
When OS eject a vcpu (like: echo 1 > /sys/bus/acpi/devices/LNXCPUXX/eject), it will call acpi EJ0 method, the firmware will write the new cpumap, QEMU will know which vcpu need to be ejected. Signed-off-by: Chen Fan --- hw/acpi/piix4.c | 37 - 1 file changed,

[Qemu-devel] [RFC qom-cpu v4 05/10] qmp: add 'cpu-del' command support

2013-10-09 Thread Chen Fan
Signed-off-by: Chen Fan --- hw/i386/pc.c | 6 ++ hw/i386/pc_piix.c| 3 ++- include/hw/boards.h | 2 ++ include/hw/i386/pc.h | 1 + qapi-schema.json | 12 qmp-commands.hx | 23 +++ qmp.c| 9 + 7 files changed,

[Qemu-devel] [RFC qom-cpu v4 10/10] cpus: reclaim allocated vCPU objects

2013-10-09 Thread Chen Fan
After ACPI get a signal to eject a vCPU, then it will notify the vCPU thread to exit in KVM, and the vCPU must be removed from CPU list, before the vCPU really removed, there will release the all related vCPU objects. Signed-off-by: Chen Fan --- cpus.c | 46

[Qemu-devel] [RFC qom-cpu v4 07/10] qom cpu: add UNPLUG cpu notifier support

2013-10-09 Thread Chen Fan
Move struct HotplugEventType from file piix4.c to file qom/cpu.c, and add struct CPUNotifier for supporting UNPLUG cpu notifier. Signed-off-by: Chen Fan --- hw/acpi/piix4.c | 8 ++-- include/qom/cpu.h | 10 ++ qom/cpu.c | 6 +- 3 files changed, 17 insertions(+), 7 del

Re: [Qemu-devel] [PATCH] qcow2: Free preallocated zero clusters

2013-10-09 Thread Max Reitz
On 2013-10-09 11:44, Kevin Wolf wrote: Am 09.10.2013 um 10:44 hat Max Reitz geschrieben: In qcow2_free_any_clusters, preallocated zero clusters should be freed just as normal clusters are. Signed-off-by: Max Reitz Thanks, applied to the block branch. Do you have a test case that would cause

Re: [Qemu-devel] [PATCH 0/3] qcow2: Small error path fixes for snapshot writing

2013-10-09 Thread Kevin Wolf
Am 09.10.2013 um 10:51 hat Max Reitz geschrieben: > Errors in qcow2_write_snapshots should always go down the error path. If > this path is taken, the newly allocated snapshot table clusters are > abandoned and should thus be freed. > > Furthermore, we should safeguard against a possible future in

[Qemu-devel] [PATCH 0/2] aio: add aio_context_acquire() and aio_context_release()

2013-10-09 Thread Stefan Hajnoczi
aio_context_acquire() and aio_context_release() make it possible for multiple threads to safely operate on a shared AioContext. This is a prerequisite for using the block layer outside the QEMU global mutex. Imagine that a dataplane thread is performing I/O on behalf of the guest when the user is

[Qemu-devel] [PATCH 1/2] rfifolock: add recursive FIFO lock

2013-10-09 Thread Stefan Hajnoczi
QemuMutex does not guarantee fairness and cannot be acquired recursively: Fairness means each locker gets a turn and the scheduler cannot cause starvation. Recursive locking is useful for composition, it allows a sequence of locking operations to be invoked atomically by acquiring the lock around

[Qemu-devel] [PATCH 2/2] aio: add aio_context_acquire() and aio_context_release()

2013-10-09 Thread Stefan Hajnoczi
It can be useful to run an AioContext from a thread which normally does not "own" the AioContext. For example, request draining can be implemented by acquiring the AioContext and looping aio_poll() until all requests have been completed. The following pattern should work: /* Event loop thread

Re: [Qemu-devel] [PATCHv6] block/get_block_status: avoid redundant callouts on raw devices

2013-10-09 Thread Kevin Wolf
Am 08.10.2013 um 20:11 hat Eric Blake geschrieben: > On 10/08/2013 06:43 AM, Peter Lieven wrote: > > if a raw device like an iscsi target or host device is used > > the current implementation makes a second call out to get > > the block status of bs->file. > > > > Signed-off-by: Peter Lieven > >

Re: [Qemu-devel] [PATCH 1/2] rfifolock: add recursive FIFO lock

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 11:55, Stefan Hajnoczi ha scritto: > +/* Take a ticket */ > +unsigned int ticket = r->tail++; > + > +if (r->nesting > 0) { > +if (qemu_thread_is_self(&r->owner_thread)) { > +r->tail--; /* put ticket back, we're nesting */ > +} else { ticket is

[Qemu-devel] [PATCH] qemu-iotests: Discard preallocated zero clusters

2013-10-09 Thread Max Reitz
Add a new test case for discarding preallocated zero clusters; doing this should not result in any leaks. Signed-off-by: Max Reitz --- Follow-up to: - qcow2: Free preallocated zero clusters --- tests/qemu-iotests/066 | 63 ++ tests/qemu-iotests/06

Re: [Qemu-devel] [PATCH 0/2] aio: add aio_context_acquire() and aio_context_release()

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 11:55, Stefan Hajnoczi ha scritto: > aio_context_acquire() and aio_context_release() make it possible for multiple > threads to safely operate on a shared AioContext. This is a prerequisite for > using the block layer outside the QEMU global mutex. > > Imagine that a dataplane threa

Re: [Qemu-devel] [PATCH 0/6] Configure metadata overlap checks at runtime

2013-10-09 Thread Max Reitz
On 2013-09-20 10:37, Max Reitz wrote: This series changes the way of selecting what metadata overlap checks to perform from (currently) using a macro to using a variable contained in BDRVQcowState which can be configured at runtime through several command line options. Although this does not see

Re: [Qemu-devel] [PATCH V4] block: Add BlockDriver.bdrv_check_ext_snapshot.

2013-10-09 Thread Kevin Wolf
Am 02.10.2013 um 17:30 hat Max Reitz geschrieben: > On 2013-10-02 14:33, Benoît Canet wrote: > >This field is used by blkverify to disable external snapshots creation. > >I will also be used by block filters like quorum to disable external > >snapshots > >creation. > > > >Signed-off-by: Benoit Can

[Qemu-devel] [PULL 2/5] cpu-exec: Also reload CPUClass *cc after longjmp return in cpu_exec()

2013-10-09 Thread Andreas Färber
From: Juergen Lock Local variable CPUClass *cc needs to be reloaded after return from longjmp, too. (This fixes a mips-softmmu crash observed on FreeBSD when QEMU is built with clang.) Reported-by: Dimitry Andric Signed-off-by: Juergen Lock Signed-off-by: Andreas Färber --- cpu-exec.c | 4 +

[Qemu-devel] [PULL 4/5] cpu: Move cpu_copy() into linux-user

2013-10-09 Thread Andreas Färber
It is only used there and is deemed very fragile if not incorrect in its current memcpy() form. Moving it into linux-user will allow to move parts into target_cpu.h headers and only copy what the ABI mandates. Signed-off-by: Andreas Färber --- exec.c| 32 -

[Qemu-devel] [PULL 0/5] QOM CPUState patch queue 2013-10-09

2013-10-09 Thread Andreas Färber
Hello Anthony, This is my current QOM CPU patch queue. Please pull. Thanks, Andreas Cc: Anthony Liguori Cc: Eduardo Habkost Cc: Igor Mammedov Cc: Jason J. Herne Cc: Juergen Lock The following changes since commit a684f3cf9b9b9c3cb82be87aafc463de8974610c: Merge remote-tracking branch 'k

[Qemu-devel] [PULL 5/5] cpu: Drop cpu_model_str from CPU_COMMON

2013-10-09 Thread Andreas Färber
Since this is only read in cpu_copy() and linux-user has a global cpu_model, drop the field from generic code. Signed-off-by: Andreas Färber --- include/exec/cpu-defs.h | 2 -- linux-user/main.c | 4 ++-- target-alpha/cpu.c | 4 target-arm/helper.c | 3 --- ta

[Qemu-devel] [PULL 1/5] target-i386: Set model=6 on qemu64 & qemu32 CPU models

2013-10-09 Thread Andreas Färber
From: Eduardo Habkost There's no Intel CPU with family=6,model=2, and Linux and Windows guests disable SEP when seeing that combination due to Pentium Pro erratum #82. In addition to just having SEP ignored by guests, Skype (and maybe other applications) runs sysenter directly without passing th

[Qemu-devel] [PULL 3/5] cputlb: Remove dead function tlb_update_dirty()

2013-10-09 Thread Andreas Färber
From: liguang Signed-off-by: liguang Reviewed-by: Paolo Bonzini Signed-off-by: Andreas Färber --- cputlb.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/cputlb.c b/cputlb.c index 19ecf60..fff0afb 100644 --- a/cputlb.c +++ b/cputlb.c @@ -169,21 +169,6 @@ static inline ram

Re: [Qemu-devel] [PATCH 1/7] usb: remove old usb-host code

2013-10-09 Thread Jan Kiszka
On 2013-10-07 09:16, Gerd Hoffmann wrote: > On Mi, 2013-10-02 at 15:14 +0200, Jan Kiszka wrote: >> On 2013-09-19 11:34, Gerd Hoffmann wrote: >>> The usb-host code has been rewritten for qemu 1.5 to use libusb, >>> the old code has been left in as temporary fallback. Now we are >>> two releases fur

Re: [Qemu-devel] [PATCH] qemu-iotests: Discard preallocated zero clusters

2013-10-09 Thread Kevin Wolf
Am 09.10.2013 um 12:07 hat Max Reitz geschrieben: > Add a new test case for discarding preallocated zero clusters; doing > this should not result in any leaks. > > Signed-off-by: Max Reitz > --- > Follow-up to: > - qcow2: Free preallocated zero clusters Thanks, applied to the block branch. Kev

Re: [Qemu-devel] [PATCH 1/2] rfifolock: add recursive FIFO lock

2013-10-09 Thread Stefan Hajnoczi
On Wed, Oct 09, 2013 at 12:05:43PM +0200, Paolo Bonzini wrote: > Il 09/10/2013 11:55, Stefan Hajnoczi ha scritto: > > +/* Take a ticket */ > > +unsigned int ticket = r->tail++; > > + > > +if (r->nesting > 0) { > > +if (qemu_thread_is_self(&r->owner_thread)) { > > +r-

[Qemu-devel] [RFC 00/28] bitmap handling optimization

2013-10-09 Thread Juan Quintela
Hi This series split the dirty bitmap (8 bits per page, only three used) into 3 individual bitmaps. Once the conversion is done, operations are handled by bitmap operations, not bit by bit. - *_DIRTY_FLAG flags are gone, now we use memory.h DIRTY_MEMORY_* everywhere. - We set/reset each flag

[Qemu-devel] [PATCH 06/28] exec: create function to get a single dirty bit

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- exec.c | 3 ++- include/exec/memory-internal.h | 6 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index adbcef0..07b625f 100644 --- a/exec.c +++ b/exec.c @@ -1447,9 +1447,10 @@ found: static void notd

[Qemu-devel] [PATCH 03/28] memory: cpu_physical_memory_set_dirty_range() return void

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory.c b/memory.c index 5a10fd0..1485871 100644 --- a/memory.c +++ b/memory.c @@ -1182,7 +1182,7 @@ void memory_region_set_dirty(MemoryRegion *mr, hwaddr addr,

[Qemu-devel] [PATCH 02/28] memory: cpu_physical_memory_set_dirty_flags() result is never used

2013-10-09 Thread Juan Quintela
So return void. Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index d0e0633..c71a5e6 100644 --- a/include/exec/memory-internal.h +++ b/include

[Qemu-devel] [PATCH 04/28] exec: use accessor function to know if memory is dirty

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 26681ce..adbcef0 100644 --- a/exec.c +++ b/exec.c @@ -1470,7 +1470,7 @@ static void notdirty_mem_write(void *opaque, hwaddr ram_addr, cpu_physical_memory_set_dir

[Qemu-devel] [PATCH 01/28] Move prototypes to memory.h

2013-10-09 Thread Juan Quintela
As the comment says, it should only be used on "core" memory files. Signed-off-by: Juan Quintela --- include/exec/cpu-common.h | 4 include/exec/memory.h | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index

[Qemu-devel] [PATCH 09/28] memory: all users of cpu_physical_memory_get_dirty used only one flag

2013-10-09 Thread Juan Quintela
So cpu_physical_memory_get_dirty_flags is not needed anymore Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index eefe501..b72c14a 100644

[Qemu-devel] [PATCH 11/28] memory: cpu_physical_memory_set_dirty_range() allways dirty all flags

2013-10-09 Thread Juan Quintela
So remove the flag argument and do it directly. After this change, there is nothing else using cpu_physical_memory_set_dirty_flags() so remove it. Signed-off-by: Juan Quintela --- exec.c | 2 +- include/exec/memory-internal.h | 11 ++- memory.c

[Qemu-devel] [PATCH 16/28] memory: only resize dirty bitmap when memory size increases

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- exec.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/exec.c b/exec.c index 4f8f8a2..f037473 100644 --- a/exec.c +++ b/exec.c @@ -1116,6 +1116,9 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,

[Qemu-devel] [PATCH 12/28] memory: cpu_physical_memory_mask_dirty_range() allways clear a single flag

2013-10-09 Thread Juan Quintela
Document it Signed-off-by: Juan Quintela --- exec.c | 4 ++-- include/exec/memory-internal.h | 12 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/exec.c b/exec.c index b1b4da2..f7691a0 100644 --- a/exec.c +++ b/exec.c @@ -678,7 +678,7 @@ stat

[Qemu-devel] [PATCH 18/28] bitmap: Add bitmap_zero_extend operation

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/qemu/bitmap.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h index 308bbb7..53f5f1f 100644 --- a/include/qemu/bitmap.h +++ b/include/qemu/bitmap.h @@ -219,4 +219,13 @@ unsigned long bitmap_find_ne

[Qemu-devel] [PATCH 23/28] memory: make cpu_physical_memory_get_dirty() the main function

2013-10-09 Thread Juan Quintela
And make cpu_physical_memory_get_dirty_flag() to use it. It used to be the other way around. Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/include/exec/memory-internal.h b

[Qemu-devel] [PATCH 17/28] memory: cpu_physical_memory_clear_dirty_flag() result is never used

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index e08ac42..3f885a6 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-inte

[Qemu-devel] [PATCH 22/28] memory: unfold cpu_physical_memory_set_dirty_flag()

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 5fc4eb6..e56f43b 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory

[Qemu-devel] [PATCH 27/28] memory: cpu_physical_memory_set_dirty_range() now uses bitmap operations

2013-10-09 Thread Juan Quintela
We were setting a range of bits, so use bitmap_set(). Note: xen has always been wrong, and should have used start insntead of addr from the beggining. Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH 28/28] memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operations

2013-10-09 Thread Juan Quintela
We were clearing a range of bits, so use bitmap_set(). Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 2f704e8..d46570e 100644 ---

[Qemu-devel] [PATCH 25/28] memory: s/mask/clear/ cpu_physical_memory_mask_dirty_range

2013-10-09 Thread Juan Quintela
Now all functions use the same wording that bitops/bitmap operations Signed-off-by: Juan Quintela --- exec.c | 2 +- include/exec/memory-internal.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index 6fd83c9..fcdcc56 100644 ---

Re: [Qemu-devel] [PATCH 0/2] aio: add aio_context_acquire() and aio_context_release()

2013-10-09 Thread Stefan Hajnoczi
On Wed, Oct 09, 2013 at 12:16:47PM +0200, Paolo Bonzini wrote: > Il 09/10/2013 11:55, Stefan Hajnoczi ha scritto: > > aio_context_acquire() and aio_context_release() make it possible for > > multiple > > threads to safely operate on a shared AioContext. This is a prerequisite > > for > > using t

Re: [Qemu-devel] [PATCH 1/2] rfifolock: add recursive FIFO lock

2013-10-09 Thread Paolo Bonzini
Il 09/10/2013 13:26, Stefan Hajnoczi ha scritto: > On Wed, Oct 09, 2013 at 12:05:43PM +0200, Paolo Bonzini wrote: >> Il 09/10/2013 11:55, Stefan Hajnoczi ha scritto: >>> +/* Take a ticket */ >>> +unsigned int ticket = r->tail++; >>> + >>> +if (r->nesting > 0) { >>> +if (qemu_thr

Re: [Qemu-devel] [PATCH 1/7] usb: remove old usb-host code

2013-10-09 Thread Gerd Hoffmann
Hi, > >> Only very recent distros fulfill the need of >= 1.0.13, so you naturally > >> fall back to this code. I just realized that even the factory build of > >> OpenSUSE is still on libusb-1.0.9. Current Ubuntu versions are on 1.0.12 > >> at best. Didn't check others so far. > > > > Ouch. Th

[Qemu-devel] [PATCH 21/28] memory: unfold cpu_physical_memory_set_dirty() in its only user

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index d6d3537..5fc4eb6 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/mem

[Qemu-devel] [PATCH 15/28] memory: make sure that client is always inside range

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 4 1 file changed, 4 insertions(+) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 3947caa..e08ac42 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @@ -43,6

Re: [Qemu-devel] [PATCH v2 2/4] Curling: cmdline interface.

2013-10-09 Thread Eric Blake
[your emailer munged the reply, making it a bit hard to read. Are you set for plain-text-only mail to the list?] On 10/09/2013 12:49 AM, junqing.w...@cs2c.com.cn wrote: > >> +++ b/hmp.c >>> @@ -1213,10 +1213,11 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) >>> int detach = qdict_ge

Re: [Qemu-devel] [PATCH] ahci: set ahci mode on reset

2013-10-09 Thread Kevin Wolf
Am 28.09.2013 um 23:09 hat Michael S. Tsirkin geschrieben: > ATM we set AHCI mode on 1st GHC write. > Spec says we should set it on reset. > > Signed-off-by: Michael S. Tsirkin Thanks, applied to the block branch. Kevin

[Qemu-devel] [PATCH 19/28] memory: split dirty bitmap into three

2013-10-09 Thread Juan Quintela
After all the previous patches, spliting the bitmap gets direct. ToDo: Why can't i include "exec/memory.h" into cpu-all.h? This is the reason that I have duplicated DIRTY_MEMORY_NUM. ToDo2: current bitmaps have one int as index, this limit us to 8TB RAM guest, Should we move to long

[Qemu-devel] [RFC] map 64-bit PCI devices after all possible RAM

2013-10-09 Thread Igor Mammedov
I'm posting it to get an oppinion on one of possible approaches on where to map a hotplug memory. This patch assumes that a space for hotplug memory is located right after RamSizeOver4G region and QEMU will provide romfile to specify where it ends so that BIOS could know from what base to start 64

[Qemu-devel] [PATCH 13/28] memory: use DIRTY_MEMORY_* instead of *_DIRTY_FLAG

2013-10-09 Thread Juan Quintela
Instead of the bitmap, we use the bitmap number. Once done this, we change all names from dirty_flag to memory regions naming of client. Signed-off-by: Juan Quintela --- cputlb.c | 4 ++-- exec.c | 18 +- include/exec/memory-interna

[Qemu-devel] [PATCH 24/28] memory: cpu_physical_memory_get_dirty() is used as returning a bool

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index f66d2ce..de8f279 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/m

[Qemu-devel] [PATCH 05/28] memory: create function to set a single dirty bit

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- cputlb.c | 2 +- include/exec/memory-internal.h | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cputlb.c b/cputlb.c index 19ecf60..3aaa016 100644 --- a/cputlb.c +++ b/cputlb.c @@ -137,7 +137,7 @@ void tlb_protect_cod

[Qemu-devel] [PATCH] qcow2: Add missing space in error message

2013-10-09 Thread Max Reitz
The error message in qcow2_downgrade about an unsupported refcount order is missing a space. This patch adds it. Signed-off-by: Max Reitz --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index d59ecbd..1385f92 100644 --- a/block/

[Qemu-devel] [PATCH 10/28] memory: set single dirty flags when possible

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- exec.c | 7 --- include/exec/memory-internal.h | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index b9f2825..0fd9c58 100644 --- a/exec.c +++ b/exec.c @@ -1887,7 +1887,8 @@ static void invalidate

[Qemu-devel] [PATCH 08/28] exec: simplify notdirty_mem_write()

2013-10-09 Thread Juan Quintela
We don't need to make special things for CODE, just set the other two bits Signed-off-by: Juan Quintela --- exec.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index 07b625f..b9f2825 100644 --- a/exec.c +++ b/exec.c @@ -1447,12 +1447,8 @@ found: st

[Qemu-devel] [PATCH 07/28] memory: make cpu_physical_memory_is_dirty return bool

2013-10-09 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/exec/memory-internal.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 9cd2f53..eefe501 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-i

[Qemu-devel] [PATCH] qcow2: Remove wrong metadata overlap check

2013-10-09 Thread Max Reitz
In qcow2_write_compressed, if the compression fails, a normal cluster is written to disk. This is done through bdrv_write on the qcow2 BDS itself (using the guest offset), thus it is wrong to do a metadata overlap check before. Signed-off-by: Max Reitz --- block/qcow2.c | 8 1 file chan

[Qemu-devel] [PATCH] qcow2: Fix snapshot restoration in snapshot_create

2013-10-09 Thread Max Reitz
If the new snapshot table could not be written in qcow2_snapshot_create, the old snapshot table has to be restored in memory and the new one released. This should include restoration of the old snapshot count as well, which is added by this patch. Signed-off-by: Max Reitz --- block/qcow2-snapsho

[Qemu-devel] [PATCH] qcow2: Use better type for numerical snapshot ID

2013-10-09 Thread Max Reitz
When trying to find a new snapshot ID, the existing ones are converted to integers using strtoul. This function returns an unsigned long, therefore its result should be saved in an unsigned long as well. Signed-off-by: Max Reitz --- block/qcow2-snapshot.c | 5 +++-- 1 file changed, 3 insertions(

Re: [Qemu-devel] problems with 1G hugepages and linux 3.12-rc3

2013-10-09 Thread Gleb Natapov
Copying Andrea, On Sun, Oct 06, 2013 at 02:47:41AM +0200, andy123 wrote: > Hi, > > as the subject states, I have some problems with 1G hugepages with > qemu(-vfio-git) on Linux 3.12-rc3. > > I start qemu like this, for example: > "/usr/bin/qemu-system-x86_64 -enable-kvm -m 1024 -mem-path /dev/h

  1   2   >