Re: [Qemu-devel] [PATCH v2 00/38] Delay destruction of memory regions to instance_finalize

2013-09-16 Thread Wenchao Xia
于 2013/9/3 20:32, Paolo Bonzini 写道: > QOM splits the destruction of a device in two phases: > > - unrealize, also known as "exit" from qdev times, should isolate > the device from the guest. After unrealize returns, the guest > should not be able to issue new requests. > > - instance_finalize

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Fam Zheng
On Tue, 09/17 07:33, Alex Bligh wrote: > > On 17 Sep 2013, at 06:55, Fam Zheng wrote: > > >>> > >>> I think I'd just have one flat list > >>> of modules to load and ditch these MODULE_LOAD_ enums. > >> > >> Question is how to deal with qemu vs. qemu-img then. qemu needs > >> everything an

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Alex Bligh
On 17 Sep 2013, at 06:55, Fam Zheng wrote: >>> >>> I think I'd just have one flat list >>> of modules to load and ditch these MODULE_LOAD_ enums. >> >> Question is how to deal with qemu vs. qemu-img then. qemu needs >> everything and qemu-img needs the block drivers only (and loading >> s

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Fam Zheng
On Mon, 09/16 14:36, Gerd Hoffmann wrote: > On Mo, 2013-09-16 at 12:05 +0100, Daniel P. Berrange wrote: > > On Mon, Sep 16, 2013 at 02:50:24PM +0800, Fam Zheng wrote: > > > Added three types of modules: > > > > > > typedef enum { > > > MODULE_LOAD_BLOCK = 0, > > > MODULE_LOAD_U

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Richard Henderson
On 09/16/2013 06:29 PM, Fam Zheng wrote: >> Link spice-qemu.char.so against spice-core.so. The DT_NEEDED entry will be >> recorded, and ld.so will do the right thing. >> >> Anything else sounds way too much like Not Invented Here. >> > How to do the symbol checking as above if spice-core.so is aut

[Qemu-devel] [PATCH V13 01/13] NUMA: move numa related code to new file numa.c

2013-09-16 Thread Wanlong Gao
Signed-off-by: Wanlong Gao --- Makefile.target | 2 +- cpus.c | 14 include/sysemu/cpus.h | 1 - include/sysemu/sysemu.h | 3 + numa.c | 182 vl.c| 139 +---

[Qemu-devel] [PATCH V13 04/13] NUMA: convert -numa option to use OptsVisitor

2013-09-16 Thread Wanlong Gao
Signed-off-by: Wanlong Gao --- include/sysemu/sysemu.h | 3 +- numa.c | 148 +++- qapi-schema.json| 30 ++ vl.c| 11 +++- 4 files changed, 114 insertions(+), 78 deletions(-) diff --git a/include/

[Qemu-devel] [PATCH V13 13/13] NUMA: convert hmp command info_numa to use qmp command query_numa

2013-09-16 Thread Wanlong Gao
Reviewed-by: Luiz Capitulino Signed-off-by: Wanlong Gao --- hmp.c | 54 ++ hmp.h | 1 + monitor.c | 21 + 3 files changed, 56 insertions(+), 20 deletions(-) diff --git a/hmp.c b/hmp.c index 84990d7..3efc1ac 100644

[Qemu-devel] [PATCH V13 06/13] NUMA: add "-numa mem," options

2013-09-16 Thread Wanlong Gao
Add "-numa mem," option like following as Paolo suggested: -numa mem,nodeid=0,size=1G This new option will make later coming memory hotplug better. We will use the new options to specify nodes memory info, and just remain "-numa node,mem=xx" as legacy. Reviewed-by: Laszlo Ersek Signed-off-

[Qemu-devel] [PATCH V13 11/13] NUMA: add hmp command set-mem-policy

2013-09-16 Thread Wanlong Gao
Add hmp command set-mem-policy to set host memory policy for a guest NUMA node. Then we can also set node's memory policy using the monitor command like: (qemu) set-mem-policy 0 policy=membind,relative=false,host-nodes=0-1 Signed-off-by: Wanlong Gao --- hmp-commands.hx | 28 +

[Qemu-devel] [PATCH V13 00/13] Add support for binding guest numa nodes to host numa nodes

2013-09-16 Thread Wanlong Gao
As you know, QEMU can't direct it's memory allocation now, this may cause guest cross node access performance regression. And, the worse thing is that if PCI-passthrough is used, direct-attached-device uses DMA transfer between device and qemu process. All pages of the guest will be pinned by get_u

[Qemu-devel] [PATCH V13 07/13] NUMA: expand MAX_NODES from 64 to 128

2013-09-16 Thread Wanlong Gao
libnuma choosed 128 for MAX_NODES, so we follow libnuma here. Signed-off-by: Wanlong Gao --- include/sysemu/sysemu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 58c728c..12529a1 100644 --- a/include/sysemu/sysemu.h +

[Qemu-devel] [PATCH V13 08/13] NUMA: parse guest numa nodes memory policy

2013-09-16 Thread Wanlong Gao
The memory policy setting format is like: policy={default|membind|interleave|preferred}[,relative=true],host-nodes=N-N And we are adding this setting as a suboption of "-numa mem,", the memory policy then can be set like following: -numa node,nodeid=0,cpus=0 \ -numa node,nodeid=1,cpus=1

[Qemu-devel] [PATCH V13 09/13] NUMA: set guest numa nodes memory policy

2013-09-16 Thread Wanlong Gao
Set the guest numa nodes memory policies using the mbind(2) system call node by node. After this patch, we are able to set guest nodes memory policies through the QEMU options, this arms to solve the guest cross nodes memory access performance issue. And as you all know, if PCI-passthrough is used,

[Qemu-devel] [PATCH V13 05/13] NUMA: introduce NumaMemOptions

2013-09-16 Thread Wanlong Gao
Signed-off-by: Wanlong Gao --- qapi-schema.json | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index ca31ca6..950d0f5 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3848,7 +3848,8 @@ ## { 'union': 'NumaOption

[Qemu-devel] [PATCH V13 12/13] NUMA: add qmp command query-numa

2013-09-16 Thread Wanlong Gao
Add qmp command query-numa to show guest NUMA information. Reviewed-by: Luiz Capitulino Signed-off-by: Wanlong Gao --- numa.c | 65 qapi-schema.json | 36 +++ qmp-commands.hx | 49 +++

[Qemu-devel] [PATCH V13 10/13] NUMA: add qmp command set-mem-policy to set memory policy for NUMA node

2013-09-16 Thread Wanlong Gao
This QMP command allows user set guest node's memory policy through the QMP protocol. The qmp-shell command is like: set-mem-policy nodeid=0 policy=membind relative=true host-nodes=0-1 Reviewed-by: Luiz Capitulino Signed-off-by: Wanlong Gao --- numa.c | 66

[Qemu-devel] [PATCH V13 03/13] NUMA: Add numa_info structure to contain numa nodes info

2013-09-16 Thread Wanlong Gao
Add the numa_info structure to contain the numa nodes memory, VCPUs information and the future added numa nodes host memory policies. Reviewed-by: Eduardo Habkost Signed-off-by: Andre Przywara Signed-off-by: Wanlong Gao --- hw/i386/pc.c| 4 ++-- include/sysemu/sysemu.h | 8 ++

[Qemu-devel] [PATCH V13 02/13] NUMA: check if the total numa memory size is equal to ram_size

2013-09-16 Thread Wanlong Gao
If the total number of the assigned numa nodes memory is not equal to the assigned ram size, it will write the wrong data to ACPI talb, then the guest will ignore the wrong ACPI table and recognize all memory to one node. It's buggy, we should check it to ensure that we write the right data to ACPI

Re: [Qemu-devel] [RFC PATCH 0/8] Remove stub mon-protocol-event for block

2013-09-16 Thread Wenchao Xia
于 2013/9/16 18:02, Paolo Bonzini 写道: Il 16/09/2013 06:59, Wenchao Xia ha scritto: 于 2013/9/12 17:31, Paolo Bonzini 写道: Il 12/09/2013 11:15, Wenchao Xia ha scritto: This series will remove the usage of symbols of mon-protocol-event in qemu-img, qemu-nbd and qemu-io, in short remove the connetio

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Fam Zheng
On Mon, 09/16 15:31, Richard Henderson wrote: > On 09/16/2013 04:46 AM, Fam Zheng wrote: > > On Mon, 09/16 13:33, Paolo Bonzini wrote: > >> Il 16/09/2013 13:29, Fam Zheng ha scritto: > >>> An idea for single .so file: > >>> - before loads a .so, an empty initializer list is created. > >>> -

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Fam Zheng
On Mon, 09/16 15:16, Richard Henderson wrote: > On 09/16/2013 02:28 AM, Fam Zheng wrote: > > What's the disadvantage of this, and why are separate lists better? > > You're performing useless work, making the code more confusing in the process. > How can it not be better to have separate lists? >

[Qemu-devel] [Bug 1042561] Re: Guest has no "xsave" feature with parameter "-cpu qemu64, +xsave" in qemu command line.

2013-09-16 Thread Eduardo Habkost
xsave needs level >= 13, and qemu64 has level=4. Try "-cpu qemu64,+xsave,+avx,level=13". -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1042561 Title: Guest has no "xsave" feature with parameter "-c

[Qemu-devel] Page size for computing bandwidth during migration

2013-09-16 Thread Krishnamurthy Jambur
Hi, The migration.c migration thread uses "bandwidth = transferred_bytes / time_spent;" for computing the bandwidth. Since we are dealing with pages during migration why can't this be changed to some thing like               page_rate = norm_mig_pages_transferred() - page_count;              page

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Richard Henderson
On 09/16/2013 04:00 AM, Paolo Bonzini wrote: > We could also have a huge web of shared objects like LibreOffice has > (spice-core.so depending on qemu-system.so, and spice.mo depending on > spice-core.so), but I'm not really suggesting that... I am. Although in our case I wouldn't expect the web

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Richard Henderson
On 09/16/2013 04:46 AM, Fam Zheng wrote: > On Mon, 09/16 13:33, Paolo Bonzini wrote: >> Il 16/09/2013 13:29, Fam Zheng ha scritto: >>> An idea for single .so file: >>> - before loads a .so, an empty initializer list is created. >>> - module_init adds a __attribute__((constructor)) function,

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Richard Henderson
On 09/16/2013 02:28 AM, Fam Zheng wrote: > What's the disadvantage of this, and why are separate lists better? You're performing useless work, making the code more confusing in the process. How can it not be better to have separate lists? r~

Re: [Qemu-devel] cpufreq and QEMU guests

2013-09-16 Thread Benoît Canet
Le Monday 16 Sep 2013 à 18:58:40 (+0300), Gleb Natapov a écrit : > On Mon, Sep 16, 2013 at 05:46:04PM +0200, Benoît Canet wrote: > > Le Monday 16 Sep 2013 à 18:32:39 (+0300), Gleb Natapov a écrit : > > > On Mon, Sep 16, 2013 at 05:05:45PM +0200, Benoît Canet wrote: > > > > Le Monday 16 Sep 2013 à 0

Re: [Qemu-devel] [PATCH v4 08/33] tcg-aarch64: Introduce tcg_fmt_Rdnm and tcg_fmt_Rdnm_lsl

2013-09-16 Thread Richard Henderson
On 09/16/2013 08:32 AM, Richard Henderson wrote: > Nor do we provide ASR or ROR shifts; should we provide those too? Please > think > about what situations in which those would be useful. Also think about the > one > operation at a time nature of TCG. > > My guess is that, beyond the one expli

Re: [Qemu-devel] [Question] memory: AddressSpace backed by single IO MemoryRegion

2013-09-16 Thread Marcel Apfelbaum
On Mon, 2013-09-16 at 19:18 +0200, Paolo Bonzini wrote: > Il 16/09/2013 19:11, Marcel Apfelbaum ha scritto: > >> > memory_region_init_io(my_reg, owner, my_ops, my_obj, "my region", > >> > INT64_MAX); > > This is 2^63-1, not 2^64-1. You need UINT64_MAX here. Ooops! Thanks a lot and sorry for

Re: [Qemu-devel] [Question] memory: AddressSpace backed by single IO MemoryRegion

2013-09-16 Thread Marcel Apfelbaum
On Mon, 2013-09-16 at 16:52 +0200, Paolo Bonzini wrote: > Il 16/09/2013 16:48, Marcel Apfelbaum ha scritto: > > Hi all, > > > > I have an AddressSpace backed by a single MemoryRegion which is > > initiated using memory_region_init_io (has ops). > > Once I enable it, I get an assertion: > > exe

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 18:51, Michael S. Tsirkin ha scritto: >> > >> > We can have "make check" run QEMU once for each board, which would trap >> > things that will always break at runtime such as a misspelled property. >> > Similarly, we could have tests that try to instantiate every device, >> > even if

Re: [Qemu-devel] [PATCH v2 00/38] Delay destruction of memory regions to instance_finalize

2013-09-16 Thread Paolo Bonzini
Il 03/09/2013 14:32, Paolo Bonzini ha scritto: > QOM splits the destruction of a device in two phases: > > - unrealize, also known as "exit" from qdev times, should isolate > the device from the guest. After unrealize returns, the guest > should not be able to issue new requests. > > - insta

Re: [Qemu-devel] [Question] memory: AddressSpace backed by single IO MemoryRegion

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 19:11, Marcel Apfelbaum ha scritto: >> > memory_region_init_io(my_reg, owner, my_ops, my_obj, "my region", >> > INT64_MAX); This is 2^63-1, not 2^64-1. You need UINT64_MAX here. Paolo >> > memory_region_set_enabled(my_reg, false); >> > address_space_init(my_as, my_reg

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 06:07:33PM +0200, Paolo Bonzini wrote: > Il 16/09/2013 18:01, Michael S. Tsirkin ha scritto: > > On Mon, Sep 16, 2013 at 05:56:56PM +0200, Paolo Bonzini wrote: > >> Il 16/09/2013 17:48, Michael S. Tsirkin ha scritto: > >>> http://sweng.the-davies.net/Home/rustys-api-design-m

Re: [Qemu-devel] [PATCH 7/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Implement hot_add_cpu hook

2013-09-16 Thread Andreas Färber
Am 13.09.2013 17:29, schrieb Jason J. Herne: > On 09/05/2013 08:38 AM, Andreas Färber wrote: >> Am 01.08.2013 16:12, schrieb Jason J. Herne: >>> From: "Jason J. Herne" >>> >>> Implement hot_add_cpu for S390 to allow hot plugging of cpus. >>> >>> Signed-off-by: Jason J. Herne >>> --- >>> hw/s390

Re: [Qemu-devel] [Bug 1224444] Re: virtio-serial loses writes when used over virtio-mmio

2013-09-16 Thread Laszlo Ersek (Red Hat)
On 09/16/13 16:39, Richard Jones wrote: >> Is this a socket that libguestfs pre-creates on the host-side? > > Yes it is: > https://github.com/libguestfs/libguestfs/blob/master/src/launch-direct.c#L208 > > You mention a scenario that might cause this. But that appears to be > when the socket is o

Re: [Qemu-devel] [PATCH v1 4/4] target-arm: Add CP15 VBAR support

2013-09-16 Thread Sebastian Huber
Hello, it would be really nice to get the CP15 VBAR support integrated. This allows unit test suites of single address space real-time systems to catch NULL pointer read/write access for example. The ARM documentation says that this is a banked register that is only present in an implementa

Re: [Qemu-devel] [PATCH v4 04/33] tcg-aarch64: Hoist common argument loads in tcg_out_op

2013-09-16 Thread Richard Henderson
On 09/16/2013 12:42 AM, Claudio Fontana wrote: >> +/* Hoist the loads of the most common arguments. */ >> > +TCGArg a0 = args[0]; >> > +TCGArg a1 = args[1]; >> > +TCGArg a2 = args[2]; >> > +int c2 = const_args[2]; >> > + > Either all or none (add c0, c1), I would expect the com

Re: [Qemu-devel] [PATCH v2 0/6] pci: keep window properties up to date

2013-09-16 Thread Igor Mammedov
On Sun, 15 Sep 2013 11:46:36 +0300 "Michael S. Tsirkin" wrote: > w32/w64 properties that we report in QOM are > currently static, but this is wrong: > guest firmware can select its own windows: > optimal placement for w64 is guest-dependent, further, > for Q35, w32 is affected by the MCFG base an

Re: [Qemu-devel] [PATCH v4 11/33] tcg-aarch64: Handle constant operands to add, sub, and compare

2013-09-16 Thread Richard Henderson
On 09/16/2013 02:02 AM, Claudio Fontana wrote: >> -static inline void tcg_out_cmp(TCGContext *s, TCGType ext, TCGReg rn, >> - TCGReg rm) >> +static void tcg_out_cmp(TCGContext *s, TCGType ext, TCGReg a, >> +tcg_target_long b, bool const_b) >> {

Re: [Qemu-devel] cpufreq and QEMU guests

2013-09-16 Thread Benoît Canet
Le Monday 16 Sep 2013 à 18:32:39 (+0300), Gleb Natapov a écrit : > On Mon, Sep 16, 2013 at 05:05:45PM +0200, Benoît Canet wrote: > > Le Monday 16 Sep 2013 à 09:39:10 (-0500), Alexander Graf a écrit : > > > > > > > > > Am 16.09.2013 um 07:15 schrieb Benoît Canet : > > > > > > > > > > > Hello, >

Re: [Qemu-devel] [Question] memory: AddressSpace backed by single IO MemoryRegion

2013-09-16 Thread Marcel Apfelbaum
On Monday, September 16, 2013, Paolo Bonzini wrote: > Il 16/09/2013 16:48, Marcel Apfelbaum ha scritto: >> Hi all, >> >> I have an AddressSpace backed by a single MemoryRegion which yis >> initiated using memoy_region_init_io (has ops). >> Once I enable it, I get an assertion: >>     exec.c:806: r

Re: [Qemu-devel] [PATCH v4 22/33] tcg-aarch64: Use MOVN in tcg_out_movi

2013-09-16 Thread Richard Henderson
On 09/16/2013 02:16 AM, Claudio Fontana wrote: > I agree in general with the approach "lets see if it is more convenient to > start with MOVN". > The existing implementation is, although not easy, leaner. > Can we make it a little this one a little bit leaner? This sentence is not well formed. W

Re: [Qemu-devel] [PATCH v4 08/33] tcg-aarch64: Introduce tcg_fmt_Rdnm and tcg_fmt_Rdnm_lsl

2013-09-16 Thread Richard Henderson
On 09/16/2013 01:41 AM, Claudio Fontana wrote: > On 14.09.2013 23:54, Richard Henderson wrote: >> Now that we've converted opcode fields to pre-shifted insns, we >> can merge the implementation of arithmetic and shift insns. >> >> Simplify the left/right shift parameter to just the left shift >> ne

Re: [Qemu-devel] [PATCH] qdev-monitor: Avoid exiting when hot-plugging two devices with the same bootindex value

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 05:34:04PM +0200, Paolo Bonzini wrote: > Il 16/09/2013 17:14, Michael S. Tsirkin ha scritto: > > On Mon, Sep 16, 2013 at 12:11:35PM +0200, Paolo Bonzini wrote: > >> Il 16/09/2013 11:54, Marcel Apfelbaum ha scritto: > >>> On Thu, 2013-09-12 at 13:04 +0200, Markus Armbruster w

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 05:24:46PM +0200, Andreas Färber wrote: > Am 16.09.2013 14:33, schrieb Michael S. Tsirkin: > > On Mon, Sep 16, 2013 at 08:32:13AM +0200, Andreas Färber wrote: > >> Am 15.09.2013 19:23, schrieb Michael S. Tsirkin: > >>> Add a helper macro for adding read-only properties, that

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 05:56:56PM +0200, Paolo Bonzini wrote: > Il 16/09/2013 17:48, Michael S. Tsirkin ha scritto: > > http://sweng.the-davies.net/Home/rustys-api-design-manifesto > > > > Even then: it will be at best > > "5. Do it right or it will always break at runtime." > > > > We need to s

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 18:01, Michael S. Tsirkin ha scritto: > On Mon, Sep 16, 2013 at 05:56:56PM +0200, Paolo Bonzini wrote: >> Il 16/09/2013 17:48, Michael S. Tsirkin ha scritto: >>> http://sweng.the-davies.net/Home/rustys-api-design-manifesto >>> >>> Even then: it will be at best >>> "5. Do it right or i

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 17:24, Andreas Färber ha scritto: >> > >> > Shouldn't we have a constant for the "realized" string? > That's a two-sided sword: We actually shouldn't be setting realized = > true manually but once on machine init - in that case we wouldn't > strictly need a constant. > > I pushed to

Re: [Qemu-devel] cpufreq and QEMU guests

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 05:46:04PM +0200, Benoît Canet wrote: > Le Monday 16 Sep 2013 à 18:32:39 (+0300), Gleb Natapov a écrit : > > On Mon, Sep 16, 2013 at 05:05:45PM +0200, Benoît Canet wrote: > > > Le Monday 16 Sep 2013 à 09:39:10 (-0500), Alexander Graf a écrit : > > > > > > > > > > > > Am 16

Re: [Qemu-devel] cpufreq and QEMU guests

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 05:05:45PM +0200, Benoît Canet wrote: > Le Monday 16 Sep 2013 à 09:39:10 (-0500), Alexander Graf a écrit : > > > > > > Am 16.09.2013 um 07:15 schrieb Benoît Canet : > > > > > > > > Hello, > > > > > > I know a cloud provider worried about the fact that the /proc/cpuinfo

Re: [Qemu-devel] [PATCH] qdev-monitor: Avoid exiting when hot-plugging two devices with the same bootindex value

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 17:14, Michael S. Tsirkin ha scritto: > On Mon, Sep 16, 2013 at 12:11:35PM +0200, Paolo Bonzini wrote: >> Il 16/09/2013 11:54, Marcel Apfelbaum ha scritto: >>> On Thu, 2013-09-12 at 13:04 +0200, Markus Armbruster wrote: Marcel Apfelbaum writes: > On Thu, 2013-09-12 at 1

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 17:48, Michael S. Tsirkin ha scritto: > http://sweng.the-davies.net/Home/rustys-api-design-manifesto > > Even then: it will be at best > "5. Do it right or it will always break at runtime." > > We need to switch to APIs at > "9. The compiler/linker won't let you get it wrong." We d

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 08:32:13AM +0200, Andreas Färber wrote: > Am 15.09.2013 19:23, schrieb Michael S. Tsirkin: > > Add a helper macro for adding read-only properties, that works in the > > common case where the value is a constant. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > > > I'

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Andreas Färber
Am 16.09.2013 14:33, schrieb Michael S. Tsirkin: > On Mon, Sep 16, 2013 at 08:32:13AM +0200, Andreas Färber wrote: >> Am 15.09.2013 19:23, schrieb Michael S. Tsirkin: >>> Add a helper macro for adding read-only properties, that works in the >>> common case where the value is a constant. >>> >>> Sig

Re: [Qemu-devel] [PATCH] xhci: Fix number of streams allocated when using streams

2013-09-16 Thread Gerd Hoffmann
On Mo, 2013-09-16 at 17:04 +0200, Hans de Goede wrote: > According to the xhci spec the total number of streams is > 2 ^ (MaxPStreams + 1), and this is also how the Linux xhci driver > uses this field. Added to usb patch queue. thanks, Gerd

Re: [Qemu-devel] [PATCH v4 03/33] tcg-aarch64: Don't handle mov/movi in tcg_out_op

2013-09-16 Thread Richard Henderson
On 09/16/2013 12:45 AM, Claudio Fontana wrote: >> > default: >> > -tcg_abort(); /* opcode not implemented */ >> > +/* Opcode not implemented. */ >> > +tcg_abort(); >> > } >> > } > This change above seems unnecessary. Perhaps qemu doesn't have the same "comments

Re: [Qemu-devel] Q35 FreeBSD install status

2013-09-16 Thread Gerd Hoffmann
On Mo, 2013-09-16 at 12:57 +, Bret Ketchum wrote: > Tried that - looks like FreeBSD expects to use MSI for AHCI devices which > does not appear to be supported in q35. It is supported and linux has no problems using ahci with msi. Given that e1000 seems to have interrupt problems too I w

Re: [Qemu-devel] [PATCH 1/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Define New SCLP Codes

2013-09-16 Thread Alexander Graf
Am 16.09.2013 um 09:29 schrieb "Jason J. Herne" : > On 09/16/2013 09:53 AM, Christian Borntraeger wrote: >> On 05/09/13 13:25, Alexander Graf wrote: >>> >>> On 01.08.2013, at 16:12, Jason J. Herne wrote: >>> From: "Jason J. Herne" Define new SCLP codes to improve code readabil

Re: [Qemu-devel] [Question] memory: AddressSpace backed by single IO MemoryRegion

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 16:48, Marcel Apfelbaum ha scritto: > Hi all, > > I have an AddressSpace backed by a single MemoryRegion which is > initiated using memory_region_init_io (has ops). > Once I enable it, I get an assertion: > exec.c:806: register_subpage: Assertion `existing->mr->subpage || > exis

Re: [Qemu-devel] [PATCH] qdev-monitor: Avoid exiting when hot-plugging two devices with the same bootindex value

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 12:11:35PM +0200, Paolo Bonzini wrote: > Il 16/09/2013 11:54, Marcel Apfelbaum ha scritto: > > On Thu, 2013-09-12 at 13:04 +0200, Markus Armbruster wrote: > >> Marcel Apfelbaum writes: > >> > >>> On Thu, 2013-09-12 at 11:43 +0200, Markus Armbruster wrote: > Paolo Bonzi

Re: [Qemu-devel] [PATCH v5 0/5] Do not set SO_REUSEADDR on Windows

2013-09-16 Thread Sebastian Ottlik
On 16.09.2013 16:55, Paolo Bonzini wrote: Il 16/09/2013 16:23, Sebastian Ottlik ha scritto: - Added the silent flag to socket_set_fast_reuse controlling error reporting One location where SO_REUSEADDR was set would report errors if setting the option failed. Keeping the reporting code ther

Re: [Qemu-devel] [PATCH v5 0/5] Do not set SO_REUSEADDR on Windows

2013-09-16 Thread Paolo Bonzini
Il 16/09/2013 16:23, Sebastian Ottlik ha scritto: > - Added the silent flag to socket_set_fast_reuse controlling error reporting > One location where SO_REUSEADDR was set would report errors if setting the > option failed. Keeping the reporting code there would be somewhat unclean, > so > I

[Qemu-devel] [Bug 1224444] Re: virtio-serial loses writes when used over virtio-mmio

2013-09-16 Thread Richard Jones
> Is this a socket that libguestfs pre-creates on the host-side? Yes it is: https://github.com/libguestfs/libguestfs/blob/master/src/launch-direct.c#L208 You mention a scenario that might cause this. But that appears to be when the socket is opened. Note that the guest did send 4 bytes successf

[Qemu-devel] [Question] memory: AddressSpace backed by single IO MemoryRegion

2013-09-16 Thread Marcel Apfelbaum
Hi all, I have an AddressSpace backed by a single MemoryRegion which is initiated using memory_region_init_io (has ops). Once I enable it, I get an assertion: exec.c:806: register_subpage: Assertion `existing->mr->subpage || existing->mr == &io_mem_unassigned' failed. Here is the pseudo-cod

Re: [Qemu-devel] [PATCH 1/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Define New SCLP Codes

2013-09-16 Thread Jason J. Herne
On 09/16/2013 10:43 AM, Alexander Graf wrote: Am 16.09.2013 um 09:29 schrieb "Jason J. Herne" : On 09/16/2013 09:53 AM, Christian Borntraeger wrote: On 05/09/13 13:25, Alexander Graf wrote: On 01.08.2013, at 16:12, Jason J. Herne wrote: From: "Jason J. Herne" Define new SCLP codes to i

Re: [Qemu-devel] [PATCH v4 06/33] tcg-aarch64: Merge enum aarch64_srr_opc with AArch64Insn

2013-09-16 Thread Richard Henderson
On 09/16/2013 12:56 AM, Claudio Fontana wrote: >> > case INDEX_op_shl_i64: >> > case INDEX_op_shl_i32: >> > -if (c2) {/* LSL / UBFM Wd, Wn, (32 - m) */ >> > +if (c2) { >> > tcg_out_shl(s, ext, a0, a1, a2); >> > -} else {/* LSL / LSL

[Qemu-devel] [PATCH] xhci: Fix number of streams allocated when using streams

2013-09-16 Thread Hans de Goede
According to the xhci spec the total number of streams is 2 ^ (MaxPStreams + 1), and this is also how the Linux xhci driver uses this field. Signed-off-by: Hans de Goede --- hw/usb/hcd-xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.

Re: [Qemu-devel] cpufreq and QEMU guests

2013-09-16 Thread Benoît Canet
Le Monday 16 Sep 2013 à 09:39:10 (-0500), Alexander Graf a écrit : > > > Am 16.09.2013 um 07:15 schrieb Benoît Canet : > > > > > Hello, > > > > I know a cloud provider worried about the fact that the /proc/cpuinfo of his > > guests give a bogus frequency to his customer. > > > > QEMU and the

Re: [Qemu-devel] cpufreq and QEMU guests

2013-09-16 Thread Alexander Graf
Am 16.09.2013 um 07:15 schrieb Benoît Canet : > > Hello, > > I know a cloud provider worried about the fact that the /proc/cpuinfo of his > guests give a bogus frequency to his customer. > > QEMU and the guests kernel currently have no way to reflect the host frequency > changes to the guests

Re: [Qemu-devel] [Bug 1224444] [NEW] virtio-serial loses writes when used over virtio-mmio

2013-09-16 Thread Laszlo Ersek (Red Hat)
On 09/12/13 14:04, Richard Jones wrote: > + -chardev socket,path=/home/rjones/d/libguestfs/tmp/libguestfsLa9dE2/guestfsd.sock,id=channel0 \ Is this a socket that libguestfs pre-creates on the host-side? > the socket is never added to any poll/ppoll syscall, so it's no > wonder that qemu neve

Re: [Qemu-devel] [PATCH 1/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Define New SCLP Codes

2013-09-16 Thread Jason J. Herne
On 09/16/2013 09:53 AM, Christian Borntraeger wrote: On 05/09/13 13:25, Alexander Graf wrote: On 01.08.2013, at 16:12, Jason J. Herne wrote: From: "Jason J. Herne" Define new SCLP codes to improve code readability. Signed-off-by: Jason J. Herne --- hw/s390x/sclp.c |2 +- includ

[Qemu-devel] [PATCH v5 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR

2013-09-16 Thread Sebastian Ottlik
If a socket is closed it remains in TIME_WAIT state for some time. On operating systems using BSD sockets the endpoint of the socket may not be reused while in this state unless SO_REUSEADDR was set on the socket. On windows on the other hand the default behaviour is to allow reuse (i.e. identical

[Qemu-devel] [PATCH v5 2/5] gdbstub: call socket_set_fast_reuse instead of setting SO_REUSEADDR

2013-09-16 Thread Sebastian Ottlik
SO_REUSEADDR should be avoided on Windows but is desired on other operating systems. So instead of setting it we call socket_set_fast_reuse that will result in the appropriate behaviour on all operating systems. Signed-off-by: Sebastian Ottlik --- gdbstub.c |6 ++ 1 file changed, 2 inser

[Qemu-devel] [PATCH v5 4/5] slirp: call socket_set_fast_reuse instead of setting SO_REUSEADDR

2013-09-16 Thread Sebastian Ottlik
SO_REUSEADDR should be avoided on Windows but is desired on other operating systems. So instead of setting it we call socket_set_fast_reuse that will result in the appropriate behaviour on all operating systems. Signed-off-by: Sebastian Ottlik --- slirp/misc.c |3 +-- slirp/socket.c |

[Qemu-devel] [PATCH v5 5/5] util: call socket_set_fast_reuse instead of setting SO_REUSEADDR

2013-09-16 Thread Sebastian Ottlik
SO_REUSEADDR should be avoided on Windows but is desired on other operating systems. So instead of setting it we call socket_set_fast_reuse that will result in the appropriate behaviour on all operating systems. Signed-off-by: Sebastian Ottlik --- util/qemu-sockets.c |6 +++--- 1 file change

[Qemu-devel] [PATCH v5 3/5] net: call socket_set_fast_reuse instead of setting SO_REUSEADDR

2013-09-16 Thread Sebastian Ottlik
SO_REUSEADDR should be avoided on Windows but is desired on other operating systems. So instead of setting it we call socket_set_fast_reuse that will result in the appropriate behaviour on all operating systems. An exception to this rule are multicast sockets where it is sensible to have multiple

[Qemu-devel] [PATCH v5 0/5] Do not set SO_REUSEADDR on Windows

2013-09-16 Thread Sebastian Ottlik
This patchset disables most uses of SO_REUSEADDR on Windows and replaces it with calls to the new function socket_set_fast_reuse. On Windows systems the default behaviour is equivalent to SO_REUSEADDR on other operating systems. SO_REUSEADDR can still be set but results in undesired behaviour in mo

Re: [Qemu-devel] [PATCH v2 1/4] target-ppc: Fill in OpenFirmware names for some PowerPCCPU families

2013-09-16 Thread Alexey Kardashevskiy
On 09/10/2013 02:15 PM, Alexey Kardashevskiy wrote: > On 08/16/2013 08:35 AM, Andreas Färber wrote: >> Set the expected values for POWER7, POWER7+, POWER8 and POWER5+. >> Note that POWER5+ and POWER7+ are intentionally lacking the '+', so the >> lack of a POWER7P family constitutes no problem. >> >

Re: [Qemu-devel] [PATCH v4 2/5] gdbstub: call socket_set_fast_reuse instead of setting SO_REUSEADDR

2013-09-16 Thread Sebastian Ottlik
On 16.09.2013 16:03, Eric Blake wrote: On 09/16/2013 02:25 AM, Sebastian Ottlik wrote: SO_REUSEADDR should be avoided on Windows but is desired on other operating systems. So instead of setting it we call socket_set_fast_reuse that will result in the appropriate behaviour on all operating system

Re: [Qemu-devel] [PATCH v4 3/5] net: call socket_set_fast_reuse instead of setting SO_REUSEADDR

2013-09-16 Thread Eric Blake
On 09/16/2013 02:25 AM, Sebastian Ottlik wrote: > SO_REUSEADDR should be avoided on Windows but is desired on other operating > systems. So instead of setting it we call socket_set_fast_reuse that will > result > in the appropriate behaviour on all operating systems. > > An exception to this rule

Re: [Qemu-devel] [PATCH v4 2/5] gdbstub: call socket_set_fast_reuse instead of setting SO_REUSEADDR

2013-09-16 Thread Eric Blake
On 09/16/2013 02:25 AM, Sebastian Ottlik wrote: > SO_REUSEADDR should be avoided on Windows but is desired on other operating > systems. So instead of setting it we call socket_set_fast_reuse that will > result > in the appropriate behaviour on all operating systems. > > Signed-off-by: Sebastian

Re: [Qemu-devel] [PATCH 1/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Define New SCLP Codes

2013-09-16 Thread Christian Borntraeger
On 05/09/13 13:25, Alexander Graf wrote: > > On 01.08.2013, at 16:12, Jason J. Herne wrote: > >> From: "Jason J. Herne" >> >> Define new SCLP codes to improve code readability. >> >> Signed-off-by: Jason J. Herne >> --- >> hw/s390x/sclp.c |2 +- >> include/hw/s390x/sclp.h |8

Re: [Qemu-devel] [PATCH RESEND] ivshmem: allow the sharing of hugepages

2013-09-16 Thread Damien Millescamps
On 09/16/2013 03:07 PM, Daniel P. Berrange wrote: > IME this kind of auto-magical fallback behaviour is a bad idea. If we > want to support non-SHM files for the ivshmem device, then it should > be done with an explicit command line property. eg where we currently > have a 'size' and 'shm' property

[Qemu-devel] [PATCH v3] ivshmem: allow the sharing of hugepages

2013-09-16 Thread Damien Millescamps
This patch permits to share memory areas that do not specifically belong to /dev/shm. In such case, the file must be already present when launching qemu. A new parameter 'file' has been added to specify the file to use. A use case for this patch is sharing huge pages available through a hugetlbfs

[Qemu-devel] [PATCH] linux-user: Emulate SOCK_CLOEXEC/NONBLOCK if unavailable

2013-09-16 Thread edgar . iglesias
From: "Edgar E. Iglesias" If the host lacks support for SOCK_CLOEXEC or SOCK_NONBLOCK, try to emulate them with fcntl() FD_CLOEXEC and O_NONBLOCK. Signed-off-by: Edgar E. Iglesias --- linux-user/syscall.c | 48 +--- 1 file changed, 45 insertions(+)

Re: [Qemu-devel] [PATCH RESEND] ivshmem: allow the sharing of hugepages

2013-09-16 Thread Daniel P. Berrange
On Mon, Sep 16, 2013 at 02:56:15PM +0200, Damien Millescamps wrote: > This patch permits to share memory areas that do not specifically belong to > /dev/shm. In such case, the file must be already present when launching qemu. > > A use case for this patch is sharing huge pages available through a

Re: [Qemu-devel] Q35 FreeBSD install status

2013-09-16 Thread Bret Ketchum
Qemu says the IRQ is 11: Bus 0, device 3, function 0: Ethernet controller: PCI device 8086:100e IRQ 11. BAR0: 32 bit memory at 0xfebc [0xfebd]. BAR1: I/O at 0xc040 [0xc07f]. BAR6: 32 bit memory at 0x [0x0003fffe]. id "" Free

Re: [Qemu-devel] Q35 FreeBSD install status

2013-09-16 Thread Bret Ketchum
Syslog suggests the interface is brought down then up but no interrupt at the irq assigned. Need to enable more debug and make sure the interrupt is wired properly. -Original Message- From: Michael S. Tsirkin [mailto:m...@redhat.com] Sent: Monday, September 16, 2013 7:36 AM To: Bre

Re: [Qemu-devel] Q35 FreeBSD install status

2013-09-16 Thread Bret Ketchum
Tried that - looks like FreeBSD expects to use MSI for AHCI devices which does not appear to be supported in q35. -Original Message- From: Gerd Hoffmann [mailto:kra...@redhat.com] Sent: Monday, September 16, 2013 7:55 AM To: Bret Ketchum Cc: Qemu-devel@nongnu.org; m...@redhat.com Su

[Qemu-devel] [PATCH RESEND] ivshmem: allow the sharing of hugepages

2013-09-16 Thread Damien Millescamps
This patch permits to share memory areas that do not specifically belong to /dev/shm. In such case, the file must be already present when launching qemu. A use case for this patch is sharing huge pages available through a hugetlbfs mountpoint. Signed-off-by: Damien Millescamps --- docs/specs/iv

Re: [Qemu-devel] Q35 FreeBSD install status

2013-09-16 Thread Gerd Hoffmann
On Mo, 2013-09-16 at 12:28 +, Bret Ketchum wrote: > As a workaround until I can uncover the qemu/FreeBSD AHCI/SATA issue, I > simply create a legacy IDE to hang the CD and HD from: > > -device piix4-ide \ No need for that one. > -drive > if=none,file=/home/ehv/images/FreeBSD-9

[Qemu-devel] [PATCH v2 0/0] integrator: fix Linux boot failure by emulating dbg

2013-09-16 Thread alex . bennee
Hi, I've applied the review comments from Peter. Alex.

[Qemu-devel] [PATCH v2 1/1] integrator: fix Linux boot failure by emulating dbg

2013-09-16 Thread alex . bennee
From: Alex Bennée Commit 9b8c69243 broke the ability to boot the kernel as the value returned by unassigned_mem_read returned non-zero and left the kernel looping forever waiting for it to change (see integrator_led_set in the kernel code). Relying on a varying implementation detail is incorrect

Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading

2013-09-16 Thread Gerd Hoffmann
On Mo, 2013-09-16 at 12:05 +0100, Daniel P. Berrange wrote: > On Mon, Sep 16, 2013 at 02:50:24PM +0800, Fam Zheng wrote: > > Added three types of modules: > > > > typedef enum { > > MODULE_LOAD_BLOCK = 0, > > MODULE_LOAD_UI, > > MODULE_LOAD_NET, > > MODULE_LOAD_

Re: [Qemu-devel] Q35 FreeBSD install status

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 12:28:41PM +, Bret Ketchum wrote: > > As a workaround until I can uncover the qemu/FreeBSD AHCI/SATA issue, I > simply create a legacy IDE to hang the CD and HD from: > > -device piix4-ide \ > -drive > if=none,file=/home/ehv/images/FreeBSD-9.1-RELEASE-am

Re: [Qemu-devel] [PATCH] qom: helper macro for adding read-only properties

2013-09-16 Thread Michael S. Tsirkin
On Mon, Sep 16, 2013 at 08:32:13AM +0200, Andreas Färber wrote: > Am 15.09.2013 19:23, schrieb Michael S. Tsirkin: > > Add a helper macro for adding read-only properties, that works in the > > common case where the value is a constant. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > > > I'

Re: [Qemu-devel] Q35 FreeBSD install status

2013-09-16 Thread Bret Ketchum
As a workaround until I can uncover the qemu/FreeBSD AHCI/SATA issue, I simply create a legacy IDE to hang the CD and HD from: -device piix4-ide \ -drive if=none,file=/home/ehv/images/FreeBSD-9.1-RELEASE-amd64-dvd1.iso,id=drive-ide0-0-0 \ -device ide-cd,bus=ide.0,drive=drive-i

[Qemu-devel] cpufreq and QEMU guests

2013-09-16 Thread Benoît Canet
Hello, I know a cloud provider worried about the fact that the /proc/cpuinfo of his guests give a bogus frequency to his customer. QEMU and the guests kernel currently have no way to reflect the host frequency changes to the guests. The customer compute intensive application then read this info

  1   2   >