* [Qemu-devel] Interrupt request info @ 2006-10-28 9:36 Alessandro Corradi 2006-10-28 19:01 ` Rob Landley 0 siblings, 1 reply; 8+ messages in thread From: Alessandro Corradi @ 2006-10-28 9:36 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 604 bytes --] Hello, Can someone give me detailed information (or a link where it is described) how qemu manage hw interrupts? I can't find any usefull info about it in QEMU doc. For example, how does work Interrupts for the parallel port? (I see in the code that it is the easier device to understand how qemu works). I think that it is very usefull for students and newbies to have more detailed documentations about it for understanding virtualizzation/emulation. Thank you very much Ale ps: Obviously, if these information are already present I apologize me in advance, I try to search but nothing was found :) [-- Attachment #2: Type: text/html, Size: 642 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Interrupt request info 2006-10-28 9:36 [Qemu-devel] Interrupt request info Alessandro Corradi @ 2006-10-28 19:01 ` Rob Landley [not found] ` <b921df970610310125gf987001y8ce03fc1fb8ce363@mail.gmail.com> 0 siblings, 1 reply; 8+ messages in thread From: Rob Landley @ 2006-10-28 19:01 UTC (permalink / raw) To: qemu-devel On Saturday 28 October 2006 5:36 am, Alessandro Corradi wrote: > Hello, > Can someone give me detailed information (or a link where it is described) > how qemu manage hw interrupts? > I can't find any usefull info about it in QEMU doc. http://www.qemu.org/qemu-tech.html#SEC18 > ps: Obviously, if these information are already present I apologize me in > advance, I try to search but nothing was found :) The documentation is a bit sparse in places. Rob -- "Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away." - Antoine de Saint-Exupery ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <b921df970610310125gf987001y8ce03fc1fb8ce363@mail.gmail.com>]
* Fwd: [Qemu-devel] Interrupt request info [not found] ` <b921df970610310125gf987001y8ce03fc1fb8ce363@mail.gmail.com> @ 2006-11-01 9:19 ` Alessandro Corradi 2006-11-01 17:16 ` Paul Brook 0 siblings, 1 reply; 8+ messages in thread From: Alessandro Corradi @ 2006-11-01 9:19 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 2742 bytes --] ---------- Forwarded message ---------- From: Alessandro Corradi <ale.corradi@gmail.com> Date: 31-ott-2006 10.25 Subject: Re: [Qemu-devel] Interrupt request info To: Rob Landley <rob@landley.net> I already read this, but give no usefull information... and I searched everywhere in the web... For example, I wrote a module of a simple memory without implementing IRQ... I think it is an error but it works fine... are IRQ raise in any case??? I look at other code source of implemented hw but for each device there is a differeny way to raise an interrupt (i see). Is there a standard way to do this? The following is an excerpt of my simple memory, please can you describe me fastly how can I manage this? Thank you struct scmemState { uint32_t data; uint32_t addr; uint32_t control; uint32_t comm; int irq; int irq_pending; }; scmemState *scmem_init(int base, int irq){ scmemState *s; s=qemu_mallocz(sizeof(scmemState)); s->irq = irq; s->data = 0; s->addr = 0; s->control = 0; ... } static void scmem_ioport_write(void *opaque, uint32_t addr, uint32_t val) { scmemState *s = opaque; addr &= 7; switch(addr) { case 0: cosim(1,DATA,val); s->data = val; #ifdef SCDEBUG printf("Writing at 0x738 (data reg) value= %d\n",val); #endif break; case 1: cosim(1,ADDR,val); s->addr = val; #ifdef SCDEBUG printf("Writing at 0x739 (addr reg) value= %d\n",val); #endif break; case 2: cosim(1,CONTROL,val); s->control = val; #ifdef SCDEBUG printf("Writing at 0x74a (control reg) value= %d\n",val); #endif break; case 3: if (val == 0x0003) { //SC socket connection restore scmem_restore(); } else { cosim(1,COMM,val); s->comm = val; #ifdef SCDEBUG printf("Writing at 0x74b (comm reg) value= %d\n",val); #endif } break; } } 2006/10/28, Rob Landley < rob@landley.net >: > > On Saturday 28 October 2006 5:36 am, Alessandro Corradi wrote: > > Hello, > > Can someone give me detailed information (or a link where it is > described) > > how qemu manage hw interrupts? > > I can't find any usefull info about it in QEMU doc. > > http://www.qemu.org/qemu-tech.html#SEC18 > > > ps: Obviously, if these information are already present I apologize me > in > > advance, I try to search but nothing was found :) > > The documentation is a bit sparse in places. > > Rob > -- > "Perfection is reached, not when there is no longer anything to add, but > when there is no longer anything to take away." - Antoine de Saint-Exupery > [-- Attachment #2: Type: text/html, Size: 5071 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Fwd: [Qemu-devel] Interrupt request info 2006-11-01 9:19 ` Fwd: " Alessandro Corradi @ 2006-11-01 17:16 ` Paul Brook 0 siblings, 0 replies; 8+ messages in thread From: Paul Brook @ 2006-11-01 17:16 UTC (permalink / raw) To: qemu-devel > I already read this, but give no usefull information... and I searched > everywhere in the web... > For example, I wrote a module of a simple memory without implementing > IRQ... I think it is an error but it works fine... are IRQ raise in any > case??? I look at other code source of implemented hw but for each device > there is a differeny way to raise an interrupt (i see). > Is there a standard way to do this? pic_set_irq_new Paul ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <200611011205.1gFjwA1qs3Nl3pX2@cave.mail.atl.earthlink.net>]
* Re:[Qemu-devel] Interrupt request info [not found] <200611011205.1gFjwA1qs3Nl3pX2@cave.mail.atl.earthlink.net> @ 2006-11-01 23:25 ` Roger Lathrop 2006-11-01 23:31 ` [Qemu-devel] " Paul Brook 0 siblings, 1 reply; 8+ messages in thread From: Roger Lathrop @ 2006-11-01 23:25 UTC (permalink / raw) To: qemu-devel Alessandro, All you should need to do to raise an IRQ in your code is: pic_set_irq(s->irq,1); When the irq is serviced (in one of your ioport traps, I would assume), knock the irq down: pic_set_irq(s->irq,0); For debugging, you might want to go into i8259.c and uncomment the #define DEBUG_IRQ_COUNT line. You can then use command 'info irq' in the monitor console. This will show you a count of interrupts for each IRQ. Regards, Roger > For example, I wrote a module of a simple memory without implementing > IRQ... > I think it is an error but it works fine... are IRQ raise in any case??? > I look at other code source of implemented hw but for each device there is > a > differeny way to raise an interrupt (i see). > Is there a standard way to do this? > The following is an excerpt of my simple memory, please can you describe > me > fastly how can I manage this? > > Thank you ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Interrupt request info 2006-11-01 23:25 ` Roger Lathrop @ 2006-11-01 23:31 ` Paul Brook 2006-11-04 16:08 ` Alessandro Corradi ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Paul Brook @ 2006-11-01 23:31 UTC (permalink / raw) To: qemu-devel; +Cc: Roger Lathrop On Wednesday 01 November 2006 23:25, Roger Lathrop wrote: > Alessandro, > > All you should need to do to raise an IRQ in your code is: > pic_set_irq(s->irq,1); > > When the irq is serviced (in one of your ioport traps, I would assume), > knock the irq down: > pic_set_irq(s->irq,0); No. You should use pic_set_irq_new. Otherwise your code will break on machines with multiple interrupt controllers. Paul ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Interrupt request info 2006-11-01 23:31 ` [Qemu-devel] " Paul Brook @ 2006-11-04 16:08 ` Alessandro Corradi 2006-11-11 11:32 ` Alessandro Corradi 2006-11-12 15:46 ` Alessandro Corradi 2 siblings, 0 replies; 8+ messages in thread From: Alessandro Corradi @ 2006-11-04 16:08 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 1453 bytes --] Thank you very much for the answer, so the only think to do to raise correctly an interrupt (I think) is only to raise it when a read funciton is completed (in case of my simple memory) because it will alarm the process in waiting status to read the value in the register. the workaround of a read operation of a cell of this memory is: 1)write address of the cell that I want to read in the address register, 2)send the execution request to get the value of the cell indicated by the address reg (write on the command register the read opcode), 3)wait for control register response untill read operation is executed. 4)read the data register. so I think that interrupt request must be between point 3 and 4. Do you agree with my consideration? I hope that writed something understandable :) Thanks Ale 2006/11/2, Paul Brook <paul@codesourcery.com>: > > On Wednesday 01 November 2006 23:25, Roger Lathrop wrote: > > Alessandro, > > > > All you should need to do to raise an IRQ in your code is: > > pic_set_irq(s->irq,1); > > > > When the irq is serviced (in one of your ioport traps, I would assume), > > knock the irq down: > > pic_set_irq(s->irq,0); > > No. You should use pic_set_irq_new. Otherwise your code will break on > machines > with multiple interrupt controllers. > > Paul > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > [-- Attachment #2: Type: text/html, Size: 1913 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Interrupt request info 2006-11-01 23:31 ` [Qemu-devel] " Paul Brook 2006-11-04 16:08 ` Alessandro Corradi @ 2006-11-11 11:32 ` Alessandro Corradi 2006-11-12 15:46 ` Alessandro Corradi 2 siblings, 0 replies; 8+ messages in thread From: Alessandro Corradi @ 2006-11-11 11:32 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 1000 bytes --] Thank you very much, But I don't understand what the first parameter is on pic_set_irq_new... I tried anyway to implement my hw with pic_set_irq, but in qemu console I didn't see my irq (13) with info irq. I tried to raise it: pic_set_irq(s->irq,1); What I need to do to raise irq correctly with pic_set_irq_new specially the first parameter)? Thank you 2006/11/2, Paul Brook <paul@codesourcery.com>: > > On Wednesday 01 November 2006 23:25, Roger Lathrop wrote: > > Alessandro, > > > > All you should need to do to raise an IRQ in your code is: > > pic_set_irq(s->irq,1); > > > > When the irq is serviced (in one of your ioport traps, I would assume), > > knock the irq down: > > pic_set_irq(s->irq,0); > > No. You should use pic_set_irq_new. Otherwise your code will break on > machines > with multiple interrupt controllers. > > Paul > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > [-- Attachment #2: Type: text/html, Size: 1437 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Interrupt request info 2006-11-01 23:31 ` [Qemu-devel] " Paul Brook 2006-11-04 16:08 ` Alessandro Corradi 2006-11-11 11:32 ` Alessandro Corradi @ 2006-11-12 15:46 ` Alessandro Corradi 2 siblings, 0 replies; 8+ messages in thread From: Alessandro Corradi @ 2006-11-12 15:46 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 1032 bytes --] I tried with both pic_set_irq and pic_set_irq_new but nothing happen (the irq number is 13 and I verified with info irq in qemu monitor). I tried also to hack i8259.c and the function is not called (I think). What the first parameter of pic_set_irq_new is referred to? Another question: why a new virtual device works anyway without interrupt mechanism? isn't it essential? Thanks Ale 2006/11/2, Paul Brook <paul@codesourcery.com>: > > On Wednesday 01 November 2006 23:25, Roger Lathrop wrote: > > Alessandro, > > > > All you should need to do to raise an IRQ in your code is: > > pic_set_irq(s->irq,1); > > > > When the irq is serviced (in one of your ioport traps, I would assume), > > knock the irq down: > > pic_set_irq(s->irq,0); > > No. You should use pic_set_irq_new. Otherwise your code will break on > machines > with multiple interrupt controllers. > > Paul > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > [-- Attachment #2: Type: text/html, Size: 1470 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-11-12 15:46 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-10-28 9:36 [Qemu-devel] Interrupt request info Alessandro Corradi 2006-10-28 19:01 ` Rob Landley [not found] ` <b921df970610310125gf987001y8ce03fc1fb8ce363@mail.gmail.com> 2006-11-01 9:19 ` Fwd: " Alessandro Corradi 2006-11-01 17:16 ` Paul Brook [not found] <200611011205.1gFjwA1qs3Nl3pX2@cave.mail.atl.earthlink.net> 2006-11-01 23:25 ` Roger Lathrop 2006-11-01 23:31 ` [Qemu-devel] " Paul Brook 2006-11-04 16:08 ` Alessandro Corradi 2006-11-11 11:32 ` Alessandro Corradi 2006-11-12 15:46 ` Alessandro Corradi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).