]> err.no Git - linux-2.6/commitdiff
powerpc/pseries: Utilities to set firmware page state
authorBrian King <brking@linux.vnet.ibm.com>
Wed, 23 Jul 2008 18:29:16 +0000 (04:29 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 25 Jul 2008 05:44:42 +0000 (15:44 +1000)
Newer versions of firmware support page states, which are used by the
collaborative memory manager (future patch) to "loan" pages to the
hypervisor for use by other partitions.

Signed-off-by: Brian King <brking@linux.vnet.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/platforms/pseries/plpar_wrappers.h
include/asm-powerpc/hvcall.h

index d8680b589dc96c325afb09725c47f5c6a008a3e6..a437267c6bf86efb7443a44bfbf9ed693614371a 100644 (file)
@@ -42,6 +42,16 @@ static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa)
        return vpa_call(0x3, cpu, vpa);
 }
 
+static inline long plpar_page_set_loaned(unsigned long vpa)
+{
+       return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, vpa, 0);
+}
+
+static inline long plpar_page_set_active(unsigned long vpa)
+{
+       return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, vpa, 0);
+}
+
 extern void vpa_init(int cpu);
 
 static inline long plpar_pte_enter(unsigned long flags,
index 46e76456cbbdf69acbc61af9b7e7871d75b1d9bc..fbe2932fa9e9660d0a896dea589d4ac1ad6e17c3 100644 (file)
 #define H_EXACT                        (1UL<<(63-24))  /* Use exact PTE or return H_PTEG_FULL */
 #define H_R_XLATE              (1UL<<(63-25))  /* include a valid logical page num in the pte if the valid bit is set */
 #define H_READ_4               (1UL<<(63-26))  /* Return 4 PTEs */
+#define H_PAGE_STATE_CHANGE    (1UL<<(63-28))
+#define H_PAGE_UNUSED          ((1UL<<(63-29)) | (1UL<<(63-30)))
+#define H_PAGE_SET_UNUSED      (H_PAGE_STATE_CHANGE | H_PAGE_UNUSED)
+#define H_PAGE_SET_LOANED      (H_PAGE_SET_UNUSED | (1UL<<(63-31)))
+#define H_PAGE_SET_ACTIVE      H_PAGE_STATE_CHANGE
 #define H_AVPN                 (1UL<<(63-32))  /* An avpn is provided as a sanity test */
 #define H_ANDCOND              (1UL<<(63-33))
 #define H_ICACHE_INVALIDATE    (1UL<<(63-40))  /* icbi, etc.  (ignored for IO pages) */