[RFC 5/8] powerpc/slb: Add documentation to runtime patching of SLB encoding
Anshuman Khandual
khandual at linux.vnet.ibm.com
Tue Jul 21 16:58:43 AEST 2015
From: "khandual at linux.vnet.ibm.com" <khandual at linux.vnet.ibm.com>
This patch adds some documentation to 'patch_slb_encoding' function
explaining about how it clears the existing immediate value in the
given instruction and inserts a new one there.
Signed-off-by: Anshuman Khandual <khandual at linux.vnet.ibm.com>
---
arch/powerpc/mm/slb.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index dcba4c2..8083a9e 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -278,7 +278,13 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
static inline void patch_slb_encoding(unsigned int *insn_addr,
unsigned int immed)
{
- int insn = (*insn_addr & 0xffff0000) | immed;
+ /*
+ * Currently this patches only "li" and "cmpldi"
+ * instructions with an immediate value. Here it
+ * just clears the existing immediate value from
+ * the instruction and inserts a new one there.
+ */
+ unsigned int insn = (*insn_addr & 0xffff0000) | immed;
patch_instruction(insn_addr, insn);
}
--
2.1.0
More information about the Linuxppc-dev
mailing list