Skip to contentSkip to conversation

xen/arm64: Drop relocate_and_switch_ttbr() stub

PATCH In review Michal Orzel 4 participants 5 messages Jan 8, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm64: Drop relocate_and_switch_ttbr() stub

In the original patch e7a80636f16e ("xen/arm: add cache coloring support for Xen image"), the stub was added under wrong assumption that DCE won't remove the function call if it's not static. This assumption is incorrect as we already rely on DCE for cases like this one. Therefore drop the stub, that otherwise would be a place potentially prone to errors in the future.

---
As suggested by Julien, we should have it for 4.20. Leaving a stub like that without something like BUG_ON inside can potentially lead to problems in the future provided the function misuse slipped through the review process.

---
 xen/arch/arm/arm64/mmu/mm.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/arm/arm64/mmu/mm.c +0 -2
index 26361c4fe4c0..c1efa1348aee 100644
@@ -171,8 +171,6 @@ void __init relocate_and_switch_ttbr(uint64_t ttbr)
      */
     update_identity_mapping(false);
 }
-#else
-void __init relocate_and_switch_ttbr(uint64_t ttbr) {}
 #endif
 
 void __init switch_ttbr(uint64_t ttbr)
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Michal Orzel

In the original patch e7a80636f16e ("xen/arm: add cache coloring support for Xen image"), the stub was added under wrong assumption that DCE won't remove the function call if it's not static. This assumption is incorrect as we already rely on DCE for cases like this one. Therefore drop the stub, that otherwise would be a place potentially prone to errors in the future.

Quoted 3 lines

---

Reviewed-by
#2 lore raw
Quoted 15 lines · Luca Fancellu
Quoted 12 lines · Michal Orzel

In the original patch e7a80636f16e ("xen/arm: add cache coloring support for Xen image"), the stub was added under wrong assumption that DCE won't remove the function call if it's not static. This assumption is incorrect as we already rely on DCE for cases like this one. Therefore drop the stub, that otherwise would be a place potentially prone to errors in the future.

Quoted 5 lines
Quoted 3 lines

---

Apologies, I meant:

Quoted 3 lines
#3 lore raw
In reply to Michal Orzel
Quoted 7 lines · Michal Orzel

In the original patch e7a80636f16e ("xen/arm: add cache coloring support for Xen image"), the stub was added under wrong assumption that DCE won't remove the function call if it's not static. This assumption is incorrect as we already rely on DCE for cases like this one. Therefore drop the stub, that otherwise would be a place potentially prone to errors in the future.

Quoted 7 lines

---
As suggested by Julien, we should have it for 4.20. Leaving a stub like that without something like BUG_ON inside can potentially lead to problems in the future provided the function misuse slipped through the review process.
---

~ Oleksii

Quoted 16 lines
  xen/arch/arm/arm64/mmu/mm.c | 2 --
  1 file changed, 2 deletions(-)
xen/arch/arm/arm64/mmu/mm.c +0 -2
index 26361c4fe4c0..c1efa1348aee 100644
@@ -171,8 +171,6 @@ void __init relocate_and_switch_ttbr(uint64_t ttbr)
       */
      update_identity_mapping(false);
  }
-#else
-void __init relocate_and_switch_ttbr(uint64_t ttbr) {}
  #endif
 
  void __init switch_ttbr(uint64_t ttbr)
Reviewed-by on v1 1/1
#4 lore raw
In reply to Michal Orzel

Hi Michal

Quoted 11 lines · Michal Orzel

In the original patch e7a80636f16e ("xen/arm: add cache coloring support for Xen image"), the stub was added under wrong assumption that DCE won't remove the function call if it's not static. This assumption is incorrect as we already rely on DCE for cases like this one. Therefore drop the stub, that otherwise would be a place potentially prone to errors in the future.

Cheers
Bertrand

Quoted 24 lines

---
As suggested by Julien, we should have it for 4.20. Leaving a stub like that without something like BUG_ON inside can potentially lead to problems in the future provided the function misuse slipped through the review process.
---
xen/arch/arm/arm64/mmu/mm.c | 2 --

1 file changed, 2 deletions(-)
xen/arch/arm/arm64/mmu/mm.c +0 -2
index 26361c4fe4c0..c1efa1348aee 100644
@@ -171,8 +171,6 @@ void __init relocate_and_switch_ttbr(uint64_t ttbr)
     */
    update_identity_mapping(false);
 }
-#else
-void __init relocate_and_switch_ttbr(uint64_t ttbr) {}
 #endif
 
 void __init switch_ttbr(uint64_t ttbr)
Signature · 1 line
2.25.1