diff mbox

[01/22] Remove TARGET_PHYS_ADDR_BITS define completely

Message ID 1351506371-23632-2-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf Oct. 29, 2012, 10:25 a.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>

Following commit 4be403c81 TARGET_PHYS_ADDR_BITS is always 64,
and it's only used in one place (that commit removed all the
other uses). Remove it completely, to avoid confusion with
the genuinely useful TARGET_PHYS_ADDR_SPACE_BITS.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-ppc/mmu_helper.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

Comments

Peter Maydell Oct. 29, 2012, 10:38 a.m. UTC | #1
On 29 October 2012 10:25, Alexander Graf <agraf@suse.de> wrote:
> From: Peter Maydell <peter.maydell@linaro.org>
>
> Following commit 4be403c81 TARGET_PHYS_ADDR_BITS is always 64,
> and it's only used in one place (that commit removed all the
> other uses). Remove it completely, to avoid confusion with
> the genuinely useful TARGET_PHYS_ADDR_SPACE_BITS.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  target-ppc/mmu_helper.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
> index 4a9bb5b..811f47f 100644
> --- a/target-ppc/mmu_helper.c
> +++ b/target-ppc/mmu_helper.c
> @@ -1509,10 +1509,8 @@ static void mmubooke_dump_mmu(FILE *f, fprintf_function cpu_fprintf,
>          mask = ~(entry->size - 1);
>          ea = entry->EPN & mask;
>          pa = entry->RPN & mask;
> -#if (TARGET_PHYS_ADDR_SPACE_BITS >= 36)
>          /* Extend the physical address to 36 bits */
>          pa |= (hwaddr)(entry->RPN & 0xF) << 32;
> -#endif
>          size /= 1024;
>          if (size >= 1024) {
>              snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / 1024);

The contents and the commit message on this don't match any more,
because when Avi did the target_phys_addr_t to hwaddr patch he
changed this #if (in a different way to how he resolved all the
other #ifs for the force-phys-addrs-to-64-bits patch).

I think the final resulting source tree is the right thing,
so the commit message needs changing. Try:

===begin===
Drop unnecessary check of TARGET_PHYS_ADDR_SPACE_BITS

For all our PPC targets the physical address space is at least
36 bits, so drop an unnecessary preprocessor conditional check
on TARGET_PHYS_ADDR_SPACE_BITS (erroneously introduced as part
of the change from target_phys_addr_t to hwaddr). This brings
this bit of code into line with the way we handle the other
cases which were originally checking TARGET_PHYS_ADDR_BITS in
order to avoid compiler complaints about overflowing a 32 bit type.
===endit===

-- PMM
Alexander Graf Oct. 29, 2012, 10:46 a.m. UTC | #2
On 29.10.2012, at 11:38, Peter Maydell wrote:

> On 29 October 2012 10:25, Alexander Graf <agraf@suse.de> wrote:
>> From: Peter Maydell <peter.maydell@linaro.org>
>> 
>> Following commit 4be403c81 TARGET_PHYS_ADDR_BITS is always 64,
>> and it's only used in one place (that commit removed all the
>> other uses). Remove it completely, to avoid confusion with
>> the genuinely useful TARGET_PHYS_ADDR_SPACE_BITS.
>> 
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> target-ppc/mmu_helper.c |    2 --
>> 1 files changed, 0 insertions(+), 2 deletions(-)
>> 
>> diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
>> index 4a9bb5b..811f47f 100644
>> --- a/target-ppc/mmu_helper.c
>> +++ b/target-ppc/mmu_helper.c
>> @@ -1509,10 +1509,8 @@ static void mmubooke_dump_mmu(FILE *f, fprintf_function cpu_fprintf,
>>         mask = ~(entry->size - 1);
>>         ea = entry->EPN & mask;
>>         pa = entry->RPN & mask;
>> -#if (TARGET_PHYS_ADDR_SPACE_BITS >= 36)
>>         /* Extend the physical address to 36 bits */
>>         pa |= (hwaddr)(entry->RPN & 0xF) << 32;
>> -#endif
>>         size /= 1024;
>>         if (size >= 1024) {
>>             snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / 1024);
> 
> The contents and the commit message on this don't match any more,
> because when Avi did the target_phys_addr_t to hwaddr patch he
> changed this #if (in a different way to how he resolved all the
> other #ifs for the force-phys-addrs-to-64-bits patch).
> 
> I think the final resulting source tree is the right thing,
> so the commit message needs changing. Try:
> 
> ===begin===
> Drop unnecessary check of TARGET_PHYS_ADDR_SPACE_BITS
> 
> For all our PPC targets the physical address space is at least
> 36 bits, so drop an unnecessary preprocessor conditional check
> on TARGET_PHYS_ADDR_SPACE_BITS (erroneously introduced as part
> of the change from target_phys_addr_t to hwaddr). This brings
> this bit of code into line with the way we handle the other
> cases which were originally checking TARGET_PHYS_ADDR_BITS in
> order to avoid compiler complaints about overflowing a 32 bit type.
> ===endit===

Alrighty, updated the commit message in all queues :).


Alex
diff mbox

Patch

diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
index 4a9bb5b..811f47f 100644
--- a/target-ppc/mmu_helper.c
+++ b/target-ppc/mmu_helper.c
@@ -1509,10 +1509,8 @@  static void mmubooke_dump_mmu(FILE *f, fprintf_function cpu_fprintf,
         mask = ~(entry->size - 1);
         ea = entry->EPN & mask;
         pa = entry->RPN & mask;
-#if (TARGET_PHYS_ADDR_SPACE_BITS >= 36)
         /* Extend the physical address to 36 bits */
         pa |= (hwaddr)(entry->RPN & 0xF) << 32;
-#endif
         size /= 1024;
         if (size >= 1024) {
             snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / 1024);