Skip to contentSkip to conversation

arm64: debug: mark test_[bp,wp,ss] as noinline

PATCH Superseded Ricardo Koller 2 participants 3 messages Jan 11, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: debug: mark test_[bp,wp,ss] as noinline

Clang inlines some functions (like test_ss) which define global labels in inline assembly (e.g., ss_start). This results in:

arm/debug.c:382:15: error: invalid symbol redefinition
asm volatile("ss_start:\n"
^
<inline asm>:1:2: note: instantiated into assembly here
ss_start:
^
1 error generated.

Fix these functions by marking them as "noinline".

---
This applies on top of: "[kvm-unit-tests PATCH 0/3] arm64: debug: add migration tests for debug state" which is in https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/arm/queue.

 arm/debug.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arm/debug.c +3 -3
index 54f059d..6c5b683 100644
@@ -264,7 +264,7 @@ static void do_migrate(void)
 	report_info("Migration complete");
 }
 
-static void test_hw_bp(bool migrate)
+static __attribute__((noinline)) void test_hw_bp(bool migrate)
 {
 	extern unsigned char hw_bp0;
 	uint32_t bcr;
@@ -310,7 +310,7 @@ static void test_hw_bp(bool migrate)
 
 static volatile char write_data[16];
 
-static void test_wp(bool migrate)
+static __attribute__((noinline)) void test_wp(bool migrate)
 {
 	uint32_t wcr;
 	uint32_t mdscr;
@@ -353,7 +353,7 @@ static void test_wp(bool migrate)
 	}
 }
 
-static void test_ss(bool migrate)
+static __attribute__((noinline)) void test_ss(bool migrate)
 {
 	extern unsigned char ss_start;
 	uint32_t mdscr;
Signature · 1 line
2.34.1.575.g55b058a8bb-goog
#1 lore raw

Re: [kvm-unit-tests PATCH] arm64: debug: mark test_[bp, wp, ss] as noinline

Quoted 27 lines · Ricardo Koller

Clang inlines some functions (like test_ss) which define global labels in inline assembly (e.g., ss_start). This results in:

arm/debug.c:382:15: error: invalid symbol redefinition
asm volatile("ss_start:\n"
^
<inline asm>:1:2: note: instantiated into assembly here
ss_start:
^
1 error generated.

Fix these functions by marking them as "noinline".

---
This applies on top of: "[kvm-unit-tests PATCH 0/3] arm64: debug: add migration tests for debug state" which is in https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/arm/queue.

 arm/debug.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arm/debug.c +0 -0
index 54f059d..6c5b683 100644

arm/debug.c static void do_migrate(void) · line 267

Quoted 5 lines
arm/debug.c +1 -1
@@ -264,7 +264,7 @@ static void do_migrate(void)
 	report_info("Migration complete");
 }
 
-static void test_hw_bp(bool migrate)
+static __attribute__((noinline)) void test_hw_bp(bool migrate)

Use "noinline", which was added by commit 16431a7 ("lib: define the "noinline" macro").
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

#2 lore raw

Re: [kvm-unit-tests PATCH] arm64: debug: mark test_[bp, wp, ss] as noinline

Quoted 31 lines · Sean Christopherson
Quoted 30 lines · Ricardo Koller

Clang inlines some functions (like test_ss) which define global labels in inline assembly (e.g., ss_start). This results in:

arm/debug.c:382:15: error: invalid symbol redefinition
asm volatile("ss_start:\n"
^
<inline asm>:1:2: note: instantiated into assembly here
ss_start:
^
1 error generated.

Fix these functions by marking them as "noinline".

---
This applies on top of: "[kvm-unit-tests PATCH 0/3] arm64: debug: add migration tests for debug state" which is in https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/arm/queue.

 arm/debug.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arm/debug.c +0 -0
index 54f059d..6c5b683 100644
@@ -264,7 +264,7 @@ static void do_migrate(void)
 	report_info("Migration complete");
 }
 
Quoted 4 lines

arm/debug.c static void do_migrate(void) · line 267

Quoted 2 lines
arm/debug.c +1 -1
-static void test_hw_bp(bool migrate)
+static __attribute__((noinline)) void test_hw_bp(bool migrate)

Use "noinline", which was added by commit 16431a7 ("lib: define the "noinline" macro").

Will do, thanks for the pointer.