Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[linux-2.6-microblaze.git] / arch / powerpc / kvm / book3s_64_vio_hv.c
index f38dfe1..870b7f0 100644 (file)
@@ -173,10 +173,13 @@ static void kvmppc_rm_tce_put(struct kvmppc_spapr_tce_table *stt,
        idx -= stt->offset;
        page = stt->pages[idx / TCES_PER_PAGE];
        /*
-        * page must not be NULL in real mode,
-        * kvmppc_rm_ioba_validate() must have taken care of this.
+        * kvmppc_rm_ioba_validate() allows pages not be allocated if TCE is
+        * being cleared, otherwise it returns H_TOO_HARD and we skip this.
         */
-       WARN_ON_ONCE_RM(!page);
+       if (!page) {
+               WARN_ON_ONCE_RM(tce != 0);
+               return;
+       }
        tbl = kvmppc_page_address(page);
 
        tbl[idx % TCES_PER_PAGE] = tce;