NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-i386/38289 (a possible problem in x86 pmap_update)



The following reply was made to PR port-i386/38289; it has been noted by GNATS.

From: yamt%mwd.biglobe.ne.jp@localhost (YAMAMOTO Takashi)
To: gnats-bugs%NetBSD.org@localhost
Cc: port-i386-maintainer%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost,
        gnats-admin%netbsd.org@localhost, ad%NetBSD.org@localhost
Subject: Re: port-i386/38289 (a possible problem in x86 pmap_update)
Date: Sun, 30 Mar 2008 23:04:36 +0900 (JST)

 > Synopsis: a possible problem in x86 pmap_update
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: ad%NetBSD.org@localhost
 > State-Changed-When: Sat, 29 Mar 2008 14:17:43 +0000
 > State-Changed-Why:
 > pmap_deactivate() does the equivalent of pmap_update(). It's kind of ugly,
 > but it's an existing 'hook' in from the context switch code. Do you see
 > another problem?
 
 hm, it seems enough.  i haven't noticed the call in pmap_deactivate.
 
 i used to have the following debug code in my local tree while ago.
 sometimes it dropped into Debugger().  do you have any idea how it can happen?
 
 YAMAMOTO Takashi
 
 
 Index: i386/i386/genassym.cf
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/i386/i386/genassym.cf,v
 retrieving revision 1.61
 diff -u -p -r1.61 genassym.cf
 --- i386/i386/genassym.cf      11 Jan 2008 20:00:13 -0000      1.61
 +++ i386/i386/genassym.cf      20 Jan 2008 22:02:19 -0000
 @@ -309,6 +309,7 @@ define     TLBSTATE_VALID          TLBSTATE_VALID
  define        TLBSTATE_LAZY           TLBSTATE_LAZY
  define        TLBSTATE_STALE          TLBSTATE_STALE
  define        CPU_INFO_TLB_EVCNT      offsetof(struct cpu_info, ci_tlb_evcnt)
 +define        CPU_INFO_NEED_TLBWAIT   offsetof(struct cpu_info, 
ci_need_tlbwait)
  define        CPU_INFO_CURLWP         offsetof(struct cpu_info, ci_curlwp)
  define        CPU_INFO_IDLELWP        offsetof(struct cpu_info, 
ci_data.cpu_idlelwp)
  define        CPU_INFO_PMAP           offsetof(struct cpu_info, ci_pmap)
 Index: i386/i386/locore.S
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/i386/i386/locore.S,v
 retrieving revision 1.64
 diff -u -p -r1.64 locore.S
 --- i386/i386/locore.S 20 Jan 2008 12:43:00 -0000      1.64
 +++ i386/i386/locore.S 20 Jan 2008 22:02:19 -0000
 @@ -941,6 +941,12 @@ ENTRY(cpu_switchto)
        testl   %edx,%edx
        jnz     4f
  
 +      movl    CPUVAR(NEED_TLBWAIT),%eax
 +      orl     %eax,%eax
 +      jz,pn   .Ltlbwait_done
 +      call    _C_LABEL(pmap_tlb_shootwait2)
 +.Ltlbwait_done:
 +
  #ifdef XEN
        pushl   %edi
        call    _C_LABEL(i386_switch_context)
 Index: x86/x86/pmap.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/x86/x86/pmap.c,v
 retrieving revision 1.40
 diff -u -p -r1.40 pmap.c
 --- x86/x86/pmap.c     20 Jan 2008 21:56:11 -0000      1.40
 +++ x86/x86/pmap.c     20 Jan 2008 22:02:20 -0000
 @@ -4364,6 +4388,15 @@ pmap_tlb_shootdown(struct pmap *pm, vadd
   * => must be called with preemption disabled
   */
  
 +int shootwait2;
 +void pmap_tlb_shootwait2(void);
 +void
 +pmap_tlb_shootwait2(void)
 +{
 +      shootwait2++;
 +      Debugger();
 +      pmap_tlb_shootwait();
 +}
  void
  pmap_tlb_shootwait(void)
  {
 


Home | Main Index | Thread Index | Old Index