diff mbox

[v6,06/16] hw/phb3: Fix reserved PE# for RID unmapping

Message ID 1430456549-21090-7-git-send-email-gwshan@linux.vnet.ibm.com
State Superseded
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Gavin Shan May 1, 2015, 5:02 a.m. UTC
When one RID is unmapped from its corresponding PE# as requested by OS,
the reserved PE#, which is PE#255 instead of PE#0, should be picked to
cover the RID. The patch fixes the wrong reserved PE# used on PHB3.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 hw/phb3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/phb3.c b/hw/phb3.c
index 826fba7..397f449 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -1791,7 +1791,7 @@  static int64_t phb3_set_pe(struct phb *phb,
 			for (idx = 0; idx < RTT_TABLE_ENTRIES; idx++)
 				p->rte_cache[idx] = pe_num;
 		} else {
-			memset(p->rte_cache, 0xff, RTT_TABLE_SIZE);
+			memset(p->rte_cache, 0, RTT_TABLE_SIZE);
 		}
 		memcpy((void *)p->tbl_rtt, p->rte_cache, RTT_TABLE_SIZE);
 		out_be64(p->regs + PHB_RTC_INVALIDATE,
@@ -1801,7 +1801,7 @@  static int64_t phb3_set_pe(struct phb *phb,
 		for (idx = 0; idx < RTT_TABLE_ENTRIES; idx++, rte++) {
 			if ((idx & mask) != val)
 				continue;
-			p->rte_cache[idx] = (action ? pe_num : 0xffff);
+			p->rte_cache[idx] = (action ? pe_num : 0);
 			*rte = p->rte_cache[idx];
 
 			/*