mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx
@ 2024-10-09  5:57 Ahmad Fatoum
  2024-10-09  5:57 ` [PATCH 2/2] ARM64: asm: mark assembly entry points as functions Ahmad Fatoum
  2024-10-14 12:49 ` [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-10-09  5:57 UTC (permalink / raw)
  To: barebox

From: Ahmad Fatoum <a.fatoum@barebox.org>

The encoding in the PAR_ELx register is a bit tricky, so add some
comments for each if-clause to make the code easier to read.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/arm/cpu/mmuinfo_64.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/cpu/mmuinfo_64.c b/arch/arm/cpu/mmuinfo_64.c
index de4945f43e8e..0c5cf3e65cb7 100644
--- a/arch/arm/cpu/mmuinfo_64.c
+++ b/arch/arm/cpu/mmuinfo_64.c
@@ -133,7 +133,7 @@ static void decode_par(unsigned long par)
 {
 	u8 devmem_attr = BITS(63, 56, par);
 
-	if (par & 1) {
+	if (par & 1) { /* Faulting */
 		printf("  Translation aborted [9:8]: because of a fault in the %s%s\n",
 		       stage_fault[BITS(9, 9, par)],
 		       BITS(8, 8, par) ? " during a stage 1 translation table walk" : "");
@@ -141,30 +141,30 @@ static void decode_par(unsigned long par)
 		       decode_fault_status(BITS(6, 1, par)),
 		       decode_fault_status_level(BITS(6, 1, par)));
 		printf("  Failure [0]:                0x1\n");
-	} else {
-		if ((devmem_attr & 0xf0) && (devmem_attr & 0x0f)) {
+	} else { /* Successful */
+		if ((devmem_attr & 0xf0) && (devmem_attr & 0x0f)) { /* Normal Memory */
 			printf("  Outer mem. attr. [63:60]:   0x%02lx (%s)\n", BITS(63, 60, par),
 			       cache_attr[BITS(63, 60, par)]);
 			printf("  Inner mem. attr. [59:56]:   0x%02lx (%s)\n", BITS(59, 56, par),
 			       cache_attr[BITS(59, 56, par)]);
-		} else if ((devmem_attr & 0b11110010) == 0) {
+		} else if ((devmem_attr & 0b11110010) == 0) { /* Device Memory */
 			printf("  Memory attr. [63:56]:     0x%02x (%s)\n",
 			       devmem_attr, decode_devmem_attr(devmem_attr));
 			if (devmem_attr & 1)
 				printf("  (XS == 0 if FEAT_XS implemented)\n");
-		} else if (devmem_attr == 0b01000000) {
+		} else if (devmem_attr == 0b01000000) { /* FEAT_XS-specific */
 			printf("  Outer mem. attr. [63:56]:   0x%02lx (%s)\n", BITS(63, 56, par),
 			       "Non-Cacheable");
 			printf("  Inner mem. attr. [63:56]:   0x%02lx (%s)\n", BITS(63, 56, par),
 			       "Non-Cacheable");
 			printf("  (XS == 0 if FEAT_XS implemented)\n");
-		} else if (devmem_attr == 0b10100000) {
+		} else if (devmem_attr == 0b10100000) { /* FEAT_XS-specific */
 			printf("  Outer mem. attr. [63:56]:   0x%02lx (%s)\n", BITS(63, 56, par),
 			       "Write-Through, No Write-Allocate");
 			printf("  Inner mem. attr. [63:56]:   0x%02lx (%s)\n", BITS(63, 56, par),
 			       "Write-Through");
 			printf("  (XS == 0 if FEAT_XS implemented)\n");
-		} else if (devmem_attr == 0b11110000) {
+		} else if (devmem_attr == 0b11110000) {  /* FEAT_MTE2-specific */
 			printf("  Outer mem. attr. [63:56]:   0x%02lx (%s)\n", BITS(63, 56, par),
 			       "Write-Back");
 			printf("  Inner mem. attr. [63:56]:   0x%02lx (%s)\n", BITS(63, 56, par),
-- 
2.39.5




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ARM64: asm: mark assembly entry points as functions
  2024-10-09  5:57 [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx Ahmad Fatoum
@ 2024-10-09  5:57 ` Ahmad Fatoum
  2024-10-14 12:49 ` [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-10-09  5:57 UTC (permalink / raw)
  To: barebox

From: Ahmad Fatoum <ahmad@a3f.at>

ENTRY_PROC_END() is used as counterpart to ENTRY_PROC() to delimit entry
points written in assembly. That macro expands to the END() macro though,
which doesn't explicitly mark the entry point as being a function.

This can lead to objdump -d on the PBL ELF file to not disassemble
the wntry point and instead displaying only a hexdump.

Fix this by using ENDPROC which sets the function type correctly.
This only has effect on the ELF and introduces no functional change for
the objcopied image.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/arm/include/asm/barebox-arm64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/barebox-arm64.h b/arch/arm/include/asm/barebox-arm64.h
index 58ff7b9b362b..9b91a693af94 100644
--- a/arch/arm/include/asm/barebox-arm64.h
+++ b/arch/arm/include/asm/barebox-arm64.h
@@ -30,6 +30,6 @@
  * ENTRY_PROC_END - mark end of entry procedure
  */
 #define ENTRY_PROC_END(name) \
-	END(##name)
+	ENDPROC(##name)
 
 #endif /* _BAREBOX_ARM64_H_ */
-- 
2.39.5




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx
  2024-10-09  5:57 [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx Ahmad Fatoum
  2024-10-09  5:57 ` [PATCH 2/2] ARM64: asm: mark assembly entry points as functions Ahmad Fatoum
@ 2024-10-14 12:49 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2024-10-14 12:49 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 09 Oct 2024 07:57:30 +0200, Ahmad Fatoum wrote:
> The encoding in the PAR_ELx register is a bit tricky, so add some
> comments for each if-clause to make the code easier to read.
> 
> 

Applied, thanks!

[1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx
      https://git.pengutronix.de/cgit/barebox/commit/?id=a5649492cd99 (link may not be stable)
[2/2] ARM64: asm: mark assembly entry points as functions
      https://git.pengutronix.de/cgit/barebox/commit/?id=d28870eec354 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-14 13:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-09  5:57 [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx Ahmad Fatoum
2024-10-09  5:57 ` [PATCH 2/2] ARM64: asm: mark assembly entry points as functions Ahmad Fatoum
2024-10-14 12:49 ` [PATCH 1/2] ARM64: mmuinfo: comment the if clauses decoding PAR_ELx Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox