From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dor Laor Subject: Re: [RFC] qemu: simulate edge-triggered interrupt in master PIC for time-drift-fix Date: Sat, 10 Nov 2007 00:35:34 +0200 Message-ID: <4734E0B6.6030109@qumranet.com> References: <20071109172210.GC1330@tapir> <20071109175721.GD1330@tapir> Reply-To: dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1884242823==" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Carlo Marcelo Arenas Belon Return-path: In-Reply-To: <20071109175721.GD1330@tapir> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --===============1884242823== Content-Type: multipart/alternative; boundary="------------030703020905080107090805" This is a multi-part message in MIME format. --------------030703020905080107090805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Carlo Marcelo Arenas Belon wrote: > wrong patch, this was meant to go to the slave PIC, so it will use s->pics[1] > instead of s->pics[0]. > > Why to the slave pic? Isn't the pit connected to line 0 of the master? > also from my tests it might seem that tdf is irrelevant anyway with the new > clock work and haven't been able to find a case where enabling it (so > triggering this buggy code path) migh be needed. > > any one care to comment on any current users of tdf? and if there are none in > the viability for removing it? > > It does work but only for non-acpi guest that has the -no-kvm-irqchip parameter. To test it you can load your host and see what happens to the clock when you run a 1000HZ guest (use taskset to pin the guest with other cpu intensive tasks.) We decided not to fix it in the in-kernel pic since once the tpr optimization enable running acpi/apic guests and thus the pic is not used as time source. Dor. > Carlo > > On Fri, Nov 09, 2007 at 11:22:10AM -0600, Carlo Marcelo Arenas Belon wrote: > >> The following patch fixes 1a483ef4040ed380bf69d684783d06a617073256 so that the >> parent PIC pointer is used to send the edge irq0 instead of the PIC pair and >> that is an incompatible pointer type as reported in : >> >> /var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/hw/i8259.c: In function >> ` >> pic_read_irq': >> /var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/hw/i8259.c:248: >> warning: passing arg 1 of `pic_set_irq1' from incompatible pointer type >> /var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/hw/i8259.c:249: >> warning: passing arg 1 of `pic_set_irq1' from incompatible pointer type >> >> Signed-off-by: Carlo Marcelo Arenas Belon >> --- >> qemu/hw/i8259.c | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/qemu/hw/i8259.c b/qemu/hw/i8259.c >> index 01447d7..60063d4 100644 >> --- a/qemu/hw/i8259.c >> +++ b/qemu/hw/i8259.c >> @@ -245,8 +245,8 @@ int pic_read_irq(PicState2 *s) >> if (timer_ints_to_push > 0) { >> timer_ints_to_push--; >> /* simulate an edge irq0, like the one generated by i8254 */ >> - pic_set_irq1(s, 0, 0); >> - pic_set_irq1(s, 0, 1); >> + pic_set_irq1(&s->pics[0], 0, 0); >> + pic_set_irq1(&s->pics[0], 0, 1); >> } >> } >> >> -- >> 1.5.2.5 >> >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > kvm-devel mailing list > kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/kvm-devel > > --------------030703020905080107090805 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Carlo Marcelo Arenas Belon wrote:
wrong patch, this was meant to go to the slave PIC, so it will use s->pics[1]
instead of s->pics[0].

  
Why to the slave pic? Isn't the pit connected to line 0 of the master?
also from my tests it might seem that tdf is irrelevant anyway with the new
clock work and haven't been able to find a case where enabling it (so
triggering this buggy code path) migh be needed.

any one care to comment on any current users of tdf? and if there are none in
the viability for removing it?

  
It does work but only for non-acpi guest that has the -no-kvm-irqchip parameter.
To test it you can load your host and see what happens to the clock when you run
a 1000HZ guest (use taskset to pin the guest with other cpu intensive tasks.)
We decided not to fix it in the in-kernel pic since once the tpr optimization enable
running acpi/apic guests and thus the pic is not used as time source.
Dor.
Carlo

On Fri, Nov 09, 2007 at 11:22:10AM -0600, Carlo Marcelo Arenas Belon wrote:
  
The following patch fixes 1a483ef4040ed380bf69d684783d06a617073256 so that the
parent PIC pointer is used to send the edge irq0 instead of the PIC pair and
that is an incompatible pointer type as reported in :

/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/hw/i8259.c: In function
`
pic_read_irq':
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/hw/i8259.c:248:
warning: passing arg 1 of `pic_set_irq1' from incompatible pointer type
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/hw/i8259.c:249:
warning: passing arg 1 of `pic_set_irq1' from incompatible pointer type

Signed-off-by: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
---
 qemu/hw/i8259.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu/hw/i8259.c b/qemu/hw/i8259.c
index 01447d7..60063d4 100644
--- a/qemu/hw/i8259.c
+++ b/qemu/hw/i8259.c
@@ -245,8 +245,8 @@ int pic_read_irq(PicState2 *s)
 	    if (timer_ints_to_push > 0) {
 		timer_ints_to_push--;
                 /* simulate an edge irq0, like the one generated by i8254 */
-                pic_set_irq1(s, 0, 0);
-                pic_set_irq1(s, 0, 1);
+                pic_set_irq1(&s->pics[0], 0, 0);
+                pic_set_irq1(&s->pics[0], 0, 1);
 	    }
 	}
 
-- 
1.5.2.5

    

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

  

--------------030703020905080107090805-- --===============1884242823== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --===============1884242823== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============1884242823==--