WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix "timer tick before its due"

ChangeSet 1.1305.1.6, 2005/03/16 17:47:40-07:00, djm@xxxxxxxxxxxxxxx

        Fix "timer tick before its due"



 arch/ia64/vcpu.c          |   33 ++++++++++++++++++++++++++++++---
 include/asm-ia64/config.h |    2 +-
 2 files changed, 31 insertions(+), 4 deletions(-)


diff -Nru a/xen/arch/ia64/vcpu.c b/xen/arch/ia64/vcpu.c
--- a/xen/arch/ia64/vcpu.c      2005-03-25 19:04:19 -05:00
+++ b/xen/arch/ia64/vcpu.c      2005-03-25 19:04:19 -05:00
@@ -511,6 +511,13 @@
        set_bit(vector,PSCB(vcpu,irr));
 }
 
+void early_tick(VCPU *vcpu)
+{
+       UINT64 *p = &PSCB(vcpu,irr[3]);
+       printf("vcpu_check_pending: about to deliver early tick\n");
+       printf("&irr[0]=%p, irr[0]=0x%lx\n",p,*p);
+}
+
 #define        IA64_TPR_MMI    0x10000
 #define        IA64_TPR_MIC    0x000f0
 
@@ -563,6 +570,14 @@
        }
 
 //printf("returned to caller\n");
+#if 0
+if (vector == (PSCB(vcpu,itv) & 0xff)) {
+       UINT64 now = ia64_get_itc();
+       UINT64 itm = PSCB(vcpu,domain_itm);
+       if (now < itm) early_tick(vcpu);
+       
+}
+#endif
        return vector;
 }
 
@@ -815,14 +830,21 @@
        return(!itv || !!(itv & 0x10000));
 }
 
+BOOLEAN vcpu_timer_inservice(VCPU *vcpu)
+{
+       UINT64 itv = PSCB(vcpu,itv);
+       return (test_bit(itv, PSCB(vcpu,insvc)));
+}
+
 BOOLEAN vcpu_timer_expired(VCPU *vcpu)
 {
        unsigned long domain_itm = PSCB(vcpu,domain_itm);
        unsigned long now = ia64_get_itc();
  
-       if (domain_itm && (now > domain_itm) &&
-               !vcpu_timer_disabled(vcpu)) return TRUE;
-       return FALSE;
+       if (!domain_itm) return FALSE;
+       if (now < domain_itm) return FALSE;
+       if (vcpu_timer_disabled(vcpu)) return FALSE;
+       return TRUE;
 }
 
 void vcpu_safe_set_itm(unsigned long val)
@@ -956,6 +978,7 @@
        UINT64 itv = PSCB(vcpu,itv) & 0xff;
 
        if (vcpu_timer_disabled(vcpu)) return;
+       if (vcpu_timer_inservice(vcpu)) return;
 #if 1
        // attempt to flag "timer tick before its due" source
        {
@@ -1071,6 +1094,7 @@
 
 IA64FAULT vcpu_cover(VCPU *vcpu)
 {
+       // TODO: Only allowed for current vcpu
        REGS *regs = vcpu_regs(vcpu);
 
        if (!PSCB(vcpu,interrupt_collection_enabled)) {
@@ -1229,6 +1253,7 @@
 
 IA64FAULT vcpu_bsw0(VCPU *vcpu)
 {
+       // TODO: Only allowed for current vcpu
        REGS *regs = vcpu_regs(vcpu);
        unsigned long *r = &regs->r16;
        unsigned long *b0 = &PSCB(vcpu,bank0_regs[0]);
@@ -1244,6 +1269,7 @@
 
 IA64FAULT vcpu_bsw1(VCPU *vcpu)
 {
+       // TODO: Only allowed for current vcpu
        REGS *regs = vcpu_regs(vcpu);
        unsigned long *r = &regs->r16;
        unsigned long *b0 = &PSCB(vcpu,bank0_regs[0]);
@@ -1535,6 +1561,7 @@
 // on the physical address, which is guaranteed to flush the same cache line
 IA64FAULT vcpu_fc(VCPU *vcpu, UINT64 vadr)
 {
+       // TODO: Only allowed for current vcpu
        UINT64 mpaddr, ps;
        IA64FAULT fault;
        unsigned long match_dtlb(VCPU *, unsigned long, unsigned long *, 
unsigned long *);
diff -Nru a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h     2005-03-25 19:04:19 -05:00
+++ b/xen/include/asm-ia64/config.h     2005-03-25 19:04:19 -05:00
@@ -1,6 +1,6 @@
 // control flags for turning on/off features under test
 #undef CLONE_DOMAIN0
-//#define CLONE_DOMAIN0 1
+//#define CLONE_DOMAIN0 5
 
 // manufactured from component pieces
 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix "timer tick before its due", BitKeeper Bot <=