qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] spapr_iommu: fix erroneous sanity check in h_put_tc


From: Greg Kurz
Subject: [Qemu-devel] [PATCH] spapr_iommu: fix erroneous sanity check in h_put_tce_indirect()
Date: Mon, 15 Jun 2015 19:28:04 +0200
User-agent: StGit/0.17.1-dirty

According to PAPR+ 3.2.2.2, the TCE is implemented as follows:
        bits  0-51: real page number
        bits 52-61: reserved for future use
        bits 62-63: page protection (read-only, write-only, read-write)

Possible values for the protection bits are necessarly non-zero and thus
H_PUT_TCE_INDIRECT currently always fails and returns H_PARAMETER.

The code explicitly clears the protection bits when computing the TCE offset,
a few lines below (tce_list & ~SPAPR_TCE_RW)... The sanity check is obviously
wrong for these bits.

Moreover, I could find no indication in PAPR+ that using the other reserved
bits should error out with H_PARAMETER.

This patch simply drops the offending check.

Signed-off-by: Greg Kurz <address@hidden>
---
 hw/ppc/spapr_iommu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 8cd9dba9ac4d..37a1110c9d87 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -258,7 +258,7 @@ static target_ulong h_put_tce_indirect(PowerPCCPU *cpu,
         return H_PARAMETER;
     }
 
-    if ((npages > 512) || (tce_list & SPAPR_TCE_PAGE_MASK)) {
+    if (npages > 512) {
         return H_PARAMETER;
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]