Re: powerpc sync and eieio instructions
- From: lc.flno@xxxxxxxxx
- Date: Mon, 28 Apr 2008 08:57:35 -0700 (PDT)
Here is an imprecise non-authoritative summary:
eieio- prevents the CPU from reordering memory accesses.
The best example is when a program needs to update
peripheral registers in a particular order.
Hi, I've read some references about eieio instruction use but I've
still some doubts.
The code that confused me is that (about MMU initialization):
Page Table Updates (from MPC7450UM -> 5.5.3)
Thus the following code should be used:
/* Code for Modifying a Page Table Entry */
/* First delete the current page table entry */
PTEV <- 0/* (other fields don’t matter) */
sync /* ensure update completed */
tlbie(old_EA) /* invalidate old translation */
eieio /* order tlbie before tlbsync */
tlbsync /* ensure tlbie completed on all processors */
sync /* ensure tlbsync completed */
/* Then add new PTE over old */
PTERPN,R,C,WIMG,PP <- new values
eieio /* order 1st PTE update before 2nd */
PTEVSID,API,H,V <- new values (V=1)
sync /* ensure updates completed */
And also this explanation:
(from MPC7450UM -> 22.214.171.124 Enforcing Store Ordering with Respect to
The PowerPC architecture specifies that an eieio instruction must be
used to ensure sequential ordering of
loads with stores.
The MPC7450 guarantees that any load followed by any store is
performed in order (with respect to each
other). The reverse, however, is not guaranteed. An eieio instruction
must be inserted between a store
followed by a load to ensure sequential ordering between that store
and that load. Also note that setting
HID0[SPD] does not prevent loads from bypassing stores.
I've one processor, why should I use tlbsync instruction in page table
updates? And why should I use eieio instruction in this context?
Thanks a lot.
- Prev by Date: Re: Had an interview
- Next by Date: Re: Had an interview
- Previous by thread: Re: powerpc sync and eieio instructions
- Next by thread: Re: powerpc sync and eieio instructions