Collect all page_base_address bits for pte-further addresses (v2)

Submitted by StDenis, Tom on July 18, 2019, 4:53 p.m.

Details

Message ID 20190718165317.31371-1-tom.stdenis@amd.com
State New
Headers show
Series "Collect all page_base_address bits for pte-further addresses" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

StDenis, Tom July 18, 2019, 4:53 p.m.
The specification says to treat a PTE with the F bit set "like a PDE"
which means that all but the lower 6 bits are part of the page base
address.  Indeed, in the wild a comment came back indicating that
we were stripping off bits needed to properly fetch the next
PTE.

(v2): Only capture excess bits if it is a PTE-FURTHER entry

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 src/lib/read_vram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/lib/read_vram.c b/src/lib/read_vram.c
index cba8f6b..e83a85c 100644
--- a/src/lib/read_vram.c
+++ b/src/lib/read_vram.c
@@ -676,7 +676,7 @@  pde_is_pte:
 				pte_idx = (address >> 12) & ((1ULL << pde_fields.frag_size) - 1);
 
 				// grab PTE base address from the PTE that has the F bit set.
-				pde_fields.pte_base_addr = pte_fields.page_base_addr;
+				pde_fields.pte_base_addr = pte_entry & 0xFFFFFFFFFFC0ULL;
 				goto pte_further;
 			}
 

Comments

Am 18.07.19 um 18:53 schrieb StDenis, Tom:
> The specification says to treat a PTE with the F bit set "like a PDE"
> which means that all but the lower 6 bits are part of the page base
> address.  Indeed, in the wild a comment came back indicating that
> we were stripping off bits needed to properly fetch the next
> PTE.
>
> (v2): Only capture excess bits if it is a PTE-FURTHER entry
>
> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

> ---
>   src/lib/read_vram.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/read_vram.c b/src/lib/read_vram.c
> index cba8f6b..e83a85c 100644
> --- a/src/lib/read_vram.c
> +++ b/src/lib/read_vram.c
> @@ -676,7 +676,7 @@ pde_is_pte:
>   				pte_idx = (address >> 12) & ((1ULL << pde_fields.frag_size) - 1);
>   
>   				// grab PTE base address from the PTE that has the F bit set.
> -				pde_fields.pte_base_addr = pte_fields.page_base_addr;
> +				pde_fields.pte_base_addr = pte_entry & 0xFFFFFFFFFFC0ULL;
>   				goto pte_further;
>   			}
>