s390/uv: export uv_pin_shared for direct usage
authorJanosch Frank <frankja@linux.ibm.com>
Tue, 15 Aug 2023 18:43:31 +0000 (14:43 -0400)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 18 Aug 2023 13:09:29 +0000 (15:09 +0200)
Export the uv_pin_shared function so that it can be called from other
modules that carry a GPL-compatible license.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Tested-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
Link: https://lore.kernel.org/r/20230815184333.6554-11-akrowiak@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/uv.h
arch/s390/kernel/uv.c

index d6bb2f4f78d1f495e45098707136091689d6a326..d2cd42bb2c26ef6d0957d7e899fd37575b1f15be 100644 (file)
@@ -463,6 +463,7 @@ static inline int is_prot_virt_host(void)
        return prot_virt_host;
 }
 
+int uv_pin_shared(unsigned long paddr);
 int gmap_make_secure(struct gmap *gmap, unsigned long gaddr, void *uvcb);
 int gmap_destroy_page(struct gmap *gmap, unsigned long gaddr);
 int uv_destroy_owned_page(unsigned long paddr);
@@ -475,6 +476,11 @@ void setup_uv(void);
 #define is_prot_virt_host() 0
 static inline void setup_uv(void) {}
 
+static inline int uv_pin_shared(unsigned long paddr)
+{
+       return 0;
+}
+
 static inline int uv_destroy_owned_page(unsigned long paddr)
 {
        return 0;
index 66f0eb1c872bfefd81c9ff4de4261c1bf3c6afbe..b771f1b4cdd1591fabbbeb8efa13ff5179e86a9a 100644 (file)
@@ -88,7 +88,7 @@ fail:
  * Requests the Ultravisor to pin the page in the shared state. This will
  * cause an intercept when the guest attempts to unshare the pinned page.
  */
-static int uv_pin_shared(unsigned long paddr)
+int uv_pin_shared(unsigned long paddr)
 {
        struct uv_cb_cfs uvcb = {
                .header.cmd = UVC_CMD_PIN_PAGE_SHARED,
@@ -100,6 +100,7 @@ static int uv_pin_shared(unsigned long paddr)
                return -EINVAL;
        return 0;
 }
+EXPORT_SYMBOL_GPL(uv_pin_shared);
 
 /*
  * Requests the Ultravisor to destroy a guest page and make it