Hi Palmer,
On Thu, Aug 8, 2019 at 4:55 AM Palmer Dabbelt wrote:
>
> On Thu, Aug 1, 2019 at 7:58 AM Bin Meng wrote:
>>
>> On Thu, Aug 1, 2019 at 10:16 PM Richard Henderson
>> wrote:
>> >
>> > On 7/31/19 6:53 PM, Bin Meng wrote:
>> > > I am not sure how (idx * ptesize) could overflow. It represen
On Thu, Aug 1, 2019 at 7:58 AM Bin Meng wrote:
> On Thu, Aug 1, 2019 at 10:16 PM Richard Henderson
> wrote:
> >
> > On 7/31/19 6:53 PM, Bin Meng wrote:
> > > I am not sure how (idx * ptesize) could overflow. It represents the
> > > offset by a page table which is [0, 4096).
> >
> > You're right,
On Thu, Aug 1, 2019 at 10:16 PM Richard Henderson
wrote:
>
> On 7/31/19 6:53 PM, Bin Meng wrote:
> > I am not sure how (idx * ptesize) could overflow. It represents the
> > offset by a page table which is [0, 4096).
>
> You're right, I mis-read what was going on there.
>
> However, lower down, "ta
On 7/31/19 6:53 PM, Bin Meng wrote:
> I am not sure how (idx * ptesize) could overflow. It represents the
> offset by a page table which is [0, 4096).
You're right, I mis-read what was going on there.
However, lower down, "target_ulong ppn" needs to be promoted to hwaddr, so that
ppn = pte >
Hi Richard,
On Thu, Aug 1, 2019 at 1:35 AM Richard Henderson
wrote:
>
> On 7/31/19 5:45 AM, Bin Meng wrote:
> > -target_ulong base;
> > +hwaddr base;
> ...
> > -target_ulong pte_addr = base + idx * ptesize;
> > +hwaddr pte_addr = base + idx * ptesize;
>
> I believe that yo
On 7/31/19 5:45 AM, Bin Meng wrote:
> -target_ulong base;
> +hwaddr base;
...
> -target_ulong pte_addr = base + idx * ptesize;
> +hwaddr pte_addr = base + idx * ptesize;
I believe that you either need
base + (hwaddr)idx * ptesize
or change the type of idx to hwaddr ab
For RV32, the root page table's PPN has 22 bits hence its address
bits could be larger than the maximum bits that target_ulong is
able to represent. Use hwaddr instead.
Signed-off-by: Bin Meng
---
target/riscv/cpu_helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/