[Bug 151] New: JSR 133 Cookbook memory barrier definitions needed for SMP

[email protected] Sat, 23 Jul 2005 16:27:00 -0400
Newsgroups gmane.comp.java.vm.sablevm.bugs
Message-ID <[email protected]>
http://sablevm.org/bugs/show_bug.cgi?id=151

           Summary: JSR 133 Cookbook memory barrier definitions needed for
                    SMP
           Product: SableVM
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
                CC: [email protected]


In order to make SableVM work on SMP, we need to insert barriers at the right
places.  Therefore, we need to define the necessary barriers in assemly.  I have
defined _svmf_store_load_barrier() in my sandbox for x86 and x86_64.

http://gee.cs.oswego.edu/dl/jmm/cookbook.html

For x86:

  __asm__ __volatile__ ("lock\n\t"
                        "addl $0, 0(%%esp)\n\t"
                        :
                        :
                        : "memory", "cc", "%esp");

(not sure about the clobbers)

For x86_64:

  __asm__ __volatile__ ("mfence\n\t"
                        :
                        :
                        : "memory");

According to the Cookbook, I also need a LoadLoad barrier for x86_64 in certain
instances, implemented as lfence, when a StoreLoad barrier is not good enough.



------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.