[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Get_page_addr_code_hostp function returns -1 after turning MMU on
From: |
Peter Maydell |
Subject: |
Re: Get_page_addr_code_hostp function returns -1 after turning MMU on |
Date: |
Fri, 12 Mar 2021 08:50:23 +0000 |
On Fri, 12 Mar 2021 at 08:34, <ckim@etri.re.kr> wrote:
>
> When briefly following it with debugger, I found that in the function below
> the condition “entry->addr_code & TLB_MMIO” is true and it returns -1. (by
> the way I set the first 2MB’s to read-only blocks, because they are flash/ROM)
>
> Could anyone explain to me what this condition is? Just a brief explanation
> will be much appreciated.
>
> if (unlikely(entry->addr_code & TLB_MMIO)) { <======= returns -1
>
> /* The region is not backed by RAM. */
It's what the comment says : the physical address that the virtual
address has been resolved to has something there, but it's not RAM.
It's a device. (It might also be the flash device in 'programming'
mode, ie where you've written to the flash device region, which the
flash thinks is you sending it a command to erase or rewrite blocks.)
-- PMM