powerpc/pseries: Verify CMO memory entitlement updates with virtual I/O
authorNathan Fontenot <nfont@austin.ibm.com>
Wed, 23 Jul 2008 18:31:52 +0000 (04:31 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 25 Jul 2008 05:44:43 +0000 (15:44 +1000)
Verify memory entitlement updates can be handled by vio.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/lparcfg.c

index 848c3e5a63709174ceb9e2817cbe268bc7cd9740..64381a204a5853e8cf7cb94716ea160deb3fcd99 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/time.h>
 #include <asm/prom.h>
 #include <asm/vdso_datapage.h>
+#include <asm/vio.h>
 
 #define MODULE_VERS "1.8"
 #define MODULE_NAME "lparcfg"
@@ -527,6 +528,15 @@ static ssize_t update_mpp(u64 *entitlement, u8 *weight)
        u8 new_weight;
        ssize_t rc;
 
+       if (entitlement) {
+               /* Check with vio to ensure the new memory entitlement
+                * can be handled.
+                */
+               rc = vio_cmo_entitlement_update(*entitlement);
+               if (rc)
+                       return rc;
+       }
+
        rc = h_get_mpp(&mpp_data);
        if (rc)
                return rc;