From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp05.in.ibm.com (e28smtp05.in.ibm.com [122.248.162.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e28smtp05.in.ibm.com", Issuer "GeoTrust SSL CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 22B2EB6F90 for ; Wed, 5 Oct 2011 23:49:50 +1100 (EST) Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp05.in.ibm.com (8.14.4/8.13.1) with ESMTP id p95CndxW017325 for ; Wed, 5 Oct 2011 18:19:39 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p95CnaAL2941176 for ; Wed, 5 Oct 2011 18:19:37 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p95CnZKE024657 for ; Wed, 5 Oct 2011 18:19:36 +0530 Message-ID: <4E8C525F.4090000@in.ibm.com> Date: Wed, 05 Oct 2011 18:19:35 +0530 From: Suzuki Poulose MIME-Version: 1.0 To: Kumar Gala Subject: Defintion of kernstart_addr Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: Josh Boyer , linux ppc dev , Dave Hansen List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Kumar, I have been working on the CONFIG_RELOCATABLE support for PPC44x, trying to process the relocations generated by the compiler. Since the TLB size is 256M, we cannot enforce a page aligned kernel load address. I came across some issues with the __va() / __pa() translations, while the kernel load address is not page aligned. We have the following definition : #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) - PHYSICAL_START + KERNELBASE) where, PHYSICAL_START is #define'd to kernstart_addr variable, updated at boot time. I would like to know the exact meaning of the value in kerstart_addr. For e.g: When we have : PAGE_OFFSET = KERNELBASE = 0xc0000000, and kernel loaded at 64M (0x4000000) and we map Physical address 0 to Virtual address 0xc0000000. What should be the value of kernstart_addr ? Should it be 0 ? Or should it be 0x4000000 ? If we choose, 0x4000000, we get the translations wrong : __va(0x1) = 0x1 - 0x4000000 + 0xc0000000 = 0xbc000001 If we select 0, we have problems at other places where we assume, PHYSICAL_START to be the va() of _stext. Thanks Suzuki