Re: [Qemu-devel] u-boot on qemu-x86

2015-05-25 Thread Saket Sinha
Hi Bin, I am putting down the steps below as to how to debug u-boot bare-metal on qemu. *git clone git://git.denx.de/u-boot-x86.git cd u-boot-x86export BUILD_ROM=ymake qemu-x86_defconfigmake allqemu-system-i386 -nographic -bios u-boot.rom -net nic -net us

[Qemu-devel] [PATCH] hw/acpi/aml-build: Fix memory leak

2015-05-25 Thread Shannon Zhao
From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 323b7bc..9efef70 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -306,6 +306,7 @@

[Qemu-devel] [RFC PATCH 1/4] vhost-user: Add ability to know vhost-user backend disconnection

2015-05-25 Thread Tetsuya Mukawa
Current QEMU cannot detect vhost-user backend disconnection. The patch adds ability to know it. To know disconnection, add watcher to detect G_IO_HUP event. When G_IO_HUP event is detected, the disconnected socket will be read to cause a CHR_EVENT_CLOSED. Signed-off-by: Tetsuya Mukawa --- net/vh

[Qemu-devel] [RFC PATCH 0/4] Add feature to start QEMU without vhost-user backend

2015-05-25 Thread Tetsuya Mukawa
Hi guys, Here is RFC patch to add feature to start QEMU without vhost-user backend. Currently, if we want to use vhost-user backend, the backend must start before QEMU. Also, if QEMU or the backend is closed unexpectedly, there is no way to recover without restarting both applications. Practically

[Qemu-devel] [RFC PATCH 3/4] vhost-user: Enable 'nowait' and 'reconnect' option

2015-05-25 Thread Tetsuya Mukawa
The patch enables 'nowait' option for server mode, and 'reconnect' option for client mode. Signed-off-by: Tetsuya Mukawa --- net/vhost-user.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/vhost-user.c b/net/vhost-user.c index 55c05a5..d31fc41 100644 --- a/net/vhost-user.c +++ b/n

[Qemu-devel] [RFC PATCH 2/4] vhost-user: Shutdown vhost-user connection when wrong messages are passed

2015-05-25 Thread Tetsuya Mukawa
When wrong vhost-user message are passed, the connection should be shutdown. Signed-off-by: Tetsuya Mukawa --- hw/virtio/vhost-user.c | 17 ++--- include/sysemu/char.h | 7 +++ qemu-char.c| 15 +++ 3 files changed, 32 insertions(+), 7 deletions(-) diff

[Qemu-devel] [RFC PATCH 4/4] vhost-user: Add new option to specify vhost-user backend supports

2015-05-25 Thread Tetsuya Mukawa
This patch adds 'backend_features' option for vhost-user backends. If this option is specified, QEMU assumes vhost-user backends support the features specified by user, and QEMU can start without vhost-user backend. Here are examples. * QEMU is configured as vhost-user client. -chardev socket,id=

Re: [Qemu-devel] [PATCH RFC V2 4/4] Add virtv2 machine that uses GIC-500

2015-05-25 Thread Pavel Fedin
Hello! > I accept that virtv2 is not needed and I'm currently using Pavel's patch > https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg02930.html with small > modifications. > However If there is a consensus I'll move to Ashok's virt instead of Pavel's > one. > > I'm looking forward for a

[Qemu-devel] VFIO use of HOST_PAGE_ALIGN

2015-05-25 Thread Peter Crosthwaite
Hi Alex and all, I am working on a patch series to enable multiple CPU architectures to run at once. It's a long story, but I have hit a snag in hw/vfio/pci.c which AFAICS is the only in-tree system-mode use of HOST_PAGE_ALIGN (all usermode code is a non-issue as not looking to support user-mode m

Re: [Qemu-devel] [RFC PATCH v0] numa: API to lookup NUMA node by address

2015-05-25 Thread Bharata B Rao
On Thu, May 14, 2015 at 11:39:06AM +0200, Paolo Bonzini wrote: > > > On 13/05/2015 20:06, Eduardo Habkost wrote: > > Also, this introduces a circular dependency between pc-dimm.c and > > numa.c. Instead of that, pc-dimm could simply notify us when a new > > device is realized (with just (addr, en

[Qemu-devel] [PATCH 3/3] hw/i386/acpi-build: decref after use

2015-05-25 Thread Shannon Zhao
From: Shannon Zhao valgrind complains about: ==16447== 48 bytes in 2 blocks are definitely lost in loss record 2,033 of 3,310 ==16447==at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447==by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447==by 0x64C7

[Qemu-devel] [PATCH 0/3] Fix memory leak spotted by valgrind

2015-05-25 Thread Shannon Zhao
From: Shannon Zhao These patches fix memmory leak spotted by valgrind. Shannon Zhao (3): hw/i386/pc_piix: Fix memory leak hw/ide/pci: Fix memory leak hw/i386/acpi-build: decref after use hw/i386/acpi-build.c | 1 + hw/i386/pc_piix.c| 2 ++ hw/ide/pci.c | 1 + 3 files changed,

[Qemu-devel] [PATCH 2/3] hw/ide/pci: Fix memory leak

2015-05-25 Thread Shannon Zhao
From: Shannon Zhao valgrind complains about: ==16447== 16 bytes in 2 blocks are definitely lost in loss record 1,304 of 3,310 ==16447==at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447==by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447==by 0x64C7

[Qemu-devel] [PATCH 1/3] hw/i386/pc_piix: Fix memory leak

2015-05-25 Thread Shannon Zhao
From: Shannon Zhao valgrind complains about: ==16447== 8 bytes in 1 blocks are definitely lost in loss record 552 of 3,310 ==16447==at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16447==by 0x2E4FD7: malloc_and_trace (vl.c:2546) ==16447==by 0x64C770E

[Qemu-devel] [Question] Different test result about guest softlock

2015-05-25 Thread vt
Hi, all : I have done some test about guest softlock panic by force the qemu main thread stuck in a timer callback function. After several minutes, let the qemu resume. I append the "softlockup_panic=1" to the kernel cmdline and check the /proc/sys/kernel/softlockup_panic. dist

Re: [Qemu-devel] [PATCH v6 42/47] Postcopy; Handle userfault requests

2015-05-25 Thread zhanghailiang
On 2015/4/15 1:04, Dr. David Alan Gilbert (git) wrote: From: "Dr. David Alan Gilbert" userfaultfd is a Linux syscall that gives an fd that receives a stream of notifications of accesses to pages registered with it and allows the program to acknowledge those stalls and tell the accessing thread

Re: [Qemu-devel] [PATCH v15 00/10] KVM platform device passthrough

2015-05-25 Thread Eric Auger
Hi Vikram, Thanks a lot for your T-b! Best Regards Eric 05/22/2015 07:37 PM, Vikram Sethi wrote: > Hi Eric, > Tested the latest patchset from your vfio_integ_v15 branch on a platform > device with 2 mmio regions. Works fine. > > Tested-by: Vikram Sethi > > Thanks, > Vikram > On 05/06/15 01:

Re: [Qemu-devel] [PATCH v5 3/4] spapr_pci: enumerate and add PCI device tree

2015-05-25 Thread Alexey Kardashevskiy
On 05/25/2015 02:45 PM, Nikunj A Dadhania wrote: Alexey Kardashevskiy writes: On 05/19/2015 06:26 PM, Nikunj A Dadhania wrote: All the PCI enumeration and device node creation was off-loaded to SLOF. With PCI hotplug support, code needed to be added to add device node. This creates multiple c

Re: [Qemu-devel] [PATCH v5 4/4] spapr_pci: populate ibm,loc-code

2015-05-25 Thread Alexey Kardashevskiy
On 05/25/2015 02:58 PM, Nikunj A Dadhania wrote: Alexey Kardashevskiy writes: On 05/19/2015 06:26 PM, Nikunj A Dadhania wrote: Each hardware instance has a platform unique location code. The OF device tree that describes a part of a hardware entity must include the “ibm,loc-code” property wi

[Qemu-devel] [RFC v8 01/13] vfio: extract vfio_get_hot_reset_info as a single function

2015-05-25 Thread Chen Fan
the function is used to get affected devices by bus reset. so here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 67 +++ 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/hw/vfio/pci.c b/hw

[Qemu-devel] [RFC v8 03/13] vfio: add pcie extanded capability support

2015-05-25 Thread Chen Fan
For vfio pcie device, we could expose the extended capability on PCIE bus. in order to avoid config space broken, we introduce a copy config for parsing extended caps. and rebuild the pcie extended config space. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 73 +

[Qemu-devel] [RFC v8 00/13] vfio-pci: pass the aer error to guest

2015-05-25 Thread Chen Fan
For now, for vfio pci passthough devices when qemu receives an error from host aer report, there just terminate the guest, but usually user want to know what error occurred but stop the guest, so this patches add aer capability support for vfio device, and pass the error to guest, and have guest dr

[Qemu-devel] [RFC v8 02/13] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2015-05-25 Thread Chen Fan
squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 9c05304..78f4c

[Qemu-devel] [RFC v8 04/13] aer: impove pcie_aer_init to support vfio device

2015-05-25 Thread Chen Fan
pcie_aer_init was used to emulate an aer capability for pcie device, but for vfio device, the aer config space size is mutable and is not always equal to PCI_ERR_SIZEOF(0x48). it depends on where the TLP Prefix register required, so here we add a size argument. Signed-off-by: Chen Fan --- hw/pci

[Qemu-devel] [RFC v8 10/13] vfio: do hot bus reset when do virtual secondary bus reset

2015-05-25 Thread Chen Fan
when do virtual secondary bus reset, the vfio device under this bus need to do host bus reset to reset the device. so add this case. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 94ff4e1..29a2b12 100644 -

[Qemu-devel] [RFC v8 08/13] pci: add bus reset_notifiers callbacks for host bus reset

2015-05-25 Thread Chen Fan
Particularly, For vfio devices, Once need to recovery devices by bus reset such as AER, we always need to reset the host bus to recovery the devices under the bus, so we need to add pci bus callbacks to specify to do host bus reset. Cc: Michael S. Tsirkin Signed-off-by: Chen Fan --- hw/pci/pci.

[Qemu-devel] [RFC v8 12/13] vfio-pci: pass the aer error to guest

2015-05-25 Thread Chen Fan
when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, the results in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and have the guest driver recover from the error. Signed-of

[Qemu-devel] [RFC v8 05/13] vfio: add aer support for vfio device

2015-05-25 Thread Chen Fan
Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 83 ++- 1 file changed, 82 insertions(+), 1 deletion(-

[Qemu-devel] [RFC v8 06/13] vfio: add check host bus reset is support or not

2015-05-25 Thread Chen Fan
we introduce a has_bus_reset capability to sign the vfio devices if support host bus reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 113 ++ 1 file changed, 113 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index f4e7855..15f

[Qemu-devel] [RFC v8 07/13] vfio: add check for vfio devices which enable aer should support bus reset

2015-05-25 Thread Chen Fan
Signed-off-by: Chen Fan --- hw/vfio/pci.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 15f182c..6de268d 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3791,6 +3791,32 @@ out: g_free(info); } +static void vfio_

[Qemu-devel] [RFC v8 13/13] vfio: add 'aer' property to expose aercap

2015-05-25 Thread Chen Fan
add 'aer' property to let user able to decide whether expose the aer capability. by default we should disable aer feature, because it needs configuration restrictions. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c in

[Qemu-devel] [RFC v8 09/13] vfio: add sec_bus_reset notifier to notify physical bus reset is needed

2015-05-25 Thread Chen Fan
Signed-off-by: Chen Fan --- hw/vfio/pci.c | 17 + 1 file changed, 17 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 6de268d..94ff4e1 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -156,6 +156,7 @@ typedef struct VFIOPCIDevice { PCIHostDeviceAddress host;

[Qemu-devel] [RFC v8 11/13] pcie_aer: expose pcie_aer_msg() interface

2015-05-25 Thread Chen Fan
For vfio device, we need to propagate the aer error to Guest OS. we use the pcie_aer_msg() to send aer error to guest. Signed-off-by: Chen Fan --- hw/pci/pcie_aer.c | 2 +- include/hw/pci/pcie_aer.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/pcie_aer.c b/

Re: [Qemu-devel] [PATCH v5 3/4] spapr_pci: enumerate and add PCI device tree

2015-05-25 Thread Nikunj A Dadhania
Alexey Kardashevskiy writes: > On 05/25/2015 02:45 PM, Nikunj A Dadhania wrote: >> Alexey Kardashevskiy writes: >> /* create OF node for pci device and required OF DT properties */ -static void *spapr_create_pci_child_dt(sPAPRPHBState *phb, PCIDevice *dev, -

Re: [Qemu-devel] [PATCH v5 4/4] spapr_pci: populate ibm,loc-code

2015-05-25 Thread Nikunj A Dadhania
Alexey Kardashevskiy writes: > On 05/25/2015 02:58 PM, Nikunj A Dadhania wrote: >> Alexey Kardashevskiy writes: >> >>> +} +/* + * For emulated devices and VFIO-failure case, make up + * the loc-code. + */ +buf = g_strdup_printf("%s_%s:%02d:%0

Re: [Qemu-devel] [PATCH v4 2/2] qga/qmp_guest_fstrim: Return per path fstrim result

2015-05-25 Thread Olga Krishtal
On 11/05/15 09:58, Justin Ossevoort wrote: The current guest-fstrim support only returns an error if some mountpoint was unable to be trimmed, skipping any possible additional mountpoints. The result of the TRIM operation itself is also discarded. This change returns a per mountpoint result of t

Re: [Qemu-devel] [PATCH RFC V2 4/4] Add virtv2 machine that uses GIC-500

2015-05-25 Thread Pavel Fedin
Hi everybody! I started to play with ITS implementation and got another question. > +[VIRT_ITS_CONTROL] = { 0x0802, 0x0001 }, > +[VIRT_ITS_TRANSLATION] = { 0x0803, 0x0001 }, Why do you describe these as two separate regions? Actually they always follow one another

Re: [Qemu-devel] [PATCH RFC V2 4/4] Add virtv2 machine that uses GIC-500

2015-05-25 Thread Pavel Fedin
> Why do you describe these as two separate regions? Actually they always > follow one > another, and CONTROL area has peripherial IDs at the end, so we can perfectly > merge them. And one more note. Could you omit ITS region reservations from the next version at all? I think ITS implementati

[Qemu-devel] [PATCH v14 01/21] i386: partial revert of interrupt poll fix

2015-05-25 Thread Pavel Dovgalyuk
Processing CPU_INTERRUPT_POLL requests in cpu_has_work functions break the determinism of cpu_exec. This patch is required to make interrupts processing deterministic. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c|6 ++ target-i386/cpu.c | 10 ++--

[Qemu-devel] [PATCH v14 00/21] Deterministic replay core

2015-05-25 Thread Pavel Dovgalyuk
This set of patches is related to the reverse execution and deterministic replay of qemu execution. This implementation of deterministic replay can be used for deterministic debugging of guest code through gdb remote interface. Core set of patches does not include support for reverse debugging c

[Qemu-devel] [PATCH v14 06/21] replay: introduce icount event

2015-05-25 Thread Pavel Dovgalyuk
This patch adds icount event to the replay subsystem. This event corresponds to execution of several instructions and used to synchronize input events in the replay phase. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c | 24 re

[Qemu-devel] [PATCH v14 08/21] cpu: replay instructions sequence

2015-05-25 Thread Pavel Dovgalyuk
This patch adds calls to replay functions into the icount setup block. In record mode number of executed instructions is written to the log. In replay mode number of istructions to execute is taken from the replay log. When replayed instructions counter is expired qemu_notify_event() function is ca

[Qemu-devel] [PATCH v14 05/21] replay: introduce mutex to protect the replay log

2015-05-25 Thread Pavel Dovgalyuk
This mutex will protect read/write operations for replay log. Using mutex is necessary because most of the events consist of several fields stored in the log. The mutex will help to avoid races. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c | 27 +

[Qemu-devel] [PATCH v14 02/21] replay: global variables and function stubs

2015-05-25 Thread Pavel Dovgalyuk
This patch adds global variables, defines, function declarations, and function stubs for deterministic VM replay used by external modules. Reviewed-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Pavel Dovgalyuk --- Makefile.target |1 docs/replay.txt | 167 ++

[Qemu-devel] [PATCH v14 10/21] replay: interrupts and exceptions

2015-05-25 Thread Pavel Dovgalyuk
This patch includes modifications of common cpu files. All interrupts and exceptions occured during recording are written into the replay log. These events allow correct replaying the execution by kicking cpu thread when one of these events is found in the log. Signed-off-by: Pavel Dovgalyuk ---

[Qemu-devel] [PATCH v14 12/21] replay: recording and replaying clock ticks

2015-05-25 Thread Pavel Dovgalyuk
Clock ticks are considered as the sources of non-deterministic data for virtual machine. This patch implements saving the clock values when they are acquired (virtual, host clock). When replaying the execution corresponding values are read from log and transfered to the module, which wants to read

[Qemu-devel] [PATCH v14 03/21] sysemu: system functions for replay

2015-05-25 Thread Pavel Dovgalyuk
This patch removes "static" specifier from several qemu function to make them visible to the replay module. It also invents several system functions that will be used by replay. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpus.c |2 +- include/exec/exec-a

[Qemu-devel] [PATCH v14 07/21] cpu-exec: allow temporary disabling icount

2015-05-25 Thread Pavel Dovgalyuk
This patch is required for deterministic replay to generate an exception by trying executing an instruction without changing icount. It adds new flag to TB for disabling icount while translating it. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c |7

[Qemu-devel] [PATCH v14 14/21] replay: checkpoints

2015-05-25 Thread Pavel Dovgalyuk
This patch introduces checkpoints that synchronize cpu thread and iothread. When checkpoint is met in the code all asynchronous events from the queue are executed. Signed-off-by: Pavel Dovgalyuk --- cpus.c |5 + main-loop.c |6 ++ qemu-timer.c

[Qemu-devel] [PATCH v14 13/21] replay: shutdown event

2015-05-25 Thread Pavel Dovgalyuk
This patch records and replays simulator shutdown event. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.h |2 ++ replay/replay.c | 14 ++ replay/replay.h |5 + vl.c |1 + 4 files changed,

[Qemu-devel] [PATCH v14 09/21] i386: interrupt poll processing

2015-05-25 Thread Pavel Dovgalyuk
This patch updates x86_cpu_exec_interrupt function. It can process two interrupt request at a time (poll and another one). This makes its execution non-deterministic. Determinism is requred for recorded icount execution. Signed-off-by: Pavel Dovgalyuk --- target-i386/seg_helper.c |3 +++ 1 f

[Qemu-devel] [PATCH v14 04/21] replay: internal functions for replay log

2015-05-25 Thread Pavel Dovgalyuk
This patch adds functions to perform read and write operations with replay log. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/Makefile.objs |1 replay/replay-internal.c | 149 ++ replay/replay-internal.h | 46 ++

[Qemu-devel] [PATCH v14 16/21] replay: ptimer

2015-05-25 Thread Pavel Dovgalyuk
This patch adds deterministic replay for hardware periodic countdown timers. Signed-off-by: Pavel Dovgalyuk --- hw/core/ptimer.c |7 ++- replay/replay-events.c | 17 + replay/replay-internal.h |1 + replay/replay.h |2 ++ 4 files changed, 26 i

[Qemu-devel] [PATCH v14 11/21] replay: asynchronous events infrastructure

2015-05-25 Thread Pavel Dovgalyuk
This patch adds module for saving and replaying asynchronous events. These events include network packets, keyboard and mouse input, USB packets, thread pool and bottom halves callbacks. All events are stored in the queue to be processed at synchronization points such as beginning of TB execution,

[Qemu-devel] [PATCH v14 17/21] typedef: add typedef for QemuOpts

2015-05-25 Thread Pavel Dovgalyuk
This patch moves typedefs for QemuOpts and related types to qemu/typedefs.h file. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- include/qemu/option.h |5 + include/qemu/typedefs.h |3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/

[Qemu-devel] [PATCH v14 15/21] bottom halves: introduce bh call function

2015-05-25 Thread Pavel Dovgalyuk
This patch introduces aio_bh_call function. It is used to execute bottom halves as callbacks without adding them to the queue. Signed-off-by: Pavel Dovgalyuk --- async.c |7 ++- include/block/aio.h |5 + 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/

[Qemu-devel] [PATCH v14 19/21] replay: replay blockers for devices

2015-05-25 Thread Pavel Dovgalyuk
Some devices are not supported by record/replay subsystem. This patch introduces replay blocker which denies starting record/replay if such devices are included into the configuration. Signed-off-by: Pavel Dovgalyuk --- hw/bt/hci.c |7 +++ include/qapi/qmp/qerror.h |3 +

[Qemu-devel] [PATCH v14 21/21] replay: ptimer

2015-05-25 Thread Pavel Dovgalyuk
This patch adds deterministic replay for hardware periodic countdown timers. ptimer uses bottom halves layer to execute such an asynchronous callback. We put this callback into the replay queue instead of bottom halves one. When checkpoint is met by main loop thread, the replay queue is processed a

[Qemu-devel] [PATCH v14 18/21] replay: initialization and deinitialization

2015-05-25 Thread Pavel Dovgalyuk
This patch introduces the functions for enabling the record/replay and for freeing the resources when simulator closes. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- exec.c |1 replay/replay-internal.h |2 + replay/replay.c | 134 +++

[Qemu-devel] [PATCH v14 20/21] replay: command line options

2015-05-25 Thread Pavel Dovgalyuk
This patch introduces command line options for enabling recording or replaying virtual machine behavior. These options are added to icount command line parameter. They include 'rr' which switches between record and replay and 'rrfile' for specifying the filename for replay log. Signed-off-by: Pave

Re: [Qemu-devel] [PATCH v14 21/21] replay: ptimer

2015-05-25 Thread Pavel Dovgaluk
Broken description. This one is correct: replay: recording of the user input This records user input (keyboard and mouse events) in record mode and replays these input events in replay mode. Pavel Dovgalyuk > -Original Message- > From: Pavel Dovgalyuk [mailto:pavel.dovga...@ispras.ru] >

Re: [Qemu-devel] [PATCH] configure: Check for libfdt version 1.4.0

2015-05-25 Thread Peter Maydell
On 25 May 2015 at 02:35, David Gibson wrote: > On Mon, May 18, 2015 at 09:43:21AM +0200, Thomas Huth wrote: >> Some recent patches require functions from libfdt version 1.4.0, >> so we should check for this version during the configure step >> already. Unfortunately, there does not seem to be a pr

Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU

2015-05-25 Thread Paolo Bonzini
On 23/05/2015 01:23, Kevin O'Connor wrote: > Hi Paolo, > > I'm curious if you've tried profiling SeaBIOS to see where it is > spending unnecessary time? No, I really wanted to get the absolute minimum time needed to get to the kernel. I announced it publicly because I think it's also instructi

Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU

2015-05-25 Thread Paolo Bonzini
On 22/05/2015 13:12, Daniel P. Berrange wrote: > In > particular I don't see why we need to have a SATA controller and ISA/LPC > bridge in every virt machine - root PCI bus only should be possible, as you > can provide disks via virtio-blk or virtio-scsi and serial, parallel, mouse, > floppy via

Re: [Qemu-devel] [PATCH] vl: fix memory leak spotted by valgrind

2015-05-25 Thread Paolo Bonzini
On 25/05/2015 08:47, Shannon Zhao wrote: > From: Shannon Zhao > > valgrind complains about: > ==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of > 3,673 > ==9276==at 0x4C2845D: malloc (in > /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) > ==9276==by 0x2E

Re: [Qemu-devel] [PATCH 0/4] More core code ENV_GET_CPU removals

2015-05-25 Thread Paolo Bonzini
On 25/05/2015 08:22, Peter Crosthwaite wrote: > Hi Andreas, Richard and all, > > I'm moving towards the goal of having no core code usages of ENV_GET_CPU. > This has two advantages: > > 1: It means we are closer to common-obj'ing core code like exec.c, cpus.c > and friends. > 2: Multi arch is e

Re: [Qemu-devel] [PATCH v3 4/4] target-arm: Add the GICv2m to the virt board

2015-05-25 Thread Pavel Fedin
Hello! > typedef struct MemMapEntry { > @@ -88,6 +90,7 @@ typedef struct VirtBoardInfo { > int fdt_size; > uint32_t clock_phandle; > uint32_t gic_phandle; > +uint32_t v2m_phandle; > } VirtBoardInfo; Could you rename v2m_phandle to something more neutral like msi_phandle ? I

Re: [Qemu-devel] [PATCH 2/3] hw/ide/pci: Fix memory leak

2015-05-25 Thread Paolo Bonzini
On 25/05/2015 10:37, Shannon Zhao wrote: > From: Shannon Zhao > > valgrind complains about: > ==16447== 16 bytes in 2 blocks are definitely lost in loss record 1,304 of > 3,310 > ==16447==at 0x4C2845D: malloc (in > /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) > ==16447==by 0

[Qemu-devel] [PATCH] mips_malta: provide ememsize env variable to kernels

2015-05-25 Thread Paul Burton
Commit 94c2b6aff43c (mips_malta: support up to 2GiB RAM) provided support for using over 256MB of RAM with the MIPS Malta board, including capping the memsize variable that QEMUs pseudo-bootloader provides to the kernel at 256MB in order to match YAMON. It didn't however provide the ememsize variab

Re: [Qemu-devel] [PATCH] i386: Introduce ARAT CPU feature

2015-05-25 Thread Paolo Bonzini
On 24/05/2015 17:16, Jan Kiszka wrote: > From: Jan Kiszka > > ARAT signals that the APIC timer does not stop in power saving states. > As our APICs are emulated, it's fine to expose this feature to guests, > at least when asking for KVM host features or with CPU types that > include the flag. The

Re: [Qemu-devel] [PATCH] hw/acpi/aml-build: Fix memory leak

2015-05-25 Thread Igor Mammedov
On Mon, 25 May 2015 15:14:37 +0800 Shannon Zhao wrote: > From: Shannon Zhao > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao Reviewed-by: Igor Mammedov > --- > hw/acpi/aml-build.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build

Re: [Qemu-devel] [PATCH] hw/acpi/aml-build: Fix memory leak

2015-05-25 Thread Igor Mammedov
On Mon, 25 May 2015 15:14:37 +0800 Shannon Zhao wrote: CCing stable. > From: Shannon Zhao > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > --- > hw/acpi/aml-build.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index 323b

Re: [Qemu-devel] [PATCH 3/3] hw/i386/acpi-build: decref after use

2015-05-25 Thread Igor Mammedov
On Mon, 25 May 2015 16:37:57 +0800 Shannon Zhao wrote: > From: Shannon Zhao > > valgrind complains about: > ==16447== 48 bytes in 2 blocks are definitely lost in loss record 2,033 of > 3,310 > ==16447==at 0x4C2845D: malloc (in > /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) > ==1

[Qemu-devel] [PATCH v2] i386: Introduce ARAT CPU feature

2015-05-25 Thread Jan Kiszka
From: Jan Kiszka ARAT signals that the APIC timer does not stop in power saving states. As our APICs are emulated, it's fine to expose this feature to guests, at least when asking for KVM host features or with CPU types that include the flag. The exact model number that introduced the feature is

Re: [Qemu-devel] [PATCH RFC 1/4] Add virt-v3 machine that uses GIC-500

2015-05-25 Thread Eric Auger
Hi Pavel, On 05/22/2015 12:58 PM, Pavel Fedin wrote: > This patch introduces kernel_irqchip_type member in Machine class. Currently > it it used only by virt machine for its internal purposes, however in future > it is to be passed to KVM in kvm_irqchip_create(). The variable is defined as > int

Re: [Qemu-devel] [PATCH RFC 2/4] Set kernel_irqchip_type for other ARM boards which use GIC

2015-05-25 Thread Eric Auger
On 05/22/2015 12:58 PM, Pavel Fedin wrote: missing commit msg. > Signed-off-by: Pavel Fedin > --- > hw/arm/exynos4_boards.c | 1 + > hw/arm/realview.c | 1 + > hw/arm/vexpress.c | 1 + > 3 files changed, 3 insertions(+) > > diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards

Re: [Qemu-devel] [PATCH RFC 3/4] First bits of vGICv3 support:

2015-05-25 Thread Eric Auger
On 05/22/2015 12:58 PM, Pavel Fedin wrote: > - Make use of kernel_irqchip_type in kvm_arch_irqchip_create() > - Instantiate "kvm-arm-gicv3" class (not implemented yet) for GICv3 with KVM > acceleration I think this patch file should rather be the last one of the series. > > Signed-off-by: Pavel F

Re: [Qemu-devel] [PATCH v2] i386: Introduce ARAT CPU feature

2015-05-25 Thread Paolo Bonzini
On 25/05/2015 16:06, Jan Kiszka wrote: > static void pc_compat_2_3(MachineState *machine) > { > +x86_cpu_compat_set_features("Westmere", FEAT_6_EAX, 0, CPUID_6_EAX_ARAT); > +x86_cpu_compat_set_features("SandyBridge", FEAT_6_EAX, 0, > +CPUID_6_EAX_ARAT); >

Re: [Qemu-devel] [PATCH v4 3/8] mirror: Do zero write on target if sectors not allocated

2015-05-25 Thread Paolo Bonzini
On 22/05/2015 05:40, Fam Zheng wrote: > +ret = bdrv_get_block_status(source, NULL, sector_num, nb_sectors, &pnum); > +if (ret < 0 || pnum < nb_sectors || > +(ret & BDRV_BLOCK_ALLOCATED && !(ret & BDRV_BLOCK_ZERO))) { > +bdrv_aio_readv(source, sector_num, &op->qiov, nb_

Re: [Qemu-devel] [PATCH v4 3/8] mirror: Do zero write on target if sectors not allocated

2015-05-25 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 22/05/2015 22:20, Eric Blake wrote: > But I'm worried about a shallow copy. If I start with "base <- > active", where "active" has an explicit zero cluster that is > overwriting an allocated non-zero cluster in "base", and I'm > creating the sh

Re: [Qemu-devel] [PATCH v4 3/8] mirror: Do zero write on target if sectors not allocated

2015-05-25 Thread Paolo Bonzini
On 25/05/2015 16:36, Paolo Bonzini wrote: > > > On 22/05/2015 05:40, Fam Zheng wrote: >> +ret = bdrv_get_block_status(source, NULL, sector_num, nb_sectors, >> &pnum); >> +if (ret < 0 || pnum < nb_sectors || >> +(ret & BDRV_BLOCK_ALLOCATED && !(ret & BDRV_BLOCK_ZERO))) { >>

Re: [Qemu-devel] [PATCH RFC 2/4] Set kernel_irqchip_type for other ARM boards which use GIC

2015-05-25 Thread Pavel Fedin
Hello! > > +++ b/hw/arm/exynos4_boards.c > > @@ -104,6 +104,7 @@ static Exynos4210State > *exynos4_boards_init_common(MachineState *machine, > > exynos4_machines[board_type].max_cpus); > > } > > > > +machine->kernel_irqchip_type = KVM_DEV_TYPE_ARM_VGIC_V2; > Are you sure

Re: [Qemu-devel] [PATCH v4 1/8] block: Add "base" option to bdrv_get_block_status

2015-05-25 Thread Paolo Bonzini
On 22/05/2015 05:40, Fam Zheng wrote: > +{ > +BlockDriverState *p; > +int64_t ret; > + > +assert(bs != base); > +for (p = bs; p != base; p = p->backing_hd) { > +ret = bdrv_co_get_block_status(p, sector_num, nb_sectors, pnum); It's a bit ugly to have different parameters f

[Qemu-devel] [PATCH v3] i386: Introduce ARAT CPU feature

2015-05-25 Thread Jan Kiszka
From: Jan Kiszka ARAT signals that the APIC timer does not stop in power saving states. As our APICs are emulated, it's fine to expose this feature to guests, at least when asking for KVM host features or with CPU types that include the flag. The exact model number that introduced the feature is

Re: [Qemu-devel] [PATCH RFC 1/4] Add virt-v3 machine that uses GIC-500

2015-05-25 Thread Pavel Fedin
> Documentation/devicetree/bindings/arm/gic-v3.txt says > "The main GIC node must contain the appropriate #address-cells, > #size-cells and ranges properties for the reg property of all ITS > nodes." or to be done when adding the ITS nodes later on ... To be done. Currently we don't have an ITS a

Re: [Qemu-devel] [PATCH v3 4/4] target-arm: Add the GICv2m to the virt board

2015-05-25 Thread Peter Maydell
On 25 May 2015 at 14:09, Pavel Fedin wrote: > Hello! > >> typedef struct MemMapEntry { >> @@ -88,6 +90,7 @@ typedef struct VirtBoardInfo { >> int fdt_size; >> uint32_t clock_phandle; >> uint32_t gic_phandle; >> +uint32_t v2m_phandle; >> } VirtBoardInfo; > > Could you rename

Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU

2015-05-25 Thread Kevin O'Connor
On Mon, May 25, 2015 at 09:21:49AM +0300, Vasiliy Tolstov wrote: > 2015-05-23 6:55 GMT+03:00 Kevin O'Connor : > > Out of curiosity, I ran some additional timing tests. With SeaBIOS > > fully stripped down (via Kconfig), it takes ~20ms to get to the boot > > phase on my old AMD system. Of that 20m

Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce "enabled" state for TCE table

2015-05-25 Thread Alexey Kardashevskiy
Hi Paolo, I have had a conversation with Mike and it turns out I am not allowed to create/remove memory regions dynamically (docs/memory.txt:101); otherwise "destroying regions during reset causes assertion in RCU thread during PHB/IOMMU unplug/unparent". Is it because patch just missing some

Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU

2015-05-25 Thread Kevin O'Connor
On Mon, May 25, 2015 at 02:52:51PM +0200, Paolo Bonzini wrote: > On 23/05/2015 01:23, Kevin O'Connor wrote: > > I'm curious if you've tried profiling SeaBIOS to see where it is > > spending unnecessary time? > > No, I really wanted to get the absolute minimum time needed to get to > the kernel. I

Re: [Qemu-devel] [PATCH 05/10 v10] target-tilegx/opcode_tilegx.h: Modify it to fit qemu using

2015-05-25 Thread Chen Gang
Also additional bug: when a block finishes with no branch insn (e.g. the insns are too much to be in a block), we need to modify pc and exit_tb. I found this bug when mark "-d all" for Hello world with shared glibc. At present, I finished all "Hello world" related test cases which I can find, and

Re: [Qemu-devel] [PATCH RFC V2 2/4] Implment GIC-500

2015-05-25 Thread Pavel Fedin
Hi! > > +static const uint8_t gic_lpi_ids[] = { > > +0x44, 0x00, 0x00, 0x00, 0x093, 0xB4, 0x3B, 0x00, 0x0D, 0xF0, 0x05, 0xB1 > > +}; Found one more thing. Shouldn't there be 0x091 instead of 0x093 (5th byte = PIDR0) ? 0x93 is ITS while REDIST is 0x91. Kind regards, Pavel Fedin Expert Engin

[Qemu-devel] [PATCH V7 00/24] hw/pc: implement multiple primary busses for pc machines

2015-05-25 Thread Marcel Apfelbaum
The series is fully functional. - Limitations: - Pxb's bus does not support hotplug. It will be addressed on top of this series because is already getting to big. - Pxb devices work only for i440fx and can be attached only to bus 0. - You are more than welcome to try using: -de

[Qemu-devel] [PATCH V7 02/24] acpi: add aml_add() term

2015-05-25 Thread Marcel Apfelbaum
Add encoding for ACPI DefAdd Opcode. Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 10 ++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 6a50f37..a823144 1

[Qemu-devel] [PATCH V7 03/24] acpi: add aml_lless() term

2015-05-25 Thread Marcel Apfelbaum
Add encoding for ACPI DefLLess Opcode. Reviewed-by: Shannon Zhao Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 9 + include/hw/acpi/aml-build.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.

[Qemu-devel] [PATCH V7 01/24] acpi: add aml_or() term

2015-05-25 Thread Marcel Apfelbaum
Add encoding for ACPI DefOr Opcode. Reviewed-by: Shannon Zhao Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 10 ++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.

[Qemu-devel] [PATCH V7 04/24] acpi: add aml_index() term

2015-05-25 Thread Marcel Apfelbaum
Add encoding for ACPI DefIndex Opcode. Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 10 ++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 05bba80..82a3fc9 100644 --- a/hw/acpi/aml-bu

[Qemu-devel] [PATCH V7 06/24] acpi: add aml_shiftright() term

2015-05-25 Thread Marcel Apfelbaum
Add encoding for ACPI DefShiftRight Opcode. Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 10 ++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 4d45610..f3

[Qemu-devel] [PATCH V7 07/24] acpi: add aml_increment() term

2015-05-25 Thread Marcel Apfelbaum
Add encoding for ACPI DefIncrement Opcode. Reviewed-by: Shannon Zhao Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 8 include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-buil

[Qemu-devel] [PATCH V7 10/24] hw/pci: made pci_bus_num a PCIBusClass method

2015-05-25 Thread Marcel Apfelbaum
From: Marcel Apfelbaum Refactoring it as a method of PCIBusClass will allow different implementations for subclasses. Signed-off-by: Marcel Apfelbaum --- hw/pci/pci.c | 13 ++--- include/hw/pci/pci_bus.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [PATCH V7 08/24] acpi: add aml_while() term

2015-05-25 Thread Marcel Apfelbaum
Add encoding for ACPI DefWhile Opcode. Reviewed-by: Shannon Zhao Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 8 include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c

  1   2   >