ÂÂÂÂÂÂÂÂÂ max_len = DAWR_MAX_LEN;
ÂÂÂÂÂÂÂÂÂ /* DAWR region can't cross 512 bytes boundary */
-ÂÂÂÂÂÂÂ if ((start_addr >> 9) != (end_addr >> 9))
+ÂÂÂÂÂÂÂ if ((start_addr >> 9) != ((end_addr - 1) >> 9))
What about:
ÂÂÂÂif (ALIGN(start_addr, SZ_512M) != ALIGN(end - 1, SZ_512M))
ÂÂÂÂÂÂÂÂÂÂÂÂÂ return -EINVAL;
ÂÂÂÂÂ } else if (IS_ENABLED(CONFIG_PPC_8xx)) {
ÂÂÂÂÂÂÂÂÂ /* 8xx can setup a range without limitation */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index aab82ab80dfa..06679adac447 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -800,12 +800,12 @@ static inline int set_breakpoint_8xx(struct arch_hw_breakpoint *brk)
ÂÂÂÂÂ unsigned long lctrl1 = LCTRL1_CTE_GT | LCTRL1_CTF_LT | LCTRL1_CRWE_RW |
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ LCTRL1_CRWF_RW;
ÂÂÂÂÂ unsigned long lctrl2 = LCTRL2_LW0EN | LCTRL2_LW0LADC | LCTRL2_SLW0EN;
-ÂÂÂ unsigned long start_addr = brk->address & ~HW_BREAKPOINT_ALIGN;
-ÂÂÂ unsigned long end_addr = (brk->address + brk->len - 1) | HW_BREAKPOINT_ALIGN;
+ÂÂÂ unsigned long start_addr = ALIGN_DOWN(brk->address, HW_BREAKPOINT_SIZE);
+ÂÂÂ unsigned long end_addr = ALIGN(brk->address + brk->len, HW_BREAKPOINT_SIZE);
ÂÂÂÂÂ if (start_addr == 0)
ÂÂÂÂÂÂÂÂÂ lctrl2 |= LCTRL2_LW0LA_F;
-ÂÂÂ else if (end_addr == ~0U)
+ÂÂÂ else if (end_addr - 1 == ~0U)
What about:
ÂÂÂÂelse if (end_addr == 0)