Vinod E | 1 Jan 2008 13:21
Picon
Favicon

adding a new PCI device support in QEMU

Hi,
   I have a special kind of PCI device on my system. 
I want QEMU to emulate that device and have Guest VM
see that.  Can someone point me to any documentation
available on how I/O device handling is done in QEMU?

Thanks,
Vinod

      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Paul Brook | 1 Jan 2008 16:51
Gravatar

Re: adding a new PCI device support in QEMU

On Tuesday 01 January 2008, Vinod E wrote:
> Hi,
>    I have a special kind of PCI device on my system.
> I want QEMU to emulate that device and have Guest VM
> see that.  Can someone point me to any documentation
> available on how I/O device handling is done in QEMU?

Read the source. There are plenty of examples of PCI devices (e.g. USB host 
adapters, LSI scsi adapter and various network cards).

Paul

Blue Swirl | 1 Jan 2008 18:04
Picon

qemu/hw iommu.c sun4m.c sun4m.h

CVSROOT:	/cvsroot/qemu
Module name:	qemu
Changes by:	Blue Swirl <blueswir1>	08/01/01 17:04:45

Modified files:
	hw             : iommu.c sun4m.c sun4m.h 

Log message:
	 DVMA translation errors raise a module error irq (NMI)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/iommu.c?cvsroot=qemu&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemu&r1=1.77&r2=1.78
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.h?cvsroot=qemu&r1=1.7&r2=1.8

Blue Swirl | 1 Jan 2008 18:06
Picon

qemu/hw eccmemctl.c esp.c fdc.c iommu.c pcnet.c...

CVSROOT:	/cvsroot/qemu
Module name:	qemu
Changes by:	Blue Swirl <blueswir1>	08/01/01 17:06:39

Modified files:
	hw             : eccmemctl.c esp.c fdc.c iommu.c pcnet.c sbi.c 
	                 slavio_intctl.c slavio_misc.c slavio_serial.c 
	                 slavio_timer.c sparc32_dma.c sun4c_intctl.c 
	                 tcx.c 

Log message:
	 Register only valid register access widths

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/eccmemctl.c?cvsroot=qemu&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/esp.c?cvsroot=qemu&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/fdc.c?cvsroot=qemu&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/iommu.c?cvsroot=qemu&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/pcnet.c?cvsroot=qemu&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sbi.c?cvsroot=qemu&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_intctl.c?cvsroot=qemu&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_misc.c?cvsroot=qemu&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_serial.c?cvsroot=qemu&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_timer.c?cvsroot=qemu&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sparc32_dma.c?cvsroot=qemu&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4c_intctl.c?cvsroot=qemu&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/tcx.c?cvsroot=qemu&r1=1.25&r2=1.26

Blue Swirl | 1 Jan 2008 17:57
Picon

qemu cpu-all.h exec.c

CVSROOT:	/cvsroot/qemu
Module name:	qemu
Changes by:	Blue Swirl <blueswir1>	08/01/01 16:57:19

Modified files:
	.              : cpu-all.h exec.c 

Log message:
	 Support for registering address space only for some access widths

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/cpu-all.h?cvsroot=qemu&r1=1.80&r2=1.81
http://cvs.savannah.gnu.org/viewcvs/qemu/exec.c?cvsroot=qemu&r1=1.120&r2=1.121

Blue Swirl | 1 Jan 2008 18:07
Picon

qemu/target-sparc op_helper.c

CVSROOT:	/cvsroot/qemu
Module name:	qemu
Changes by:	Blue Swirl <blueswir1>	08/01/01 17:07:40

Modified files:
	target-sparc   : op_helper.c 

Log message:
	 More ASIs

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-sparc/op_helper.c?cvsroot=qemu&r1=1.64&r2=1.65

Dan Kenigsberg | 1 Jan 2008 19:35

[PATCH] (resend) Allow setting the vendor and model_id strings with x86's -cpu option

Would you consider the following patch, that allows users to set two
important x86 cpu options from the command line? (the vendor and
model_id strings)

Regards,
    Dan.

commit 04433bad959a7a4c1b8a0c22bd50eab9bf181b32
Author: Dan Kenigsberg <danken <at> qumranet.com>
Date:   Thu Dec 20 15:43:15 2007 +0200

    Change vendor string and model id from the -cpu command line option

diff --git a/target-i386/helper2.c b/target-i386/helper2.c
index 551a0d8..b59bf92 100644
--- a/target-i386/helper2.c
+++ b/target-i386/helper2.c
 <at>  <at>  -121,6 +121,7  <at>  <at>  typedef struct x86_def_t {
     const char *name;
     uint32_t level;
     uint32_t vendor1, vendor2, vendor3;
+    char model_id[48];
     int family;
     int model;
     int stepping;
 <at>  <at>  -262,7 +263,21  <at>  <at>  static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
                     goto error;
                 }
                 x86_cpu_def->stepping = stepping;
-            } else {
(Continue reading)

Aurelien Jarno | 1 Jan 2008 20:25

Re: qemu/hw slavio_intctl.c slavio_timer.c sun4m.c

On Sat, Dec 29, 2007 at 08:09:57PM +0000, Blue Swirl wrote:
> CVSROOT:	/cvsroot/qemu
> Module name:	qemu
> Changes by:	Blue Swirl <blueswir1>	07/12/29 20:09:57
> 
> Modified files:
> 	hw             : slavio_intctl.c slavio_timer.c sun4m.c 
> 
> Log message:
> 	 Fix CPU timer interrupts
> 
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_intctl.c?cvsroot=qemu&r1=1.26&r2=1.27
> http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_timer.c?cvsroot=qemu&r1=1.26&r2=1.27
> http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemu&r1=1.76&r2=1.77
> 

Unfortunately this commit has broken SS-5 running Linux:

[sparc] Booting file 'disk' with parameters ''
Not a bootable ELF image
Not a Linux kernel image
Loading a.out image...
Loaded 7680 bytes
entry point is 0x4000
Jumping to entry point...
SILO Version 1.4.13
boot:
Uncompressing image...
Loaded kernel version 2.6.18
(Continue reading)

Blue Swirl | 1 Jan 2008 21:00
Picon

Re: qemu/hw slavio_intctl.c slavio_timer.c sun4m.c

On 1/1/08, Aurelien Jarno <aurelien <at> aurel32.net> wrote:
> On Sat, Dec 29, 2007 at 08:09:57PM +0000, Blue Swirl wrote:
> > CVSROOT:      /cvsroot/qemu
> > Module name:  qemu
> > Changes by:   Blue Swirl <blueswir1>  07/12/29 20:09:57
> >
> > Modified files:
> >       hw             : slavio_intctl.c slavio_timer.c sun4m.c
> >
> > Log message:
> >        Fix CPU timer interrupts
> >
> > CVSWeb URLs:
> > http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_intctl.c?cvsroot=qemu&r1=1.26&r2=1.27
> > http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_timer.c?cvsroot=qemu&r1=1.26&r2=1.27
> > http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemu&r1=1.76&r2=1.77
> >
>
> Unfortunately this commit has broken SS-5 running Linux:

Thanks for the report, I can reproduce the bug. What a strange error!

The following patch hides the problem, but it also un-fixes the CPU
timer. I have to think of a better solution.

diff -u -r1.28 slavio_intctl.c
--- hw/slavio_intctl.c  1 Jan 2008 17:06:38 -0000       1.28
+++ hw/slavio_intctl.c  1 Jan 2008 19:52:22 -0000
 <at>  <at>  -257,7 +257,7  <at>  <at> 
                 if (pending & (1 << j))
(Continue reading)

Andreas Färber | 1 Jan 2008 21:25
Picon
Gravatar

Re: qemu/hw slavio_intctl.c slavio_timer.c sun4m.c


Am 01.01.2008 um 20:25 schrieb Aurelien Jarno:

> On Sat, Dec 29, 2007 at 08:09:57PM +0000, Blue Swirl wrote:
>> CVSROOT:	/cvsroot/qemu
>> Module name:	qemu
>> Changes by:	Blue Swirl <blueswir1>	07/12/29 20:09:57
>>
>> Modified files:
>> 	hw             : slavio_intctl.c slavio_timer.c sun4m.c
>>
>> Log message:
>> 	 Fix CPU timer interrupts
>>
>> CVSWeb URLs:
>> http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_intctl.c?cvsroot=qemu&r1=1.26&r2=1.27
>> http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_timer.c?cvsroot=qemu&r1=1.26&r2=1.27
>> http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemu&r1=1.76&r2=1.77
>>
>
> Unfortunately this commit has broken SS-5 running Linux:
>
>
> [sparc] Booting file 'disk' with parameters ''
> Not a bootable ELF image
> Not a Linux kernel image
> Loading a.out image...
> Loaded 7680 bytes
> entry point is 0x4000
> Jumping to entry point...
(Continue reading)


Gmane