public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Nikunj A Dadhania <nikunj@linux•vnet.ibm.com>
To: Thomas Huth <thuth@redhat•com>
Cc: aik@ozlabs•ru, linuxppc-dev@ozlabs•org, david@gibson•dropbear.id.au
Subject: Re: [PATCH 1/2] pci-phb: check for the 32-bit overflow
Date: Fri, 24 Apr 2015 09:22:33 +0530	[thread overview]
Message-ID: <871tjaxjwe.fsf@abhimanyu.in.ibm.com> (raw)
In-Reply-To: <20150423154314.595b8439@thh440s>


Hi Thomas,

Thomas Huth <thuth@redhat•com> writes:
> Am Wed, 22 Apr 2015 16:27:19 +0530
> schrieb Nikunj A Dadhania <nikunj@linux•vnet.ibm.com>:
>
>> With the addition of 64-bit BARS and increase in the mmio address
>> space, the code was hitting this limit. The memory of pci devices
>> across the bridges were not accessible due to which the drivers
>> failed.
>> 
>> Signed-off-by: Nikunj A Dadhania <nikunj@linux•vnet.ibm.com>
>> ---
>>  board-qemu/slof/pci-phb.fs | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs
>> index 529772f..e307d95 100644
>> --- a/board-qemu/slof/pci-phb.fs
>> +++ b/board-qemu/slof/pci-phb.fs
>> @@ -258,7 +258,8 @@ setup-puid
>>              decode-64 2 / dup >r                \ Decode and calc size/2
>>              pci-next-mem @ + dup pci-max-mem !  \ and calc max mem address
>
> Could pci-max-mem overflow, too?

Should not, its only the boundary that was an issue.

Qemu sends base and size, base + size can be till uint32 max. So for
example base was 0xC000.0000 and size was 0x4000.0000, we add up base +
size and put pci-max-mmio as 0x1.0000.0000, which would get programmend
in the bridge bars: lower limit as 0xC000 and 0x0000 as upper
limit. And no mmio access were going across the bridge.

In my testing, I have found one more issue with translate-my-address,
it does not take care of 64-bit addresses. I have a patch working for
SLOF, but its breaking the guest kernel booting.

>
>>              dup pci-next-mmio !                 \ which is the same as MMIO base
>> -            r> + pci-max-mmio !                 \ calc max MMIO address
>> +            r> + FFFFFFFF min pci-max-mmio !    \ calc max MMIO address and
>> +                                                \ check the 32-bit boundary
>
>  Thomas

Regards,
Nikunj

  reply	other threads:[~2015-04-24  3:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 10:57 [PATCH 1/2] pci-phb: check for the 32-bit overflow Nikunj A Dadhania
2015-04-23 13:43 ` Thomas Huth
2015-04-24  3:52   ` Nikunj A Dadhania [this message]
2015-04-24 10:56     ` Thomas Huth
2015-04-24 11:06       ` Thomas Huth
2015-04-27  5:00         ` Nikunj A Dadhania
2015-04-27  5:41         ` Nikunj A Dadhania
2015-04-27  4:58       ` Nikunj A Dadhania

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=871tjaxjwe.fsf@abhimanyu.in.ibm.com \
    --to=nikunj@linux$(echo .)vnet.ibm.com \
    --cc=aik@ozlabs$(echo .)ru \
    --cc=david@gibson$(echo .)dropbear.id.au \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=thuth@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox