public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [ANNOUNCE] kvm-37 release
@ 2007-09-09 11:05 Avi Kivity
  2007-09-09 14:26 ` Jindrich Makovicka
       [not found] ` <46E3D369.8000401-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Avi Kivity @ 2007-09-09 11:05 UTC (permalink / raw)
  To: kvm-devel

This release merges the pic/lapic/ioapic into mainline.  While some 
known issues exist, we're now at the point where it's better to get some 
wider exposure rather than keep it alone on a branch.

Some regressions are expected; please report them as they appear.  A new 
qmeu option -no-kvm-irqchip is available to disable the new functionality.

While many people are listed in the credits for this effort, I'd like to 
thank Eddie and Qing for persevering and doing the hard work of actually 
getting it in a form suitable for inclusion and fixing the bugs.  This 
release is mostly their work.

Changes since kvm-36:
- in-kernel lapic, ioapic, and pic (Eddie Dong, Qing He, Sheng Yang, 
Gregory Haskins, Dor Laor, me)
- split segment reload (vmx microoptimization) (Laurent Vivier)
- fix vga redraw regression (Izik Eidus)
- fix testsuite compilation with older assemblers (H. Peter Anvin)

Notes:
    If you use the modules bundled with kvm-37, you can use any version
of Linux from 2.6.9 upwards.
    If you use the modules bundled with Linux 2.6.20, you need to use
kvm-12.
    If you use the modules bundled with Linux 2.6.21, you need to use
kvm-17.
    Modules from Linux 2.6.22 and up will work with any kvm version from
kvm-22.  Some features may only be available in newer releases.
    For best performance, use Linux 2.6.23-rc2 or later as the host.

http://kvm.qumranet.com



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] kvm-37 release
  2007-09-09 11:05 [ANNOUNCE] kvm-37 release Avi Kivity
@ 2007-09-09 14:26 ` Jindrich Makovicka
       [not found] ` <46E3D369.8000401-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Jindrich Makovicka @ 2007-09-09 14:26 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

On Sun, 09 Sep 2007 14:05:13 +0300
Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:

> This release merges the pic/lapic/ioapic into mainline.  While some 
> known issues exist, we're now at the point where it's better to get
> some wider exposure rather than keep it alone on a branch.
> 
> Some regressions are expected; please report them as they appear.  A
> new qmeu option -no-kvm-irqchip is available to disable the new
> functionality.

My experience so far:

On 32-bit Intel host, lapic fails to link due to missing 64bit
division. I tried the attached patch to fix the build, but Windows
XP froze before showing the booting screen. With -no-kvm-irqchip
they work, except the IE plugins like Flash & Java, which are broken
since kvm-29. With -no-kvm, qemu-system-x86_64 segfaults immediately.

Regards,
-- 
Jindrich Makovicka

[-- Attachment #2: lapic.c.diff --]
[-- Type: text/x-patch, Size: 589 bytes --]

--- lapic.c~	2007-09-09 12:51:09.000000000 +0200
+++ lapic.c	2007-09-09 16:12:38.000000000 +0200
@@ -31,6 +31,7 @@
 #include <asm/current.h>
 #include <asm/apicdef.h>
 #include <asm/atomic.h>
+#include <asm/div64.h>
 #include "irq.h"
 
 #define PRId64 "d"
@@ -511,8 +512,8 @@
 	} else
 		passed = ktime_sub(now, apic->timer.last_update);
 
-	counter_passed = ktime_to_ns(passed) /
-	    (APIC_BUS_CYCLE_NS * apic->timer.divide_count);
+	counter_passed = div64_64(ktime_to_ns(passed),
+				  (APIC_BUS_CYCLE_NS * apic->timer.divide_count));
 	tmcct -= counter_passed;
 
 	if (tmcct <= 0) {

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* kvm-37 problem w/ 64-bit division in lapic.c
       [not found] ` <46E3D369.8000401-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-09 15:36   ` Jindrich Makovicka
  2007-09-09 15:45     ` Avi Kivity
  2007-09-10  9:20     ` Dong, Eddie
  0 siblings, 2 replies; 10+ messages in thread
From: Jindrich Makovicka @ 2007-09-09 15:36 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

On Sun, 09 Sep 2007 14:05:13 +0300
Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:

> This release merges the pic/lapic/ioapic into mainline.  While some 
> known issues exist, we're now at the point where it's better to get
> some wider exposure rather than keep it alone on a branch.
> 
> Some regressions are expected; please report them as they appear.  A
> new qmeu option -no-kvm-irqchip is available to disable the new
> functionality.

(message seems to get stuck at gmane, sorry if it appears twice
eventually)

My experience so far:

On 32-bit Intel host, lapic fails to link due to missing 64bit
division. I tried the attached patch to fix the build, but Windows
XP froze before showing the booting screen. With -no-kvm-irqchip
they work, except the IE plugins like Flash & Java, which are broken
since kvm-29. With -no-kvm, qemu-system-x86_64 segfaults immediately.

Regards,
-- 
Jindrich Makovicka

[-- Attachment #2: lapic.c.diff --]
[-- Type: text/x-patch, Size: 589 bytes --]

--- lapic.c~	2007-09-09 12:51:09.000000000 +0200
+++ lapic.c	2007-09-09 16:12:38.000000000 +0200
@@ -31,6 +31,7 @@
 #include <asm/current.h>
 #include <asm/apicdef.h>
 #include <asm/atomic.h>
+#include <asm/div64.h>
 #include "irq.h"
 
 #define PRId64 "d"
@@ -511,8 +512,8 @@
 	} else
 		passed = ktime_sub(now, apic->timer.last_update);
 
-	counter_passed = ktime_to_ns(passed) /
-	    (APIC_BUS_CYCLE_NS * apic->timer.divide_count);
+	counter_passed = div64_64(ktime_to_ns(passed),
+				  (APIC_BUS_CYCLE_NS * apic->timer.divide_count));
 	tmcct -= counter_passed;
 
 	if (tmcct <= 0) {

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kvm-37 problem w/ 64-bit division in lapic.c
  2007-09-09 15:36   ` kvm-37 problem w/ 64-bit division in lapic.c Jindrich Makovicka
@ 2007-09-09 15:45     ` Avi Kivity
  2007-09-10  9:20     ` Dong, Eddie
  1 sibling, 0 replies; 10+ messages in thread
From: Avi Kivity @ 2007-09-09 15:45 UTC (permalink / raw)
  To: Jindrich Makovicka; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Jindrich Makovicka wrote:
> On Sun, 09 Sep 2007 14:05:13 +0300
> Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
>
>   
>> This release merges the pic/lapic/ioapic into mainline.  While some 
>> known issues exist, we're now at the point where it's better to get
>> some wider exposure rather than keep it alone on a branch.
>>
>> Some regressions are expected; please report them as they appear.  A
>> new qmeu option -no-kvm-irqchip is available to disable the new
>> functionality.
>>     
>
> (message seems to get stuck at gmane, sorry if it appears twice
> eventually)
>
> My experience so far:
>
> On 32-bit Intel host, lapic fails to link due to missing 64bit
> division. I tried the attached patch to fix the build, but Windows
> XP froze before showing the booting screen. With -no-kvm-irqchip
> they work, except the IE plugins like Flash & Java, which are broken
> since kvm-29. With -no-kvm, qemu-system-x86_64 segfaults immediately.
>
>   

Applied, thanks.  Please supply a signed-off-by line with future patches.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kvm-37 problem w/ 64-bit division in lapic.c
  2007-09-09 15:36   ` kvm-37 problem w/ 64-bit division in lapic.c Jindrich Makovicka
  2007-09-09 15:45     ` Avi Kivity
@ 2007-09-10  9:20     ` Dong, Eddie
       [not found]       ` <10EA09EFD8728347A513008B6B0DA77A02108583-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Dong, Eddie @ 2007-09-10  9:20 UTC (permalink / raw)
  To: Jindrich Makovicka, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote:
> On Sun, 09 Sep 2007 14:05:13 +0300
> Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> 
>> This release merges the pic/lapic/ioapic into mainline.  While some
>> known issues exist, we're now at the point where it's better to get
>> some wider exposure rather than keep it alone on a branch.
>> 
>> Some regressions are expected; please report them as they appear.  A
>> new qmeu option -no-kvm-irqchip is available to disable the new
>> functionality.
> 
> (message seems to get stuck at gmane, sorry if it appears twice
> eventually) 
> 
> My experience so far:
> 
> On 32-bit Intel host, lapic fails to link due to missing 64bit
> division. I tried the attached patch to fix the build, but Windows
> XP froze before showing the booting screen. With -no-kvm-irqchip
> they work, except the IE plugins like Flash & Java, which are broken
> since kvm-29. With -no-kvm, qemu-system-x86_64 segfaults immediately.
> 
> Regards,
> --
> Jindrich Makovicka

div64_32 is enough, does this function exist?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kvm-37 problem w/ 64-bit division in lapic.c
       [not found]       ` <10EA09EFD8728347A513008B6B0DA77A02108583-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-09-10  9:49         ` Jindrich Makovicka
       [not found]           ` <5f0e26840709100249y239692c2gcdd3938fc6b23b6c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Jindrich Makovicka @ 2007-09-10  9:49 UTC (permalink / raw)
  To: Dong, Eddie; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 9/10/07, Dong, Eddie <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote:
> > On Sun, 09 Sep 2007 14:05:13 +0300
> > Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> >
> >> This release merges the pic/lapic/ioapic into mainline.  While some
> >> known issues exist, we're now at the point where it's better to get
> >> some wider exposure rather than keep it alone on a branch.
> >>
> >> Some regressions are expected; please report them as they appear.  A
> >> new qmeu option -no-kvm-irqchip is available to disable the new
> >> functionality.
> >
> > (message seems to get stuck at gmane, sorry if it appears twice
> > eventually)
> >
> > My experience so far:
> >
> > On 32-bit Intel host, lapic fails to link due to missing 64bit
> > division. I tried the attached patch to fix the build, but Windows
> > XP froze before showing the booting screen. With -no-kvm-irqchip
> > they work, except the IE plugins like Flash & Java, which are broken
> > since kvm-29. With -no-kvm, qemu-system-x86_64 segfaults immediately.
> >
> > Regards,
> > --
> > Jindrich Makovicka
>
> div64_32 is enough, does this function exist?

afaik, __div64_32 is architecture specific, but do_div() could be
actually used here.

-- 
Jindrich Makovicka

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kvm-37 problem w/ 64-bit division in lapic.c
       [not found]           ` <5f0e26840709100249y239692c2gcdd3938fc6b23b6c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-09-10 16:26             ` Jindrich Makovicka
  2007-09-12  8:05               ` Avi Kivity
  0 siblings, 1 reply; 10+ messages in thread
From: Jindrich Makovicka @ 2007-09-10 16:26 UTC (permalink / raw)
  To: Jindrich Makovicka; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

On Mon, 10 Sep 2007 11:49:02 +0200
"Jindrich Makovicka" <makovick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> On 9/10/07, Dong, Eddie <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> > div64_32 is enough, does this function exist?
> 
> afaik, __div64_32 is architecture specific, but do_div() could be
> actually used here.

This version should be faster.

Signed-off-by: Jindrich Makovicka <makovick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

-- 
Jindrich Makovicka

[-- Attachment #2: lapic.c.diff2 --]
[-- Type: application/octet-stream, Size: 673 bytes --]

--- lapic.c~	2007-09-09 16:12:38.000000000 +0200
+++ lapic.c	2007-09-10 18:16:34.000000000 +0200
@@ -494,7 +494,7 @@
 
 static u32 apic_get_tmcct(struct kvm_lapic *apic)
 {
-	u32 counter_passed;
+	u64 counter_passed;
 	ktime_t passed, now = apic->timer.dev.base->get_time();
 	u32 tmcct = apic_get_reg(apic, APIC_TMICT);
 
@@ -512,8 +512,8 @@
 	} else
 		passed = ktime_sub(now, apic->timer.last_update);
 
-	counter_passed = div64_64(ktime_to_ns(passed),
-				  (APIC_BUS_CYCLE_NS * apic->timer.divide_count));
+	counter_passed = ktime_to_ns(passed);
+	do_div(counter_passed, APIC_BUS_CYCLE_NS * apic->timer.divide_count);
 	tmcct -= counter_passed;
 
 	if (tmcct <= 0) {

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kvm-37 problem w/ 64-bit division in lapic.c
  2007-09-10 16:26             ` Jindrich Makovicka
@ 2007-09-12  8:05               ` Avi Kivity
       [not found]                 ` <46E79DCA.70101-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2007-09-12  8:05 UTC (permalink / raw)
  To: Jindrich Makovicka; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Jindrich Makovicka wrote:
> On Mon, 10 Sep 2007 11:49:02 +0200
> "Jindrich Makovicka" <makovick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>   
>> On 9/10/07, Dong, Eddie <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
>>     
>>> div64_32 is enough, does this function exist?
>>>       
>> afaik, __div64_32 is architecture specific, but do_div() could be
>> actually used here.
>>     
>
> This version should be faster.
>
>   

[please don't post patches with extensions like ".diff2", which don't 
show in the mail reader]

> -       u32 counter_passed;
> +       u64 counter_passed;
>         ktime_t passed, now = apic->timer.dev.base->get_time();
>         u32 tmcct = apic_get_reg(apic, APIC_TMICT);
>
> @@ -512,8 +512,8 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
>         } else
>                 passed = ktime_sub(now, apic->timer.last_update);
>
> -       counter_passed = div64_64(ktime_to_ns(passed),
> -                                 (APIC_BUS_CYCLE_NS * 
> apic->timer.divide_count));
> +       counter_passed = ktime_to_ns(passed);
> +       do_div(counter_passed, APIC_BUS_CYCLE_NS * 
> apic->timer.divide_count);
>         tmcct -= counter_passed;

What if counter_passed overflows?  Sure, that means kvm wasn't scheduled 
for 4 seconds, but it could happen.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kvm-37 problem w/ 64-bit division in lapic.c
       [not found]                 ` <46E79DCA.70101-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-12  9:43                   ` Dong, Eddie
       [not found]                     ` <10EA09EFD8728347A513008B6B0DA77A0210915A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Dong, Eddie @ 2007-09-12  9:43 UTC (permalink / raw)
  To: Avi Kivity, Jindrich Makovicka; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote:
> Jindrich Makovicka wrote:
>> On Mon, 10 Sep 2007 11:49:02 +0200
>> "Jindrich Makovicka" <makovick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> 
>> 
>>> On 9/10/07, Dong, Eddie <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
>>> 
>>>> div64_32 is enough, does this function exist?
>>>> 
>>> afaik, __div64_32 is architecture specific, but do_div() could be
>>> actually used here. 
>>> 
>> 
>> This version should be faster.
>> 
>> 
> 
> [please don't post patches with extensions like ".diff2", which don't
> show in the mail reader] 
> 
>> -       u32 counter_passed;
>> +       u64 counter_passed;
>>         ktime_t passed, now = apic->timer.dev.base->get_time();
>>         u32 tmcct = apic_get_reg(apic, APIC_TMICT);
>> 
>> @@ -512,8 +512,8 @@ static u32 apic_get_tmcct(struct kvm_lapic
>>                 *apic)         } else passed = ktime_sub(now,
>> apic->timer.last_update); 
>> 
>> -       counter_passed = div64_64(ktime_to_ns(passed),
>> -                                 (APIC_BUS_CYCLE_NS *
>> apic->timer.divide_count)); +       counter_passed =
>> ktime_to_ns(passed); +       do_div(counter_passed,
>> APIC_BUS_CYCLE_NS * apic->timer.divide_count);
>>         tmcct -= counter_passed;
> 
> What if counter_passed overflows?  Sure, that means kvm wasn't
> scheduled for 4 seconds, but it could happen.
> 
> 
It won't happen. see
 passed = ktime_sub(now, apic->timer.last_update);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kvm-37 problem w/ 64-bit division in lapic.c
       [not found]                     ` <10EA09EFD8728347A513008B6B0DA77A0210915A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-09-12  9:56                       ` Avi Kivity
  0 siblings, 0 replies; 10+ messages in thread
From: Avi Kivity @ 2007-09-12  9:56 UTC (permalink / raw)
  To: Dong, Eddie
  Cc: Jindrich Makovicka, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Dong, Eddie wrote:
> kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote:
>   
>> Jindrich Makovicka wrote:
>>     
>>> On Mon, 10 Sep 2007 11:49:02 +0200
>>> "Jindrich Makovicka" <makovick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>
>>>
>>>       
>>>> On 9/10/07, Dong, Eddie <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
>>>>
>>>>         
>>>>> div64_32 is enough, does this function exist?
>>>>>
>>>>>           
>>>> afaik, __div64_32 is architecture specific, but do_div() could be
>>>> actually used here. 
>>>>
>>>>         
>>> This version should be faster.
>>>
>>>
>>>       
>> [please don't post patches with extensions like ".diff2", which don't
>> show in the mail reader] 
>>
>>     
>>> -       u32 counter_passed;
>>> +       u64 counter_passed;
>>>         ktime_t passed, now = apic->timer.dev.base->get_time();
>>>         u32 tmcct = apic_get_reg(apic, APIC_TMICT);
>>>
>>> @@ -512,8 +512,8 @@ static u32 apic_get_tmcct(struct kvm_lapic
>>>                 *apic)         } else passed = ktime_sub(now,
>>> apic->timer.last_update); 
>>>
>>> -       counter_passed = div64_64(ktime_to_ns(passed),
>>> -                                 (APIC_BUS_CYCLE_NS *
>>> apic->timer.divide_count)); +       counter_passed =
>>> ktime_to_ns(passed); +       do_div(counter_passed,
>>> APIC_BUS_CYCLE_NS * apic->timer.divide_count);
>>>         tmcct -= counter_passed;
>>>       
>> What if counter_passed overflows?  Sure, that means kvm wasn't
>> scheduled for 4 seconds, but it could happen.
>>
>>
>>     
> It won't happen. see
>  passed = ktime_sub(now, apic->timer.last_update);
>   

Ah, okay.

I'll clean it up later.  I'd like to proceed with the more important 
fixes first.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-09-12  9:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-09 11:05 [ANNOUNCE] kvm-37 release Avi Kivity
2007-09-09 14:26 ` Jindrich Makovicka
     [not found] ` <46E3D369.8000401-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-09 15:36   ` kvm-37 problem w/ 64-bit division in lapic.c Jindrich Makovicka
2007-09-09 15:45     ` Avi Kivity
2007-09-10  9:20     ` Dong, Eddie
     [not found]       ` <10EA09EFD8728347A513008B6B0DA77A02108583-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-09-10  9:49         ` Jindrich Makovicka
     [not found]           ` <5f0e26840709100249y239692c2gcdd3938fc6b23b6c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-09-10 16:26             ` Jindrich Makovicka
2007-09-12  8:05               ` Avi Kivity
     [not found]                 ` <46E79DCA.70101-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-12  9:43                   ` Dong, Eddie
     [not found]                     ` <10EA09EFD8728347A513008B6B0DA77A0210915A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-09-12  9:56                       ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox