Re: [Qemu-devel] [RFC PATCH V7 16/19] translate-all: introduces tb_flush_safe.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: + +void tb_flush_safe(CPUState *cpu) +{ +#if 0 /* !MTTCG */ +tb_flush(cpu); +#else +async_run_safe_work_on_cpu(cpu, tb_flush_work, cpu); +#endif /* MTTCG */ +} + I think this can use first_cpu unconditionally; tb_flush only

[Qemu-devel] [PATCH 3/3] firmware: fw_cfg: create directory hierarchy for fw_cfg file names

2015-08-10 Thread Gabriel L. Somlo
From: Gabriel Somlo so...@cmu.edu Each fw_cfg entry of type file has an associated 56-char, nul-terminated ASCII string which represents its name. While the fw_cfg device doesn't itself impose any specific naming convention, QEMU developers have traditionally used path name semantics (i.e.

Re: [Qemu-devel] virtio 1 issues

2015-08-10 Thread Cornelia Huck
On Mon, 10 Aug 2015 14:22:07 +0800 Jason Wang jasow...@redhat.com wrote: On 08/07/2015 06:49 PM, Cornelia Huck wrote: On Fri, 07 Aug 2015 13:07:35 +0800 Jason Wang jasow...@redhat.com wrote: 2. ring resizing is broken - it actually has a comment: /* TODO: need a way to put

[Qemu-devel] [RFC PATCH V7 18/19] mttcg: signal the associated cpu anyway.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com We might have a race here. If current_cpu is about to be set then cpu_exit won't be called and we don't exit TCG. This was probably an issue with old implementation as well. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com --- cpus.c | 3

Re: [Qemu-devel] [PATCH v13 18/19] i.MX: Add qtest support for I2C device emulator.

2015-08-10 Thread Jean-Christophe DUBOIS
Le 07/08/2015 15:05, Peter Maydell a écrit : On 16 July 2015 at 22:21, Jean-Christophe Dubois j...@tribudubois.net wrote: This is using a ds1338 RTC chip on the I2C bus. This RTC chip is not present on the real 3DS PDK board. Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net 'make

Re: [Qemu-devel] [PATCH v13 13/19] i.MX: KZM now uses the standalone i.MX31 SOC support

2015-08-10 Thread Peter Maydell
On 10 August 2015 at 17:15, Jean-Christophe DUBOIS j...@tribudubois.net wrote: Le 07/08/2015 15:45, Peter Maydell a écrit : On 16 July 2015 at 22:21, Jean-Christophe Dubois j...@tribudubois.net wrote: memory_region_allocate_system_memory() needs to be called once and only once by a board

[Qemu-devel] [RFC PATCH V7 13/19] add a callback when tb_invalidate is called.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com Instead of doing the jump cache invalidation directly in tb_invalidate delay it after the exit so we don't have an other CPU trying to execute the code being invalidated. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com --- translate-all.c

Re: [Qemu-devel] [RFC PATCH V7 14/19] cpu: introduce tlb_flush*_all.

2015-08-10 Thread Peter Maydell
On 10 August 2015 at 16:54, Paolo Bonzini pbonz...@redhat.com wrote: On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: KONRAD Frederic fred.kon...@greensocs.com Some architectures allow to flush the tlb of other VCPUs. This is not a problem when we have only one thread for all

[Qemu-devel] [PATCH 0/3] SysFS driver for QEMU firmware config device (fw_cfg)

2015-08-10 Thread Gabriel L. Somlo
From: Gabriel Somlo so...@cmu.edu This patch set makes QEMU fw_cfg blobs available for viewing (read-only) via SysFS. Several different architectures supported by QEMU are set up with a firmware configuration (fw_cfg) device, used to pass configuration blobs into the guest by the host running

Re: [Qemu-devel] [RFC PATCH V7 07/19] protect TBContext with tb_lock.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 18:36, Paolo Bonzini wrote: diff --git a/target-arm/translate.c b/target-arm/translate.c index 69ac18c..960c75e 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -11166,6 +11166,8 @@ static inline void gen_intermediate_code_internal(ARMCPU *cpu,

[Qemu-devel] [RFC PATCH V7 15/19] arm: use tlb_flush*_all

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This just use the new mechanism to ensure that each VCPU thread flush its own VCPU. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com --- target-arm/helper.c | 45 +++-- 1 file changed, 7

[Qemu-devel] [RFC PATCH V7 11/19] tcg: switch on multithread.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This switches on multithread. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com Changes V5 - V6: * make qemu_cpu_kick calling qemu_cpu_kick_thread in case of TCG. --- cpus.c | 93

[Qemu-devel] [RFC PATCH V7 06/19] add support for spin lock on POSIX systems exclusively

2015-08-10 Thread fred . konrad
From: Guillaume Delbergue guillaume.delber...@greensocs.com WARNING: spin lock is currently not implemented on WIN32 Signed-off-by: Guillaume Delbergue guillaume.delber...@greensocs.com --- include/qemu/thread-posix.h | 4 include/qemu/thread-win32.h | 4 include/qemu/thread.h

[Qemu-devel] [RFC PATCH V7 03/19] cpus: introduce async_run_safe_work_on_cpu.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com We already had async_run_on_cpu but we need all VCPUs outside their execution loop to execute some tb_flush/invalidate task: async_run_on_cpu_safe schedule a work on a VCPU but the work start when no more VCPUs are executing code. When a safe work

[Qemu-devel] [RFC PATCH V7 10/19] cpu: remove exit_request global.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This removes exit_request global and adds a variable in CPUState for this. Only the flag for the first cpu is used for the moment as we are still with one TCG thread. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com --- cpu-exec.c | 15

Re: [Qemu-devel] [RFC PATCH V7 01/19] cpus: protect queued_work_* with work_mutex.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:26, fred.kon...@greensocs.com wrote: +qemu_mutex_lock(cpu-work_mutex); while ((wi = cpu-queued_work_first)) { cpu-queued_work_first = wi-next; +qemu_mutex_unlock(cpu-work_mutex); wi-func(wi-data); +

Re: [Qemu-devel] [RFC PATCH V7 01/19] cpus: protect queued_work_* with work_mutex.

2015-08-10 Thread Frederic Konrad
On 10/08/2015 17:59, Paolo Bonzini wrote: On 10/08/2015 17:26, fred.kon...@greensocs.com wrote: +qemu_mutex_lock(cpu-work_mutex); while ((wi = cpu-queued_work_first)) { cpu-queued_work_first = wi-next; +qemu_mutex_unlock(cpu-work_mutex);

Re: [Qemu-devel] [PATCH v13 00/19] i.MX: Add i.MX25 support through the PDK evaluation board

2015-08-10 Thread Jean-Christophe DUBOIS
Le 07/08/2015 16:13, Peter Maydell a écrit : On 16 July 2015 at 22:21, Jean-Christophe Dubois j...@tribudubois.net wrote: This series of patches add the support for the i.MX25 processor through the Freescale PDK evaluation board. For now a limited set of devices is supported. * GPT timers

Re: [Qemu-devel] [RFC PATCH V7 13/19] add a callback when tb_invalidate is called.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: KONRAD Frederic fred.kon...@greensocs.com Instead of doing the jump cache invalidation directly in tb_invalidate delay it after the exit so we don't have an other CPU trying to execute the code being invalidated.

[Qemu-devel] [RFC PATCH V7 19/19] target-arm/psci.c: wake up sleeping CPUs (MTTCG)

2015-08-10 Thread fred . konrad
From: Alex Bennée alex.ben...@linaro.org Testing with Alexander's bare metal syncronisation tests fails in MTTCG leaving one CPU spinning forever waiting for the second CPU to wake up. We simply need to poke the halt_cond once we have processed the PSCI power on call. Tested-by: Alex Bennée

[Qemu-devel] [RFC PATCH V7 14/19] cpu: introduce tlb_flush*_all.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com Some architectures allow to flush the tlb of other VCPUs. This is not a problem when we have only one thread for all VCPUs but it definitely needs to be an asynchronous work when we are in true multithreaded work. TODO: Some test case, I fear some

[Qemu-devel] [RFC PATCH V7 16/19] translate-all: introduces tb_flush_safe.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com tb_flush is not thread safe we definitely need to exit VCPUs to do that. This introduces tb_flush_safe which just creates an async safe work which will do a tb_flush later. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com ---

Re: [Qemu-devel] [RFC PATCH V7 18/19] mttcg: signal the associated cpu anyway.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: diff --git a/cpus.c b/cpus.c index 2c5ca72..f61530c 100644 --- a/cpus.c +++ b/cpus.c @@ -674,8 +674,7 @@ static void cpu_signal(int sig) cpu_exit(current_cpu); } -/* FIXME: We might want to check if the cpu is

Re: [Qemu-devel] [RFC PATCH V7 04/19] replace spinlock by QemuMutex.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: KONRAD Frederic fred.kon...@greensocs.com spinlock is only used in two cases: * cpu-exec.c: to protect TranslationBlock * mem_helper.c: for lock helper in target-i386 (which seems broken). It's a pthread_mutex_t in

Re: [Qemu-devel] [RFC PATCH V7 08/19] tcg: remove tcg_halt_cond global variable.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: KONRAD Frederic fred.kon...@greensocs.com This removes tcg_halt_cond global variable. We need one QemuCond per virtual cpu for multithread TCG. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com --- cpus.c | 18

Re: [Qemu-devel] [RFC PATCH V7 06/19] add support for spin lock on POSIX systems exclusively

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: Guillaume Delbergue guillaume.delber...@greensocs.com WARNING: spin lock is currently not implemented on WIN32 Signed-off-by: Guillaume Delbergue guillaume.delber...@greensocs.com Should go before patch 12 (and IIUC Alvise's

Re: [Qemu-devel] [PATCH v8 3/5] Introduce irqchip type specification for KVM

2015-08-10 Thread Peter Maydell
On 10 August 2015 at 13:06, Pavel Fedin p.fe...@samsung.com wrote: This patch introduces kernel_irqchip_type member in Machine class, which is passed to kvm_arch_irqchip_create. Machine models which can use vGIC now use it in order to supply correct GIC type for KVM capability verification.

[Qemu-devel] OVMF BoF @ KVM Forum 2015

2015-08-10 Thread Laszlo Ersek
Hi. Let's do an OVMF BoF at this year's KVM Forum too. Paolo will present Securing secure boot: system management mode in KVM and Tiano Core on Thursday, August 20, in the 5:00pm - 5:30pm time slot. Right after that, the BoF section starts at 5:30pm:

[Qemu-devel] [PATCH 1/3] firmware: introduce sysfs driver for QEMU's fw_cfg device

2015-08-10 Thread Gabriel L. Somlo
From: Gabriel Somlo so...@cmu.edu Make fw_cfg entries of type file available via sysfs. Entries are listed under /sys/firmware/fw_cfg/by_select, in folders named after each entry's selector key. Filename, selector value, and size read-only attributes are included for each entry. Also, a raw

Re: [Qemu-devel] [RFC PATCH V7 07/19] protect TBContext with tb_lock.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: diff --git a/cpu-exec.c b/cpu-exec.c index f3358a9..a012e9d 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -131,6 +131,8 @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu) void cpu_loop_exit(CPUState *cpu) {

[Qemu-devel] [PATCH 2/3] kobject: export kset_find_obj() to be used from modules

2015-08-10 Thread Gabriel L. Somlo
From: Gabriel Somlo so...@cmu.edu Signed-off-by: Gabriel Somlo so...@cmu.edu --- lib/kobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kobject.c b/lib/kobject.c index 3e3a5c3..f9754a0 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -1058,3 +1058,4 @@ EXPORT_SYMBOL(kobject_del);

[Qemu-devel] [RFC PATCH V7 09/19] Drop global lock during TCG code execution

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This finally allows TCG to benefit from the iothread introduction: Drop the global mutex while running pure TCG CPU code. Reacquire the lock when entering MMIO or PIO emulation, or when leaving the TCG loop. We have to revert a few optimization for

Re: [Qemu-devel] [PATCH v13 13/19] i.MX: KZM now uses the standalone i.MX31 SOC support

2015-08-10 Thread Jean-Christophe DUBOIS
Le 07/08/2015 15:45, Peter Maydell a écrit : On 16 July 2015 at 22:21, Jean-Christophe Dubois j...@tribudubois.net wrote: Tested by booting a minimal Linux system on the emulated platform Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net --- This said: - * 0x8000-0x87ff

Re: [Qemu-devel] [RFC PATCH V7 09/19] Drop global lock during TCG code execution

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: void qemu_mutex_lock_iothread(void) { -atomic_inc(iothread_requesting_mutex); -/* In the simple case there is no need to bump the VCPU thread out of - * TCG code execution. - */ -if (!tcg_enabled() ||

Re: [Qemu-devel] [RFC PATCH V7 00/19] Multithread TCG.

2015-08-10 Thread Alex Bennée
fred.kon...@greensocs.com writes: From: KONRAD Frederic fred.kon...@greensocs.com This is the 7th round of the MTTCG patch series. It can be cloned from: g...@git.greensocs.com:fkonrad/mttcg.git branch multi_tcg_v7. I'm not seeing this yet, did you remember to push? This patch-set

Re: [Qemu-devel] [PATCH v8 1/5] Implement GIC-500 base class

2015-08-10 Thread Peter Maydell
On 10 August 2015 at 13:06, Pavel Fedin p.fe...@samsung.com wrote: From: Shlomo Pongratz shlomo.pongr...@huawei.com This class is to be used by both software and KVM implementations of GICv3 Currently it is mostly a placeholder, but in future it is supposed to hold qemu's representation of

Re: [Qemu-devel] [PATCH 2/3] kobject: export kset_find_obj() to be used from modules

2015-08-10 Thread Greg KH
On Mon, Aug 10, 2015 at 12:31:19PM -0400, Gabriel L. Somlo wrote: From: Gabriel Somlo so...@cmu.edu Signed-off-by: Gabriel Somlo so...@cmu.edu --- lib/kobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kobject.c b/lib/kobject.c index 3e3a5c3..f9754a0 100644 ---

Re: [Qemu-devel] [PATCH v13 13/19] i.MX: KZM now uses the standalone i.MX31 SOC support

2015-08-10 Thread Jean-Christophe DUBOIS
Le 10/08/2015 18:23, Peter Maydell a écrit : On 10 August 2015 at 17:15, Jean-Christophe DUBOIS j...@tribudubois.net wrote: Le 07/08/2015 15:45, Peter Maydell a écrit : On 16 July 2015 at 22:21, Jean-Christophe Dubois j...@tribudubois.net wrote: memory_region_allocate_system_memory() needs to

Re: [Qemu-devel] [PATCH v8 5/5] Add gicversion option to virt machine

2015-08-10 Thread Peter Maydell
On 10 August 2015 at 13:06, Pavel Fedin p.fe...@samsung.com wrote: Set kernel_irqchip_type according to value of the option and pass it around where necessary. Instantiate devices and fdt nodes according to the choice. max_cpus for virt machine increased to 64. GICv2 compatibility check

Re: [Qemu-devel] [PATCH v8 4/5] Initial implementation of vGICv3

2015-08-10 Thread Peter Maydell
On 10 August 2015 at 13:06, Pavel Fedin p.fe...@samsung.com wrote: Get/put routines are missing, live migration is not possible. This commit message is too terse. Otherwise Reviewed-by: Peter Maydell peter.mayd...@linaro.org thanks -- PMM

Re: [Qemu-devel] [RFC PATCH V7 19/19] target-arm/psci.c: wake up sleeping CPUs (MTTCG)

2015-08-10 Thread Alex Bennée
Paolo Bonzini pbonz...@redhat.com writes: On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: Alex Bennée alex.ben...@linaro.org Testing with Alexander's bare metal syncronisation tests fails in MTTCG leaving one CPU spinning forever waiting for the second CPU to wake up. We

Re: [Qemu-devel] [PATCH v8 2/5] Extract some reusable vGIC code

2015-08-10 Thread Peter Maydell
On 10 August 2015 at 13:06, Pavel Fedin p.fe...@samsung.com wrote: These functions are useful also for vGICv3 implementation. Make them accessible from within other modules. Actually kvm_dist_get() and kvm_dist_put() could also be made reusable, but they would require two extra parameters

Re: [Qemu-devel] [PATCH v4 07/11] qemu-log: new option -dfilter to limit output

2015-08-10 Thread Alex Bennée
Christopher Covington c...@codeaurora.org writes: Hi Alex, On 08/03/2015 05:14 AM, Alex Bennée wrote: When debugging big programs or system emulation sometimes you want both the verbosity of cpu,exec et all but don't want to generate lots of logs for unneeded stuff. This patch adds a new

Re: [Qemu-devel] [PATCH 1/3] firmware: introduce sysfs driver for QEMU's fw_cfg device

2015-08-10 Thread Greg KH
On Mon, Aug 10, 2015 at 12:31:18PM -0400, Gabriel L. Somlo wrote: From: Gabriel Somlo so...@cmu.edu Make fw_cfg entries of type file available via sysfs. Entries are listed under /sys/firmware/fw_cfg/by_select, in folders named after each entry's selector key. Filename, selector value, and

Re: [Qemu-devel] [RFC PATCH V7 07/19] protect TBContext with tb_lock.

2015-08-10 Thread Alex Bennée
Paolo Bonzini pbonz...@redhat.com writes: On 10/08/2015 18:36, Paolo Bonzini wrote: diff --git a/target-arm/translate.c b/target-arm/translate.c index 69ac18c..960c75e 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -11166,6 +11166,8 @@ static inline void

Re: [Qemu-devel] [PATCH 3/3] firmware: fw_cfg: create directory hierarchy for fw_cfg file names

2015-08-10 Thread Greg KH
On Mon, Aug 10, 2015 at 12:31:20PM -0400, Gabriel L. Somlo wrote: From: Gabriel Somlo so...@cmu.edu Each fw_cfg entry of type file has an associated 56-char, nul-terminated ASCII string which represents its name. While the fw_cfg device doesn't itself impose any specific naming convention,

Re: [Qemu-devel] [PATCH 2/3] kobject: export kset_find_obj() to be used from modules

2015-08-10 Thread Greg KH
On Mon, Aug 10, 2015 at 02:43:10PM -0400, Gabriel L. Somlo wrote: On Mon, Aug 10, 2015 at 11:33:04AM -0700, Greg KH wrote: On Mon, Aug 10, 2015 at 12:31:19PM -0400, Gabriel L. Somlo wrote: From: Gabriel Somlo so...@cmu.edu Signed-off-by: Gabriel Somlo so...@cmu.edu ---

Re: [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr

2015-08-10 Thread Frank Schreuder
Op 8/10/2015 om 3:15 PM schreef Stefan Hajnoczi: The -msg timestamp=on option prepends a timestamp to error messages. This is useful on stderr where it allows users to identify when an error was raised. Timestamps do not make sense on the monitor since error_report() is called in response to

Re: [Qemu-devel] [PATCH v4 07/11] qemu-log: new option -dfilter to limit output

2015-08-10 Thread Christopher Covington
Hi Alex, On 08/03/2015 05:14 AM, Alex Bennée wrote: When debugging big programs or system emulation sometimes you want both the verbosity of cpu,exec et all but don't want to generate lots of logs for unneeded stuff. This patch adds a new option -dfilter which allows you to specify

Re: [Qemu-devel] [RFC PATCH V7 13/19] add a callback when tb_invalidate is called.

2015-08-10 Thread Alex Bennée
Paolo Bonzini pbonz...@redhat.com writes: On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: KONRAD Frederic fred.kon...@greensocs.com Instead of doing the jump cache invalidation directly in tb_invalidate delay it after the exit so we don't have an other CPU trying to execute

Re: [Qemu-devel] [PATCH 2/3] kobject: export kset_find_obj() to be used from modules

2015-08-10 Thread Gabriel L. Somlo
On Mon, Aug 10, 2015 at 11:33:04AM -0700, Greg KH wrote: On Mon, Aug 10, 2015 at 12:31:19PM -0400, Gabriel L. Somlo wrote: From: Gabriel Somlo so...@cmu.edu Signed-off-by: Gabriel Somlo so...@cmu.edu --- lib/kobject.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [Qemu-devel] [Patch] s390x/kvm: make setting of in-kernel irq routes more efficient

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 16:02, Jens Freimann wrote: When we add new adapter routes we call kvm_irqchip_add_route() for every virtqueue and in the same step also do the KVM_SET_GSI_ROUTING ioctl. This is unnecessary costly as the interface allows us to set multiple routes in one go. Let's first add

Re: [Qemu-devel] dmidecode repository (Was: [ARM SMBIOS V1 PATCH 0/6] SMBIOS Support for ARM)

2015-08-10 Thread Laszlo Ersek
On 08/10/15 14:26, Jean Delvare wrote: Hi Laszlo, On Mon, 10 Aug 2015 13:58:31 +0200, Laszlo Ersek wrote: On 08/10/15 09:43, Jean Delvare wrote: OK, I think I came up with something that looks reasonably good: http://git.savannah.gnu.org/cgit/dmidecode.git Can anyone please check it out

[Qemu-devel] [RFC PATCH V7 07/19] protect TBContext with tb_lock.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This protects TBContext with tb_lock to make tb_* thread safe. We can still have issue with tb_flush in case of multithread TCG: An other CPU can be executing code during a flush. This can be fixed later by making all other TCG thread exiting

Re: [Qemu-devel] [RFC PATCH V7 10/19] cpu: remove exit_request global.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: { if (current_cpu) { cpu_exit(current_cpu); } -exit_request = 1; + +/* FIXME: We might want to check if the cpu is running? */ +tcg_thread_cpu-exit_request = true; } #ifdef CONFIG_LINUX @@

Re: [Qemu-devel] [RFC PATCH V7 01/19] cpus: protect queued_work_* with work_mutex.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 18:04, Frederic Konrad wrote: On 10/08/2015 17:59, Paolo Bonzini wrote: On 10/08/2015 17:26, fred.kon...@greensocs.com wrote: +qemu_mutex_lock(cpu-work_mutex); while ((wi = cpu-queued_work_first)) { cpu-queued_work_first = wi-next; +

Re: [Qemu-devel] [PATCH 1/3] firmware: introduce sysfs driver for QEMU's fw_cfg device

2015-08-10 Thread Gabriel L. Somlo
On Mon, Aug 10, 2015 at 11:30:54AM -0700, Greg KH wrote: On Mon, Aug 10, 2015 at 12:31:18PM -0400, Gabriel L. Somlo wrote: From: Gabriel Somlo so...@cmu.edu Make fw_cfg entries of type file available via sysfs. Entries are listed under /sys/firmware/fw_cfg/by_select, in folders named

Re: [Qemu-devel] QEMU 2.4 for Windows - current status

2015-08-10 Thread Stefan Weil
Am 10.08.2015 um 16:00 schrieb Paolo Bonzini: On 10/08/2015 13:39, Stefan Weil wrote: Could somebody add some notes to the 'Known issues' section of the changelog summarising the problems, please (whether it affects all Windows build environments or only some, whether this is a regression

[Qemu-devel] [RFC PATCH V7 00/19] Multithread TCG.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This is the 7th round of the MTTCG patch series. It can be cloned from: g...@git.greensocs.com:fkonrad/mttcg.git branch multi_tcg_v7. This patch-set try to address the different issues in the global picture of MTTCG, presented on the wiki. ==

[Qemu-devel] [RFC PATCH V7 05/19] remove unused spinlock.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This just removes spinlock as it is not used anymore. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com Changes V6 - V7: * Drop the checkpatch part. --- include/exec/spinlock.h | 49 - 1

[Qemu-devel] [RFC PATCH V7 01/19] cpus: protect queued_work_* with work_mutex.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This protects queued_work_* used by async_run_on_cpu, run_on_cpu and flush_queued_work with a new lock (work_mutex) to prevent multiple (concurrent) access. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com Reviewed-by: Alex Bennée

[Qemu-devel] [RFC PATCH V7 02/19] cpus: add tcg_exec_flag.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This flag indicates the state of the VCPU thread: * 0 if the VCPU is allowed to execute code. * 1 if the VCPU is currently executing code. * -1 if the VCPU is not allowed to execute code. This allows to atomically check and run safe work or

[Qemu-devel] [RFC PATCH V7 12/19] Use atomic cmpxchg to atomically check the exclusive value in a STREX

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This mechanism replaces the existing load/store exclusive mechanism which seems to be broken for multithread. It follows the intention of the existing mechanism and stores the target address and data values during a load operation and checks that

[Qemu-devel] [RFC PATCH V7 08/19] tcg: remove tcg_halt_cond global variable.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This removes tcg_halt_cond global variable. We need one QemuCond per virtual cpu for multithread TCG. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com --- cpus.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-)

[Qemu-devel] [RFC PATCH V7 04/19] replace spinlock by QemuMutex.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com spinlock is only used in two cases: * cpu-exec.c: to protect TranslationBlock * mem_helper.c: for lock helper in target-i386 (which seems broken). It's a pthread_mutex_t in user-mode so better using QemuMutex directly in this case. It allows as

[Qemu-devel] [RFC PATCH V7 17/19] translate-all: (wip) use tb_flush_safe when we can't alloc more tb.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic fred.kon...@greensocs.com This changes just the tb_flush called from tb_alloc. TODO: * changes the other tb_flush. Signed-off-by: KONRAD Frederic fred.kon...@greensocs.com --- translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [Qemu-devel] [RFC PATCH V7 14/19] cpu: introduce tlb_flush*_all.

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: KONRAD Frederic fred.kon...@greensocs.com Some architectures allow to flush the tlb of other VCPUs. This is not a problem when we have only one thread for all VCPUs but it definitely needs to be an asynchronous work when we are

Re: [Qemu-devel] [RFC PATCH V7 19/19] target-arm/psci.c: wake up sleeping CPUs (MTTCG)

2015-08-10 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: Alex Bennée alex.ben...@linaro.org Testing with Alexander's bare metal syncronisation tests fails in MTTCG leaving one CPU spinning forever waiting for the second CPU to wake up. We simply need to poke the halt_cond once we have

Re: [Qemu-devel] [PATCH 2/3] kobject: export kset_find_obj() to be used from modules

2015-08-10 Thread Gabriel L. Somlo
On Mon, Aug 10, 2015 at 11:54:00AM -0700, Greg KH wrote: On Mon, Aug 10, 2015 at 02:43:10PM -0400, Gabriel L. Somlo wrote: On Mon, Aug 10, 2015 at 11:33:04AM -0700, Greg KH wrote: On Mon, Aug 10, 2015 at 12:31:19PM -0400, Gabriel L. Somlo wrote: From: Gabriel Somlo so...@cmu.edu

[Qemu-devel] [PATCH v14 5/8] i.MX: Add SOC support for i.MX25

2015-08-10 Thread Jean-Christophe Dubois
For now we support the following devices: * CPU: ARM926 * Interrupt Controller: AVIC * CCM * UART x 5 * EPIT x 2 * GPT x 4 * FEC * I2C x 3 Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net --- Changes since v1: * not present on v1

[Qemu-devel] [PATCH v14 1/8] i.MX: Add SOC support for i.MX31

2015-08-10 Thread Jean-Christophe Dubois
For now we support the following devices: * CPU: ARM1136 * Interrupt Controller: AVIC * CCM * UART x 2 * EPIT x 2 * GPT Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net Reviewed-by: Peter Crosthwaite peter.crosthwa...@xilinx.com --- Changes since v1: * not present on v1

[Qemu-devel] [PATCH v14 2/8] i.MX: KZM now uses the standalone i.MX31 SOC support

2015-08-10 Thread Jean-Christophe Dubois
Tested by booting a minimal Linux system on the emulated platform Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net --- Changes since v1: * not present on v1 Changes since v2: * not present on v2 Changes since v3: * not present on v3 Changes since v4: * not

[Qemu-devel] [PATCH v14 0/8] i.MX: Add i.MX25 support through the PDK evaluation board

2015-08-10 Thread Jean-Christophe Dubois
This series of patches is generated against Peter Maydell GIT tree: https://git.linaro.org/people/peter.maydell/qemu-arm.git branch target-arm-post-2.4 This series of patches add the support for the i.MX25 processor through the Freescale PDK evaluation board. For now a limited set of devices

[Qemu-devel] [PATCH v14 3/8] i.MX: Add I2C controller emulator

2015-08-10 Thread Jean-Christophe Dubois
The slave mode is not implemented. Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net Reviewed-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- Changes since v1: * none Changes since v2: * use QOM cast * reworked debug printf * use CamelCase for state type *

[Qemu-devel] [PATCH v14 8/8] i.MX: Add i2C devices to i.MX31 SOC

2015-08-10 Thread Jean-Christophe Dubois
Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net --- Changes since v1: * not present on v1 Changes since v2: * not present on v2 Changes since v3: * not present on v3 Changes since v4: * not present on v4 Changes since v5: * not present on v5

[Qemu-devel] [PATCH v14 6/8] i.MX: Add the i.MX25 PDK plateform

2015-08-10 Thread Jean-Christophe Dubois
Tested by booting a minimal Linux system on the emulated platform Tested by booting the Xvisor hyprvisor on the emulated platform Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net --- Changes since v1: * Added a ds1338 I2C device for qtest purpose. Changes since v2: * none

[Qemu-devel] [PATCH v14 4/8] i.MX: Add FEC Ethernet Emulator

2015-08-10 Thread Jean-Christophe Dubois
This is based on mcf_fec.c FEC implementation for Coldfire * A generic PHY was added (borrowwed from LAN9118) * The buffer management is also modified as buffers are slightly different between Coldfire and i.MX Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net Reviewed-by: Peter

[Qemu-devel] [PATCH v14 7/8] i.MX: Add qtest support for I2C device emulator.

2015-08-10 Thread Jean-Christophe Dubois
This is using a ds1338 RTC chip on the I2C bus. This RTC chip is not present on the real 3DS PDK board. Signed-off-by: Jean-Christophe Dubois j...@tribudubois.net --- Changes since v1: * not present on v1 Changes since v2: * use a common header file for I2C regs definition Changes

[Qemu-devel] [PATCH v4 1/3] linux-headers: Add eeh.h

2015-08-10 Thread Gavin Shan
The header file was introduced by following Linux upstream commits: commit ed3e81f (powerpc/eeh: Move PE state constants around) commit ec33d36 (powerpc/eeh: Introduce eeh_pe_inject_err()) Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com --- linux-headers/asm-powerpc/eeh.h | 56

Re: [Qemu-devel] [RFC PATCH V7 00/19] Multithread TCG.

2015-08-10 Thread Frederic Konrad
On 10/08/2015 20:34, Alex Bennée wrote: fred.kon...@greensocs.com writes: From: KONRAD Frederic fred.kon...@greensocs.com This is the 7th round of the MTTCG patch series. It can be cloned from: g...@git.greensocs.com:fkonrad/mttcg.git branch multi_tcg_v7. I'm not seeing this yet, did you

[Qemu-devel] [PATCH v4 3/3] sPAPR: Support RTAS call ibm,errinjct

2015-08-10 Thread Gavin Shan
The patch supports RTAS call ibm,errinjct to allow injecting EEH errors to VFIO PCI devices. The implementation is similiar to EEH support for VFIO PCI devices: The RTAS request is captured by QEMU and routed to sPAPRPHBClass::eeh_inject_error() where the request is translated to VFIO container

[Qemu-devel] [PATCH v4 0/3] sPAPR: Support EEH Error Injection

2015-08-10 Thread Gavin Shan
The patchset depends on below Linux upstream commits: commit ed3e81f (powerpc/eeh: Move PE state constants around) commit ec33d36 (powerpc/eeh: Introduce eeh_pe_inject_err()) According to PAPR specification 2.7, there're 3 RTAS calls relevent to error injection: ibm,open-errinjct,

Re: [Qemu-devel] [PATCH v3 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-10 Thread David Gibson
On Fri, Aug 07, 2015 at 01:33:32PM +1000, Gavin Shan wrote: The patch supports RTAS calls ibm,{open,close}-errinjct to manupliate the token, which is passed to RTAS call ibm,errinjct to indicate the valid context for error injection. Each VM is permitted to have only one token at once and we

[Qemu-devel] [PATCH v4 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-10 Thread Gavin Shan
The patch supports RTAS calls ibm,{open,close}-errinjct to manupliate the token, which is passed to RTAS call ibm,errinjct to indicate the valid context for error injection. Each VM is permitted to have only one token at once and we simply have one random number for that. Signed-off-by: Gavin

Re: [Qemu-devel] [PATCH 1/3] firmware: introduce sysfs driver for QEMU's fw_cfg device

2015-08-10 Thread Greg KH
On Mon, Aug 10, 2015 at 03:02:22PM -0400, Gabriel L. Somlo wrote: Mainly, qemu's fw_cfg is a read-only device, so one wouldn't ever care to try writing anything to it. /sys/firmware/... feels like a fit because fw_cfg contains binary blobs originally meant to be used by the bios (it's how

Re: [Qemu-devel] [PATCH v4 05/11] qemu-log: Improve the exec TB execution logging

2015-08-10 Thread Christopher Covington
Hi Peter, Alex, On 08/03/2015 05:14 AM, Alex Bennée wrote: From: Peter Maydell peter.mayd...@linaro.org Improve the TB execution logging so that it is easier to identify what is happening from trace logs: * move the Trace logging of executed TBs into cpu_tb_exec() so that it is emitted

Re: [Qemu-devel] [PATCH v3 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-10 Thread Alexey Kardashevskiy
On 08/11/2015 10:57 AM, Gavin Shan wrote: On Mon, Aug 10, 2015 at 10:24:56PM +1000, David Gibson wrote: On Fri, Aug 07, 2015 at 01:33:32PM +1000, Gavin Shan wrote: The patch supports RTAS calls ibm,{open,close}-errinjct to manupliate the token, which is passed to RTAS call ibm,errinjct to

Re: [Qemu-devel] [PATCH v3 2/3] sPAPR: Support RTAS call ibm, {open, close}-errinjct

2015-08-10 Thread Gavin Shan
On Mon, Aug 10, 2015 at 10:24:56PM +1000, David Gibson wrote: On Fri, Aug 07, 2015 at 01:33:32PM +1000, Gavin Shan wrote: The patch supports RTAS calls ibm,{open,close}-errinjct to manupliate the token, which is passed to RTAS call ibm,errinjct to indicate the valid context for error injection.

[Qemu-devel] [PATCH 0/4] target-sparc: Update to use VMStateDescription

2015-08-10 Thread Peter Maydell
This patchset updates target-sparc to use VMStateDescription rather than hand-written save/load functions. (This and CRIS are the last two targets still using the old approach.) It's based on some patches from back in 2012 by Juan which I've updated, rebased and made some tweaks to. This is a

[Qemu-devel] [PATCH 1/4] vmstate: introduce CPU_DoubleU arrays

2015-08-10 Thread Peter Maydell
From: Juan Quintela quint...@redhat.com Add vmstate support for migrating arrays of CPU_DoubleU via VMSTATE_CPUDOUBLE_ARRAY. Signed-off-by: Juan Quintela quint...@redhat.com [PMM: rebased, since files have all moved since 2012; added VMSTATE_CPUDOUBLE_ARRAY_V for consistency with FLOAT64]

[Qemu-devel] [PATCH 4/4] target-sparc: Convert to VMStateDescription

2015-08-10 Thread Peter Maydell
From: Juan Quintela quint...@redhat.com Convert the SPARC CPU from cpu_load/save functions to VMStateDescription. Note that this is a migration compatibility break (which is OK as we don't try to support cross-version migration on SPARC). Signed-off-by: Juan Quintela quint...@redhat.com [PMM: *

[Qemu-devel] [PATCH 3/4] target-sparc: Don't flush TLB in cpu_load function

2015-08-10 Thread Peter Maydell
There's no need to flush the TLB in the SPARC cpu_load function: we're guaranteed to be loading state into a fresh clean configuration. Signed-off-by: Peter Maydell peter.mayd...@linaro.org --- target-sparc/machine.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target-sparc/machine.c

[Qemu-devel] [PATCH 2/4] target-sparc: Split cpu_put_psr into side-effect and no-side-effect parts

2015-08-10 Thread Peter Maydell
For inbound migration we really want to be able to set the PSR without having any side effects, but cpu_put_psr() calls cpu_check_irqs() which might try to deliver CPU interrupts. Split cpu_put_psr() into the no-side-effect and side-effect parts. This includes reordering the cpu_check_irqs() to

Re: [Qemu-devel] [PATCH for-2.5 3/6] Add new block driver interface to add/delete a BDS's child

2015-08-10 Thread Alberto Garcia
On Fri 31 Jul 2015 11:19:12 AM CEST, Wen Congyang wrote: +static const char *bdrv_get_id_or_node_name(BlockDriverState *bs) +{ +if (bs-blk) { +return blk_name(bs-blk); +} + +return bs-node_name ? bs-node_name : ; +} You don't need to add this function, you can use

Re: [Qemu-devel] [PATCH v6 03/10] netfilter: add netfilter_{add|del} commands

2015-08-10 Thread Jason Wang
On 08/07/2015 10:46 AM, Yang Hongyang wrote: add netfilter_{add|del} commands This is mostly the same with netdev_{add|del} commands. When we delete the netdev, we also delete the netfilter object attached to it, because if the netdev is removed, the filters which attached to it is

Re: [Qemu-devel] [PATCH v6 08/10] netfilter: add a netbuffer filter

2015-08-10 Thread Jason Wang
On 08/07/2015 10:46 AM, Yang Hongyang wrote: This filter is to buffer/release packets, this feature can be used when using MicroCheckpointing, or other Remus like VM FT solutions, you can also use it to simulate the network delay. It has an interval option, if supplied, this filter will

Re: [Qemu-devel] [PATCH v3 2/2] make: load only required dependency files.

2015-08-10 Thread Victor Kaplansky
On Sun, Aug 09, 2015 at 12:54:37PM +0100, Peter Maydell wrote: On 9 August 2015 at 12:39, Michael S. Tsirkin m...@redhat.com wrote: On Sun, Aug 09, 2015 at 12:39:59PM +0300, Victor Kaplansky wrote: -$(eval -include $(addsuffix *.d, $(sort $(dir $($v) +$(eval -include

Re: [Qemu-devel] [PATCH for-2.5 5/6] qmp: add monitor command to add/remove a child

2015-08-10 Thread Alberto Garcia
On Mon 10 Aug 2015 03:00:32 AM CEST, Wen Congyang we...@cn.fujitsu.com wrote: +# @child-add +# +# Add a new child to quorum. This is useful to fix a broken quorum child. But the idea is that this can be eventually used by other drivers, isn't it? Yes, but is is only used for quorum now.

Re: [Qemu-devel] [PATCH v6 00/10] For QEMU 2.5: Add a netfilter object and netbuffer filter

2015-08-10 Thread Jason Wang
On 08/07/2015 10:46 AM, Yang Hongyang wrote: Add multiqueue support in v6. This patch add a new object netfilter, capture all network packets. Also implement a netbuffer based on this object. the buffer netfilter could be used by VM FT solutions like MicroCheckpointing, to buffer/release

Re: [Qemu-devel] [PATCH for-2.5 3/6] Add new block driver interface to add/delete a BDS's child

2015-08-10 Thread Wen Congyang
On 08/10/2015 04:19 PM, Alberto Garcia wrote: On Fri 31 Jul 2015 11:19:12 AM CEST, Wen Congyang wrote: +static const char *bdrv_get_id_or_node_name(BlockDriverState *bs) +{ +if (bs-blk) { +return blk_name(bs-blk); +} + +return bs-node_name ? bs-node_name : ; +}

  1   2   >