[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-03-31 Thread Jes Sorensen
On 04/01/11 08:22, Jason Wang wrote: > We need to keep DIR register unchanged across migration, but currently it > depends on the media_changed flags from block layer. Since we do not > save/restore it and the bdrv_open() called in dest node may set the > media_changed flag when trying to open flop

Re: [Qemu-devel] OEM Windows in qemu/kvm again (mini-howto)

2011-03-31 Thread Isaku Yamahata
Hi. SLIC table can be fed dynamically by utilize the existing fw_cfg interface. Something like this. (This requires your qemu patch.) This is just for showing the idea. thanks, diff --git a/src/acpi.c b/src/acpi.c index 6428d9c..e0815bd 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -627,6 +627,7 @@

[Qemu-devel] [PATCH V3] floppy: save and restore DIR register

2011-03-31 Thread Jason Wang
We need to keep DIR register unchanged across migration, but currently it depends on the media_changed flags from block layer. Since we do not save/restore it and the bdrv_open() called in dest node may set the media_changed flag when trying to open floppy image, guest driver may think the floppy h

[Qemu-devel] [PATCH 23/27] Implement PAPR CRQ hypercalls

2011-03-31 Thread David Gibson
From: Ben Herrenschmidt This patch implements the infrastructure and hypercalls necessary for the PAPR specified CRQ (Command Request Queue) mechanism. This general request queueing system is used by many of the PAPR virtual IO devices, including the virtual scsi adapter. Signed-off-by: Ben Her

[Qemu-devel] [PATCH 10/27] Better factor the ppc hash translation path

2011-03-31 Thread David Gibson
Currently the path handling hash page table translation in get_segment() has a mix of common and 32 or 64 bit specific code. However the division is not done terribly well which results in a lot of messy code flipping between common and divided paths. This patch improves the organization, consoli

[Qemu-devel] [PATCH 07/27] Clean up slb_lookup() function

2011-03-31 Thread David Gibson
The slb_lookup() function, used in the ppc translation path returns a number of slb entry fields in reference parameters. However, only one of the two callers of slb_lookup() actually wants this information. This patch, therefore, makes slb_lookup() return a simple pointer to the located SLB entr

[Qemu-devel] [PATCH 20/27] Add (virtual) interrupt to PAPR virtual tty device

2011-03-31 Thread David Gibson
Now that we have implemented the PAPR "xics" virtualized interrupt controller, we can add interrupts in PAPR VIO devices. This patch adds interrupt support to the PAPR virtual tty/console device. Signed-off-by: David Gibson --- hw/spapr.c |6 -- hw/spapr_vio.h |3 ++- hw/spapr_v

[Qemu-devel] [PATCH 21/27] Implement TCE translation for sPAPR VIO

2011-03-31 Thread David Gibson
This patch implements the necessary infrastructure and hypercalls for sPAPR's TCE (Translation Control Entry) IOMMU mechanism. This is necessary for all virtual IO devices which do DMA (i.e. nearly all of them). Signed-off-by: Ben Herrenschmidt Signed-off-by: David Gibson --- hw/spapr.c |

[Qemu-devel] [PATCH 26/27] Implement PAPR VPA functions for pSeries shared processor partitions

2011-03-31 Thread David Gibson
Shared-processor partitions are those where a CPU is time-sliced between partitions, rather than being permanently dedicated to a single partition. qemu emulated partitions, since they are just scheduled with the qemu user process, behave mostly like shared processor partitions. In order to bette

[Qemu-devel] [PATCH 25/27] Add a PAPR TCE-bypass mechanism for the pSeries machine

2011-03-31 Thread David Gibson
From: Ben Herrenschmidt Usually, PAPR virtual IO devices use a virtual IOMMU mechanism, TCEs, to mediate all DMA transfers. While this is necessary for some sorts of operation, it can be complex to program and slow for others. This patch implements a mechanism for bypassing TCE translation, tre

[Qemu-devel] [PATCH 24/27] Implement PAPR virtual SCSI interface (ibmvscsi)

2011-03-31 Thread David Gibson
From: Ben Herrenschmidt This patch implements the infrastructure and hypercalls necessary for the PAPR specified Virtual SCSI interface. This is the normal method for providing (virtual) disks to PAPR partitions. Signed-off-by: Ben Herrenschmidt Signed-off-by: David Gibson --- Makefile.targe

[Qemu-devel] [PATCH 14/27] Implement the bus structure for PAPR virtual IO

2011-03-31 Thread David Gibson
This extends the "pseries" (PAPR) machine to include a virtual IO bus supporting the PAPR defined hypercall based virtual IO mechanisms. So far only one VIO device is provided, the vty / vterm, providing a full console (polled only, for now). Signed-off-by: David Gibson --- Makefile.target |

[Qemu-devel] [PATCH 13/27] Start implementing pSeries logical partition machine

2011-03-31 Thread David Gibson
This patch adds a "pseries" machine to qemu. This aims to emulate a logical partition on an IBM pSeries machine, compliant to the "PowerPC Architecture Platform Requirements" (PAPR) document. This initial version is quite limited, it implements a basic machine and PAPR hypercall emulation. So fa

[Qemu-devel] [PATCH 15/27] Virtual hash page table handling on pSeries machine

2011-03-31 Thread David Gibson
On pSeries logical partitions, excepting the old POWER4-style full system partitions, the guest does not have direct access to the hardware page table. Instead, the pagetable exists in hypervisor memory, and the guest must manipulate it with hypercalls. However, our current pSeries emulation more

[Qemu-devel] [PATCH 22/27] Implement sPAPR Virtual LAN (ibmveth)

2011-03-31 Thread David Gibson
This patch implements the PAPR specified Inter Virtual Machine Logical LAN; that is the virtual hardware used by the Linux ibmveth driver. Signed-off-by: Paul Mackerras Signed-off-by: David Gibson --- Makefile.target |2 +- hw/spapr.c | 19 ++ hw/spapr_llan.c | 521 +

[Qemu-devel] [PATCH 18/27] Implement the PAPR (pSeries) virtualized interrupt controller (xics)

2011-03-31 Thread David Gibson
PAPR defines an interrupt control architecture which is logically divided into ICS (Interrupt Control Presentation, each unit is responsible for presenting interrupts to a particular "interrupt server", i.e. CPU) and ICS (Interrupt Control Source, each unit responsible for one or more hardware inte

[Qemu-devel] [PATCH 08/27] Parse SDR1 on mtspr instead of at translate time

2011-03-31 Thread David Gibson
On ppc machines with hash table MMUs, the special purpose register SDR1 contains both the base address of the encoded size (hashed) page tables. At present, we interpret the SDR1 value within the address translation path. But because the encodings of the size for 32-bit and 64-bit are different t

[Qemu-devel] [PATCH 17/27] Implement assorted pSeries hcalls and RTAS methods

2011-03-31 Thread David Gibson
This patch adds several small utility hypercalls and RTAS methods to the pSeries platform emulation. Specifically: * 'display-character' rtas call This just prints a character to the console, it's occasionally used for early debug of the OS. The support includes a hack to make this RTAS call re

[Qemu-devel] [PATCH 05/27] Implement missing parts of the logic for the POWER PURR

2011-03-31 Thread David Gibson
The PURR (Processor Utilization Resource Register) is a register found on recent POWER CPUs. The guts of implementing it at least enough to get by are already present in qemu, however some of the helper functions needed to actually wire it up are missing. This patch adds the necessary glue, so th

[Qemu-devel] [PATCH 19/27] Add PAPR H_VIO_SIGNAL hypercall and infrastructure for VIO interrupts

2011-03-31 Thread David Gibson
This patch adds infrastructure to support interrupts from PAPR virtual IO devices. This includes correctly advertising those interrupts in the device tree, and implementing the H_VIO_SIGNAL hypercall, used to enable and disable individual device interrupts. Signed-off-by: David Gibson --- hw/sp

[Qemu-devel] [PATCH 06/27] Correct ppc popcntb logic, implement popcntw and popcntd

2011-03-31 Thread David Gibson
From: David Gibson qemu already includes support for the popcntb instruction introduced in POWER5 (although it doesn't actually allow you to choose POWER5). However, the logic is slightly incorrect: it will generate results truncated to 32-bits when the CPU is in 32-bit mode. This is not normal

[Qemu-devel] [PATCH 11/27] Support 1T segments on ppc

2011-03-31 Thread David Gibson
Traditionally, the "segments" used for the two-stage translation used on powerpc MMUs were 256MB in size. This was the only option on all hash page table based 32-bit powerpc cpus, and on the earlier 64-bit hash page table based cpus. However, newer 64-bit cpus also permit 1TB segments This patc

[Qemu-devel] [PATCH 16/27] Implement hcall based RTAS for pSeries machines

2011-03-31 Thread David Gibson
On pSeries machines, operating systems can instantiate "RTAS" (Run-Time Abstraction Services), a runtime component of the firmware which implements a number of low-level, infrequently used operations. On logical partitions under a hypervisor, many of the RTAS functions require hypervisor privilege

[Qemu-devel] [PATCH 09/27] Use "hash" more consistently in ppc mmu code

2011-03-31 Thread David Gibson
Currently, get_segment() has a variable called hash. However it doesn't (quite) get the hash value for the ppc hashed page table. Instead it gets the hash shifted - effectively the offset of the hash bucket within the hash page table. As well, as being different to the normal use of plain "hash"

[Qemu-devel] [PATCH 12/27] Add POWER7 support for ppc

2011-03-31 Thread David Gibson
This adds emulation support for the recent POWER7 cpu to qemu. It's far from perfect - it's missing a number of POWER7 features so far, including any support for VSX or decimal floating point instructions. However, it's close enough to boot a kernel with the POWER7 PVR. Signed-off-by: David Gibs

[Qemu-devel] [PATCH 04/27] Implement PowerPC slbmfee and slbmfev instructions

2011-03-31 Thread David Gibson
For a 64-bit PowerPC target, qemu correctly implements translation through the segment lookaside buffer. Likewise it supports the slbmte instruction which is used to load entries into the SLB. However, it does not emulate the slbmfee and slbmfev instructions which read SLB entries back into regis

[Qemu-devel] [PATCH 01/27] Clean up PowerPC SLB handling code

2011-03-31 Thread David Gibson
Currently the SLB information when emulating a PowerPC 970 is storeed in a structure with the unhelpfully named fields 'tmp' and 'tmp64'. While the layout in these fields does match the description of the SLB in the architecture document, it is not convenient either for looking up the SLB, or for

[Qemu-devel] [0/27] Implement emulation of pSeries logical partitions (v6)

2011-03-31 Thread David Gibson
This patch series adds a "pseries" machine to qemu, allowing it to emulate IBM pSeries logical partitions. More specifically it implements the interface defined by the "PowerPC Architecture Platform Requirements" document (PAPR, or sPAPR for short). Along the way we add a bunch of support for mor

[Qemu-devel] [PATCH 03/27] Add a hook to allow hypercalls to be emulated on PowerPC

2011-03-31 Thread David Gibson
PowerPC and POWER chips since the POWER4 and 970 have a special hypervisor mode, and a corresponding form of the system call instruction which traps to the hypervisor. qemu currently has stub implementations of hypervisor mode. That is, the outline is there to allow qemu to run a PowerPC hypervis

[Qemu-devel] [PATCH 02/27] Allow qemu_devtree_setprop() to take arbitrary values

2011-03-31 Thread David Gibson
From: David Gibson Currently qemu_devtree_setprop() expects the new property value to be given as a uint32_t *. While property values consisting of u32s are common, in general they can have any bytestring value. Therefore, this patch alters the function to take a void * instead, allowing caller

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 07:44:35PM -0500, Anthony Liguori wrote: > On 03/31/2011 06:42 PM, Michael S. Tsirkin wrote: > >On Thu, Mar 31, 2011 at 04:49:46PM -0500, Anthony Liguori wrote: > >>On 03/31/2011 04:38 PM, Michael S. Tsirkin wrote: > That seems like a clearer API, yes. I think it makes i

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 06:42 PM, Michael S. Tsirkin wrote: On Thu, Mar 31, 2011 at 04:49:46PM -0500, Anthony Liguori wrote: On 03/31/2011 04:38 PM, Michael S. Tsirkin wrote: That seems like a clearer API, yes. I think it makes it much more obvious what it's trying to achieve. -- PMM Maybe register_dma

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 04:49:46PM -0500, Anthony Liguori wrote: > On 03/31/2011 04:38 PM, Michael S. Tsirkin wrote: > > > >>That seems like a clearer API, yes. I think it makes it much more > >>obvious what it's trying to achieve. > >> > >>-- PMM > >Maybe register_dma_area - its' not 100% virtio s

[Qemu-devel] Re: [PATCH 2/9] eepro100: Fix endianness issues

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 10:33:24PM +0200, Stefan Weil wrote: > Like other Intel devices, e100 (eepro100) uses little endian byte order. > > This patch was tested with these combinations: > > i386 host, i386 + mipsel guests (le-le) > mipsel host, i386 guest (le-le) > i386 host, mips + ppc guests (

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 04:38 PM, Michael S. Tsirkin wrote: That seems like a clearer API, yes. I think it makes it much more obvious what it's trying to achieve. -- PMM Maybe register_dma_area - its' not 100% virtio specific. It's never been clear to me whether that's true or not. I've heard mixed

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 04:37 PM, Michael S. Tsirkin wrote: On Thu, Mar 31, 2011 at 04:32:44PM -0500, Anthony Liguori wrote: On 03/31/2011 04:26 PM, Michael S. Tsirkin wrote: On Thu, Mar 31, 2011 at 02:29:50PM -0500, Anthony Liguori wrote: On 03/31/2011 02:18 PM, Peter Maydell wrote: On 31 March 2011 2

[Qemu-devel] Re: [PATCH 8/9] eepro100: Pad received short frames

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 10:33:30PM +0200, Stefan Weil wrote: > QEMU sends frames smaller than 60 bytes to ethernet nics. > This should be fixed in the networking code because normally > such frames are rejected by real NICs and their emulations. > To avoid this behaviour, other NIC emulations pad r

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 10:32:11PM +0100, Peter Maydell wrote: > On 31 March 2011 21:23, Anthony Liguori wrote: > > On 03/31/2011 03:12 PM, Peter Maydell wrote: > >> Well, obviously you need to be able to revoke the permission > >> to use the fastpath pointer to the underlying memory. But you > >>

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 04:32:44PM -0500, Anthony Liguori wrote: > On 03/31/2011 04:26 PM, Michael S. Tsirkin wrote: > >On Thu, Mar 31, 2011 at 02:29:50PM -0500, Anthony Liguori wrote: > >>On 03/31/2011 02:18 PM, Peter Maydell wrote: > >>>On 31 March 2011 20:01, Anthony Liguori wrote: > VGA i

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 04:26 PM, Michael S. Tsirkin wrote: On Thu, Mar 31, 2011 at 02:29:50PM -0500, Anthony Liguori wrote: On 03/31/2011 02:18 PM, Peter Maydell wrote: On 31 March 2011 20:01, Anthony Liguori wrote: VGA is just another device. It happens to be that we treat VGA device memory as some

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Peter Maydell
On 31 March 2011 21:23, Anthony Liguori wrote: > On 03/31/2011 03:12 PM, Peter Maydell wrote: >> Well, obviously you need to be able to revoke the permission >> to use the fastpath pointer to the underlying memory. But you >> need to be able to do that anyhow, to cover cases where (eg) the >> gues

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 02:29:50PM -0500, Anthony Liguori wrote: > On 03/31/2011 02:18 PM, Peter Maydell wrote: > >On 31 March 2011 20:01, Anthony Liguori wrote: > >>VGA is just another device. It happens to be that we treat VGA device > >>memory as something that behaves like ram occassionally b

[Qemu-devel] [PATCH] w32: Fix compilation of new code

2011-03-31 Thread Stefan Weil
Some recently added new code did not compile for w32 targets. The functions qemu_iohandler_fill and qemu_iohandler_poll need data type fd_set which is declared in winsock2.h for w32 targets. Moving the functions from qemu-common.h to qemu_socket.h fixes compilations for w32 without adding a new i

Re: [Qemu-devel] [PATCH] Improve accuracy of block migration bandwidth calculation

2011-03-31 Thread Michael Roth
On 03/31/2011 09:13 AM, Avishay Traeger wrote: The current bandwidth calculation looks like this: (block_mig_state.reads * BLOCK_SIZE)/ block_mig_state.total_time "total_time" is currently the sum of the read request latencies. This is not very accurate because block migration uses aio and so

[Qemu-devel] [PATCH 3/9] eepro100: Support byte/word writes to port address

2011-03-31 Thread Stefan Weil
port is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil --- hw/eepro100.c | 20 ++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index c789767..47ef78c

[Qemu-devel] eepro100: Improve emulation and portability

2011-03-31 Thread Stefan Weil
These patches clean some parts of the code, improve the code for big endian hosts and guests, and add some more control / status register access methods. They also add the usual workaround for non-standard short frames which are generated by QEMU's current networking code. The new register access

[Qemu-devel] [PATCH 1/9] eepro100: Avoid duplicate debug messages

2011-03-31 Thread Stefan Weil
When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice. Now logging in eepro100_write1 and eepro100_write2 is similar to the logging in eepro100_write4 (which already was correct). Signed-off-by: Stefan Weil --- hw/eepro100.c | 14 +- 1 files changed, 9 insertions(+)

[Qemu-devel] [PATCH 7/9] eepro100: Support 32 bit read access to flash register

2011-03-31 Thread Stefan Weil
Signed-off-by: Stefan Weil --- hw/eepro100.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index b51e391..500a3af 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -1429,6 +1429,10 @@ static uint32_t eepro100_read4(EEPRO100State * s, ui

[Qemu-devel] [PATCH 6/9] eepro100: Support byte read access to general control register

2011-03-31 Thread Stefan Weil
The general control register is a byte register. Add support for byte reads. Signed-off-by: Stefan Weil --- hw/eepro100.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index 2332556..b51e391 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c

[Qemu-devel] [PATCH 8/9] eepro100: Pad received short frames

2011-03-31 Thread Stefan Weil
QEMU sends frames smaller than 60 bytes to ethernet nics. This should be fixed in the networking code because normally such frames are rejected by real NICs and their emulations. To avoid this behaviour, other NIC emulations pad received frames. This patch enables this workaround for eepro100, too.

[Qemu-devel] [PATCH 4/9] eepro100: Support byte/word writes to pointer register

2011-03-31 Thread Stefan Weil
pointer is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil --- hw/eepro100.c | 33 - 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index

[Qemu-devel] [PATCH 2/9] eepro100: Fix endianness issues

2011-03-31 Thread Stefan Weil
Like other Intel devices, e100 (eepro100) uses little endian byte order. This patch was tested with these combinations: i386 host, i386 + mipsel guests (le-le) mipsel host, i386 guest (le-le) i386 host, mips + ppc guests (le-be) mips host, i386 guest (be-le) mips and mipsel hosts were emulated m

[Qemu-devel] [PATCH 9/9] eepro100: Simplify receive data structure

2011-03-31 Thread Stefan Weil
The packet data part of this structure was only used to calculate the size of the preceding data. This can be simplified. Signed-off-by: Stefan Weil --- hw/eepro100.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index a740d2e..d4d315

[Qemu-devel] [PATCH 5/9] eepro100: Support byte/word read/write access to MDI control register

2011-03-31 Thread Stefan Weil
MDI control is a 32 bit register, but may be read or written using 8 or 16 bit access. Data is latched when the MSB is written. Add support for byte/word read/write access. Signed-off-by: Stefan Weil --- hw/eepro100.c | 34 -- 1 files changed, 32 insertions(+),

[Qemu-devel] [PATCH] migration: Improve bandwidth estimation

2011-03-31 Thread Pierre Riteau
In the current migration code, bandwidth is estimated by measuring the time spent in the ram_save_block loop and dividing by the number of sent bytes. However, because of buffering, the time spent in this loop is usually much less than the actual time required to send data on the wire. Try to impro

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 03:12 PM, Peter Maydell wrote: On 31 March 2011 20:29, Anthony Liguori wrote: On 03/31/2011 02:18 PM, Peter Maydell wrote: So, to ask a dumb question, what does make something RAM? It's a made up concept that we use to make device performance faster. Basically, RAM should inclu

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 03:03 PM, Michael S. Tsirkin wrote: On Thu, Mar 31, 2011 at 02:26:59PM -0500, Anthony Liguori wrote: On 03/31/2011 02:07 PM, Michael S. Tsirkin wrote: Just needs some love. VGA is just another device. It happens to be that we treat VGA device memory as something that behaves lik

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Peter Maydell
On 31 March 2011 20:29, Anthony Liguori wrote: > On 03/31/2011 02:18 PM, Peter Maydell wrote: >> So, to ask a dumb question, what does make something RAM? > > It's a made up concept that we use to make device performance faster. > > Basically, RAM should include all of the memory that a reasonable

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 02:26:59PM -0500, Anthony Liguori wrote: > On 03/31/2011 02:07 PM, Michael S. Tsirkin wrote: > >>Just needs some love. > >> > >>VGA is just another device. It happens to be that we treat VGA > >>device memory as something that behaves like ram occassionally but > >>that doe

[Qemu-devel] [RFC PATCH 3/3] atapi: Allow GET_EVENT_STATUS_NOTIFICATION and TEST_UNIT_READY after media change

2011-03-31 Thread Amit Shah
After a media change, the only commands allowed from the guest were REQUEST_SENSE and INQUIRY. The guest may also issue GET_EVENT_STATUS_NOTIFICATION and TEST_UNIT_READY commands to get media changed notification. Enable those commands. After this, the HSM violation messages from Linux guests ar

[Qemu-devel] [RFC PATCH 2/3] atapi: implement GET_EVENT_STATUS_NOTIFICATION command

2011-03-31 Thread Amit Shah
This commit could be split further; but the main thing it does is implement this command. Linux kernels (at least upto 2.6.38.2) need a fix to the media change handling to recognise size changes. Signed-off-by: Amit Shah --- hw/ide/core.c | 138 +

[Qemu-devel] [RFC PATCH 1/3] ide: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function

2011-03-31 Thread Amit Shah
This makes the code more readable. Also, there's a block like: if () { ... } else { ... } Split that into if () { ... return; } ... Signed-off-by: Amit Shah --- hw/ide/core.c | 37 - 1 files changed, 24 insertions(+), 13 deletions(-) diff --git

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 02:18 PM, Peter Maydell wrote: On 31 March 2011 20:01, Anthony Liguori wrote: VGA is just another device. It happens to be that we treat VGA device memory as something that behaves like ram occassionally but that does not make it RAM. So, to ask a dumb question, what does make s

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 02:07 PM, Michael S. Tsirkin wrote: Just needs some love. VGA is just another device. It happens to be that we treat VGA device memory as something that behaves like ram occassionally but that does not make it RAM. If we agree on that, will a pair of functions for this work? How

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Peter Maydell
On 31 March 2011 20:01, Anthony Liguori wrote: > VGA is just another device.  It happens to be that we treat VGA device > memory as something that behaves like ram occassionally but that does not > make it RAM. So, to ask a dumb question, what does make something RAM? My take on RAM is that RAM i

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Alex Williamson
On Thu, 2011-03-31 at 14:01 -0500, Anthony Liguori wrote: > On 03/31/2011 01:49 PM, Michael S. Tsirkin wrote: > > On Thu, Mar 31, 2011 at 01:33:58PM -0500, Anthony Liguori wrote: > >> On 03/31/2011 12:43 PM, Michael S. Tsirkin wrote: > >>> Currently, vga cards that allocate vga ram, > >>> register

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 02:01:52PM -0500, Anthony Liguori wrote: > On 03/31/2011 01:49 PM, Michael S. Tsirkin wrote: > >On Thu, Mar 31, 2011 at 01:33:58PM -0500, Anthony Liguori wrote: > >>On 03/31/2011 12:43 PM, Michael S. Tsirkin wrote: > >>>Currently, vga cards that allocate vga ram, > >>>regist

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 01:49 PM, Michael S. Tsirkin wrote: On Thu, Mar 31, 2011 at 01:33:58PM -0500, Anthony Liguori wrote: On 03/31/2011 12:43 PM, Michael S. Tsirkin wrote: Currently, vga cards that allocate vga ram, register it as regular ram. When this happens a lot, vhost need to get notified and fl

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
On Thu, Mar 31, 2011 at 01:33:58PM -0500, Anthony Liguori wrote: > On 03/31/2011 12:43 PM, Michael S. Tsirkin wrote: > >Currently, vga cards that allocate vga ram, > >register it as regular ram. When this happens > >a lot, vhost need to get notified and flush > >its memory tables, which is slow. >

Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Anthony Liguori
On 03/31/2011 12:43 PM, Michael S. Tsirkin wrote: Currently, vga cards that allocate vga ram, register it as regular ram. When this happens a lot, vhost need to get notified and flush its memory tables, which is slow. This was observed with cirrus vga. As a solution, add an explicit flag when r

[Qemu-devel] [PATCH v3] hw/pc: Support system flash memory with -pflash parameter

2011-03-31 Thread Jordan Justen
If -pflash is specified and -bios is specified then pflash will be mapped just below the system rom using hw/pflash_cfi01.c. If -pflash is specified on the command line, but -bios is not specified, then 'bios.bin' will NOT be loaded, and instead the -pflash flash image will be mapped just below 4G

[Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers

2011-03-31 Thread Michael S. Tsirkin
Currently, vga cards that allocate vga ram, register it as regular ram. When this happens a lot, vhost need to get notified and flush its memory tables, which is slow. This was observed with cirrus vga. As a solution, add an explicit flag when registering vga ram, vhost-net can simply ignore it.

Re: [Qemu-devel] snapshot question- how to fetch the tmp file?

2011-03-31 Thread Mulyadi Santosa
2011/3/31 涂化衍 : > Dear Mr/Miss, It's Mr :) > Thanks for your information. We have already found "something" in this path. > But, this problem is still alive. We can't restore this virtual machine on > another physical machine from host A to host B by using snapshot I might misunderstood your pro

[Qemu-devel] [PATCH] Improve accuracy of block migration bandwidth calculation

2011-03-31 Thread Avishay Traeger
The current bandwidth calculation looks like this: (block_mig_state.reads * BLOCK_SIZE)/ block_mig_state.total_time "total_time" is currently the sum of the read request latencies. This is not very accurate because block migration uses aio and so several requests can be submitted at once. Bandw

[Qemu-devel] Re: CD-ROM bug round-up

2011-03-31 Thread Stefan Hajnoczi
On Thu, Mar 31, 2011 at 10:53 AM, Amit Shah wrote: >> = Amit = >> >> Found that 2.6.38 and later guest kernels fail to report media change. > > It's not 2.6.38 and later; it's somewhere around the time libata was > introduced and CDROM emulation went from ide to scsi in the kernel. > All current k

[Qemu-devel] [PATCH] Fix integer overflow in block migration bandwidth calculation

2011-03-31 Thread Avishay Traeger
block_mig_state.reads is an int, and multiplying by BLOCK_SIZE yielded a negative number, resulting in a negative bandwidth (running on a 32-bit machine). Cast to avoid. Signed-off-by: Avishay Traeger --- block-migration.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[Qemu-devel] OEM Windows in qemu/kvm again (mini-howto)

2011-03-31 Thread Michael Tokarev
Here's a quick-n-dirty howto about running OEM version of windows7 or vista in qemu/kvm, assuming you own a computer with pre-installed OEM version of such operating system so you have rights to run it there. Windows 7 & Vista OEM activation are based on a special OEM marker in BIOS in a form of o

Re: [Qemu-devel] [PATCH] qemu-img rebase: Fix segfault if backing file can't be opened

2011-03-31 Thread Stefan Hajnoczi
On Thu, Mar 31, 2011 at 11:41 AM, Kevin Wolf wrote: > bdrv_delete must not be called for a NULL BlockDriverState. > > Signed-off-by: Kevin Wolf > --- >  qemu-img.c |    8 ++-- >  1 files changed, 6 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-devel] Re: [PATCH v2] qemu-img: Initial progress printing support

2011-03-31 Thread Stefan Hajnoczi
On Thu, Mar 31, 2011 at 12:38 PM, Kevin Wolf wrote: > Am 31.03.2011 13:15, schrieb Jes Sorensen: >> On 03/31/11 12:38, Kevin Wolf wrote: >>> Am 30.03.2011 14:16, schrieb jes.soren...@redhat.com: From: Jes Sorensen This adds the basic infrastructure for supporting progress output >>

[Qemu-devel] Re: [Xen-devel] [PATCH V12 00/17] Xen device model support

2011-03-31 Thread Anthony PERARD
On Tue, Mar 29, 2011 at 19:27, wrote: > From: Anthony PERARD > > Hi all, > > Here is the few change made since the v11: >  - All objects built for each target are now build only for i386 targets. >  - The compatibility macros have been replaced by static inline functions. >  - xen_platform_init

[Qemu-devel] Re: [PATCH v2] qemu-img: Initial progress printing support

2011-03-31 Thread Kevin Wolf
Am 31.03.2011 13:15, schrieb Jes Sorensen: > On 03/31/11 12:38, Kevin Wolf wrote: >> Am 30.03.2011 14:16, schrieb jes.soren...@redhat.com: >>> From: Jes Sorensen >>> >>> This adds the basic infrastructure for supporting progress output >>> on the command line, as well as progress support for qemu-

[Qemu-devel] Re: [PATCH v2] qemu-img: Initial progress printing support

2011-03-31 Thread Jes Sorensen
On 03/31/11 12:38, Kevin Wolf wrote: > Am 30.03.2011 14:16, schrieb jes.soren...@redhat.com: >> From: Jes Sorensen >> >> This adds the basic infrastructure for supporting progress output >> on the command line, as well as progress support for qemu-img commands >> 'rebase' and 'convert'. >> >> Sign

[Qemu-devel] Re: [PATCH] exit if -drive specified is invalid instead of ignoring the "wrong" -drive

2011-03-31 Thread Kevin Wolf
Am 30.03.2011 14:31, schrieb Michael Tokarev: > This fixes the problem when qemu continues even if -drive specification > is somehow invalid, resulting in a mess. Applicable for both current > master and for stable-0.14 (and the same issue exist 0.13 and 0.12 too). > > The prob can actually be se

Re: [Qemu-devel] [PATCH 16/17] s390x: translate engine for s390x CPU

2011-03-31 Thread Peter Maydell
On 29 March 2011 09:55, Alexander Graf wrote: > On 28.03.2011, at 17:40, Peter Maydell wrote: >> Doesn't this take you over MAX_OP_PER_INSTR for some cases? > > I haven't encountered any case where it does. This untested patch against your v2 ought to make it print a warning if you do go over the

[Qemu-devel] [PATCH] qemu-img rebase: Fix segfault if backing file can't be opened

2011-03-31 Thread Kevin Wolf
bdrv_delete must not be called for a NULL BlockDriverState. Signed-off-by: Kevin Wolf --- qemu-img.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 074388c..d9c2c12 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1411,8 +1411,12 @@ out:

[Qemu-devel] Re: [PATCH v2] qemu-img: Initial progress printing support

2011-03-31 Thread Kevin Wolf
Am 30.03.2011 14:16, schrieb jes.soren...@redhat.com: > From: Jes Sorensen > > This adds the basic infrastructure for supporting progress output > on the command line, as well as progress support for qemu-img commands > 'rebase' and 'convert'. > > Signed-off-by: Jes Sorensen Thanks, applied to

[Qemu-devel] Re: [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-03-31 Thread Kevin Wolf
Am 29.03.2011 21:04, schrieb Stefan Hajnoczi: > Piggy-back on the guest CD-ROM polling to poll on the host. Open and > close the host CD-ROM file descriptor to ensure we read the new size and > not a stale size. > > Two things are going on here: > > 1. If hald/udisks is not already polling CD-RO

Re: [Qemu-devel] CD-ROM bug round-up

2011-03-31 Thread Markus Armbruster
Stefan Hajnoczi writes: > Several of us have been investigating CD-ROM bugs. Let's update each > other, make sure we're not duplicating effort, and see if we can help > each other make progress. > > = Stefan = > > Guests do not notice media change when using Linux host CD-ROM > pass-through for

[Qemu-devel] Re: CD-ROM bug round-up

2011-03-31 Thread Amit Shah
On (Wed) 30 Mar 2011 [17:40:40], Stefan Hajnoczi wrote: > Several of us have been investigating CD-ROM bugs. Let's update each > other, make sure we're not duplicating effort, and see if we can help > each other make progress. > > = Stefan = > > Guests do not notice media change when using Linux

[Qemu-devel] [PATCH] register signal handler after initializing SDL.

2011-03-31 Thread Gleb Natapov
SDL library initialization mangles signal handlers, so QEMU should register them after initializing SDL. This was the case before and code even have a comment about that. Fix it to be so again. Signed-off-by: Gleb Natapov Reviewed-by: Peter Maydell diff --git a/vl.c b/vl.c index 192a240..93aacc

Re: [Qemu-devel] [PATCHv3] report that QEMU process was killed by a signal

2011-03-31 Thread Gleb Natapov
On Wed, Mar 30, 2011 at 09:51:29PM +0100, Peter Maydell wrote: > 2011/3/30 Gleb Natapov : > > On Wed, Mar 30, 2011 at 07:53:41PM +0100, Peter Maydell wrote: > >> I'm not convinced about the utility of printing the pid, personally. > >> Most programs get along fine without printing anything when > >

[Qemu-devel] [V10 PATCH 13/13] virtio-9p: Chroot environment for other functions

2011-03-31 Thread M. Mohan Kumar
Add chroot functionality for systemcalls that can operate on a file using relative directory file descriptor. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-local.c | 125 + 1 files changed, 115 insertions(+), 10 deletions(-) diff --git a/hw/9pf

[Qemu-devel] Re: [PATCH v2] v9fs_walk: As per 9p2000 RFC, MAXWELEM >= nwnames >= 0.

2011-03-31 Thread Stefan Hajnoczi
On Tue, Mar 22, 2011 at 5:51 AM, Harsh Prateek Bora wrote: > The nwnames field in TWALK message is assumed to be >=0 and <= MAXWELEM > which is defined as macro P9_MAXWELEM (16) in virtio-9p.h as per 9p2000 RFC. > Appropriate changes are required in V9fsWalkState and v9fs_walk. > > v2: > - Added c

[Qemu-devel] [V10 PATCH 02/13] virtio-9p: Enable CONFIG_THREAD if CONFIG_VIRTFS is enabled

2011-03-31 Thread M. Mohan Kumar
9p Chroot environment needs APIs defined in qemu-thread.c, so enable CONFIG_THREAD if virtfs is enabled Signed-off-by: M. Mohan Kumar --- configure |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 4a4d085..9bfbe51 100755 --- a/configure +++ b/c

[Qemu-devel] Re: [PATCH] vl.c: Tidy up message printed when we exit on a signal

2011-03-31 Thread Gleb Natapov
On Wed, Mar 30, 2011 at 10:03:38PM +0100, Peter Maydell wrote: > Tidy up the message printed when qemu exits due to a signal, so that > it's clearer where the message is coming from and that it's not just > stray debug output. > > Signed-off-by: Peter Maydell Acked-by: Gleb Natapov > --- > vl.

[Qemu-devel] [V10 PATCH 00/13] virtio-9p: Use chroot to safely access files in passthrough security model

2011-03-31 Thread M. Mohan Kumar
In passthrough security model, following symbolic links in the server side could result in TOCTTOU vulnerabilities. This patchset resolves this issue by creating a dedicated process which chroots into the share path and all file object access is done in the chroot environment. This patchset imple

[Qemu-devel] [V10 PATCH 09/13] virtio-9p: Add support to rename

2011-03-31 Thread M. Mohan Kumar
Support renaming a file or directory in chroot envirnoment. Add interfaces for renaming in chroot worker and qemu side. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p-chroot-worker.c | 17 + hw/9pfs/virtio-9p-chroot.h|1 + hw/9pfs/virtio-9p-local.c |

[Qemu-devel] [V10 PATCH 04/13] virtio-9p: Add qemu side interfaces for chroot environment

2011-03-31 Thread M. Mohan Kumar
QEMU side interfaces to communicate with chroot worker process. Signed-off-by: M. Mohan Kumar --- Makefile.objs |2 +- hw/9pfs/virtio-9p-chroot.c | 92 hw/9pfs/virtio-9p-chroot.h |1 + 3 files changed, 94 insertions(+), 1 deleti

[Qemu-devel] [V10 PATCH 01/13] Implement qemu_read_full

2011-03-31 Thread M. Mohan Kumar
Add qemu_read_full function Signed-off-by: M. Mohan Kumar --- osdep.c | 32 qemu-common.h |2 ++ 2 files changed, 34 insertions(+), 0 deletions(-) diff --git a/osdep.c b/osdep.c index 327583b..8d84a88 100644 --- a/osdep.c +++ b/osdep.c @@ -127,6 +127

[Qemu-devel] [V10 PATCH 10/13] virtio-9p: Move file post creation changes to none security model

2011-03-31 Thread M. Mohan Kumar
After creating a file object, its permission and ownership details are updated as per 9p client's request for both passthrough and none security model. But with chrooted environment its not required for passthrough security model. Move all post file creation changes to none security model. Signed-

  1   2   >