From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 0D795B7B7B for ; Fri, 28 Aug 2009 02:33:39 +1000 (EST) Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 753FEDDD04 for ; Fri, 28 Aug 2009 02:33:37 +1000 (EST) Message-ID: <4A96B579.3030907@freescale.com> Date: Thu, 27 Aug 2009 11:34:01 -0500 From: Scott Wood MIME-Version: 1.0 To: "wilbur.chan" Subject: Re: Can't write value into memory ?(E500 V2) References: <20090826192030.GA17027@b07421-ec1.am.freescale.net> <4A96AD4B.1010204@freescale.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , wilbur.chan wrote: > 2009/8/27 Scott Wood : >> Is this under Linux (it is a Linux mailing list...)? If so, there are >> better ways of communicating that don't involve clobbering random memory and >> overlapping userspace TLB mappings. > > Yes, I'm doing this under linux in kernel mode. > > I've used interrupt between cores, to make: > > 1) cpu0 carrys some data to a place (As a matter of fact ,the 'data' > is a kernel, the 'place' is at 0, and I'm using kexec..) > > 2) cpu0 writes a 'flag' to a physical address(16M), to indicate that , > > it has finished the carrying in step 1. And jump to new kernel directly. OK, so it's not really "under Linux" but "between Linuxes". :-) Don't forget to clean the cache out on the destination core -- icache is not coherent with dcache. > 3) cpu1 enters the loop by IRQ , checking the 'flag' from time to > time. If the 'flag' is true, it > > breaks the loop and jumps to the instruction in new kernel. > > >> Do both cores have a mapping with the M bit (memory coherence required) set? > > > What do you mean by M bit set? There is a bit in MAS2, labelled "M", that you must set when writing the TLB entry for the mapping to be coherent across cores. -Scott