All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tiejun.chen" <tiejun.chen@windriver.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Wood Scott-B07421 <B07421@freescale.com>
Subject: Re: [v3][PATCH 7/8] book3e/kexec/kdump: redefine VIRT_PHYS_OFFSET
Date: Wed, 10 Jul 2013 13:46:00 +0800	[thread overview]
Message-ID: <51DCF518.4090105@windriver.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D070AE138@039-SN2MPN1-011.039d.mgd.msft.net>

On 07/10/2013 01:20 PM, Bhushan Bharat-R65777 wrote:
>
>
>> -----Original Message-----
>> From: Linuxppc-dev [mailto:linuxppc-dev-
>> bounces+bharat.bhushan=freescale.com@lists.ozlabs.org] On Behalf Of Tiejun Chen
>> Sent: Tuesday, July 09, 2013 1:33 PM
>> To: benh@kernel.crashing.org
>> Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org
>> Subject: [v3][PATCH 7/8] book3e/kexec/kdump: redefine VIRT_PHYS_OFFSET
>>
>> Book3e is always aligned 1GB to create TLB so we should
>> use (KERNELBASE - MEMORY_START) as VIRT_PHYS_OFFSET to
>> get __pa/__va properly while boot kdump.
>>
>> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
>> ---
>>   arch/powerpc/include/asm/page.h |    2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
>> index 988c812..5b00081 100644
>> --- a/arch/powerpc/include/asm/page.h
>> +++ b/arch/powerpc/include/asm/page.h
>> @@ -112,6 +112,8 @@ extern long long virt_phys_offset;
>>   /* See Description below for VIRT_PHYS_OFFSET */
>>   #ifdef CONFIG_RELOCATABLE_PPC32
>>   #define VIRT_PHYS_OFFSET virt_phys_offset
>> +#elif defined(CONFIG_PPC_BOOK3E_64)
>> +#define VIRT_PHYS_OFFSET (KERNELBASE - MEMORY_START)
>
> Can you please explain this code a bit more. I am not understanding this part:)

Nothing is special, we only need to redefine this to make sure __va()/__pa() can 
work well for BOOk3E-64 in BOOKE case:

#ifdef CONFIG_BOOKE
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)

And the arch/powerpc/include/asm/page.h file has more descriptions inline :)

Tiejun

WARNING: multiple messages have this Message-ID (diff)
From: "tiejun.chen" <tiejun.chen@windriver.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: "benh@kernel.crashing.org" <benh@kernel.crashing.org>,
	Wood Scott-B07421 <B07421@freescale.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [v3][PATCH 7/8] book3e/kexec/kdump: redefine VIRT_PHYS_OFFSET
Date: Wed, 10 Jul 2013 13:46:00 +0800	[thread overview]
Message-ID: <51DCF518.4090105@windriver.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D070AE138@039-SN2MPN1-011.039d.mgd.msft.net>

On 07/10/2013 01:20 PM, Bhushan Bharat-R65777 wrote:
>
>
>> -----Original Message-----
>> From: Linuxppc-dev [mailto:linuxppc-dev-
>> bounces+bharat.bhushan=freescale.com@lists.ozlabs.org] On Behalf Of Tiejun Chen
>> Sent: Tuesday, July 09, 2013 1:33 PM
>> To: benh@kernel.crashing.org
>> Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org
>> Subject: [v3][PATCH 7/8] book3e/kexec/kdump: redefine VIRT_PHYS_OFFSET
>>
>> Book3e is always aligned 1GB to create TLB so we should
>> use (KERNELBASE - MEMORY_START) as VIRT_PHYS_OFFSET to
>> get __pa/__va properly while boot kdump.
>>
>> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
>> ---
>>   arch/powerpc/include/asm/page.h |    2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
>> index 988c812..5b00081 100644
>> --- a/arch/powerpc/include/asm/page.h
>> +++ b/arch/powerpc/include/asm/page.h
>> @@ -112,6 +112,8 @@ extern long long virt_phys_offset;
>>   /* See Description below for VIRT_PHYS_OFFSET */
>>   #ifdef CONFIG_RELOCATABLE_PPC32
>>   #define VIRT_PHYS_OFFSET virt_phys_offset
>> +#elif defined(CONFIG_PPC_BOOK3E_64)
>> +#define VIRT_PHYS_OFFSET (KERNELBASE - MEMORY_START)
>
> Can you please explain this code a bit more. I am not understanding this part:)

Nothing is special, we only need to redefine this to make sure __va()/__pa() can 
work well for BOOk3E-64 in BOOKE case:

#ifdef CONFIG_BOOKE
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)

And the arch/powerpc/include/asm/page.h file has more descriptions inline :)

Tiejun

  reply	other threads:[~2013-07-10  5:45 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09  8:03 [v3][PATCH 0/8] powerpc/book3e: support kexec and kdump Tiejun Chen
2013-07-09  8:03 ` Tiejun Chen
2013-07-09  8:03 ` [v3][PATCH 1/8] powerpc/book3e: rename interrupt_end_book3e with __end_interrupts Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-07-10  5:17   ` Bhushan Bharat-R65777
2013-07-10  5:17     ` Bhushan Bharat-R65777
2013-07-10  5:39     ` tiejun.chen
2013-07-10  5:39       ` tiejun.chen
2013-12-18  3:03   ` Scott Wood
2013-12-18  3:03     ` Scott Wood
2013-07-09  8:03 ` [v3][PATCH 2/8] powerpc/book3e: support CONFIG_RELOCATABLE Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-12-18  3:29   ` Scott Wood
2013-12-18  3:29     ` Scott Wood
2013-07-09  8:03 ` [v3][PATCH 3/8] book3e/kexec/kdump: enable kexec for kernel Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-12-18  3:35   ` Scott Wood
2013-12-18  3:35     ` Scott Wood
2013-07-09  8:03 ` [v3][PATCH 4/8] book3e/kexec/kdump: create a 1:1 TLB mapping Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-12-18  3:39   ` Scott Wood
2013-12-18  3:39     ` Scott Wood
2013-07-09  8:03 ` [v3][PATCH 5/8] book3e/kexec/kdump: introduce a kexec kernel flag Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-12-18  3:42   ` Scott Wood
2013-12-18  3:42     ` Scott Wood
2013-07-09  8:03 ` [v3][PATCH 6/8] book3e/kexec/kdump: implement ppc64 kexec specfic Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-12-18  3:45   ` Scott Wood
2013-12-18  3:45     ` Scott Wood
2013-07-09  8:03 ` [v3][PATCH 7/8] book3e/kexec/kdump: redefine VIRT_PHYS_OFFSET Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-07-10  5:20   ` Bhushan Bharat-R65777
2013-07-10  5:20     ` Bhushan Bharat-R65777
2013-07-10  5:46     ` tiejun.chen [this message]
2013-07-10  5:46       ` tiejun.chen
2013-12-18  3:48   ` Scott Wood
2013-12-18  3:48     ` Scott Wood
2013-07-09  8:03 ` [v3][PATCH 8/8] book3e/kexec/kdump: recover "r4 = 0" to create the initial TLB Tiejun Chen
2013-07-09  8:03   ` Tiejun Chen
2013-12-18  3:50   ` Scott Wood
2013-12-18  3:50     ` Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51DCF518.4090105@windriver.com \
    --to=tiejun.chen@windriver.com \
    --cc=B07421@freescale.com \
    --cc=R65777@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.