Skip to content

Commit cf3fa16

Browse files
frankjaahcahca
authored andcommitted
s390/uv: export uv_pin_shared for direct usage
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>
1 parent 7847a19 commit cf3fa16

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

arch/s390/include/asm/uv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ static inline int is_prot_virt_host(void)
463463
return prot_virt_host;
464464
}
465465

466+
int uv_pin_shared(unsigned long paddr);
466467
int gmap_make_secure(struct gmap *gmap, unsigned long gaddr, void *uvcb);
467468
int gmap_destroy_page(struct gmap *gmap, unsigned long gaddr);
468469
int uv_destroy_owned_page(unsigned long paddr);
@@ -475,6 +476,11 @@ void setup_uv(void);
475476
#define is_prot_virt_host() 0
476477
static inline void setup_uv(void) {}
477478

479+
static inline int uv_pin_shared(unsigned long paddr)
480+
{
481+
return 0;
482+
}
483+
478484
static inline int uv_destroy_owned_page(unsigned long paddr)
479485
{
480486
return 0;

arch/s390/kernel/uv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void __init setup_uv(void)
8888
* Requests the Ultravisor to pin the page in the shared state. This will
8989
* cause an intercept when the guest attempts to unshare the pinned page.
9090
*/
91-
static int uv_pin_shared(unsigned long paddr)
91+
int uv_pin_shared(unsigned long paddr)
9292
{
9393
struct uv_cb_cfs uvcb = {
9494
.header.cmd = UVC_CMD_PIN_PAGE_SHARED,
@@ -100,6 +100,7 @@ static int uv_pin_shared(unsigned long paddr)
100100
return -EINVAL;
101101
return 0;
102102
}
103+
EXPORT_SYMBOL_GPL(uv_pin_shared);
103104

104105
/*
105106
* Requests the Ultravisor to destroy a guest page and make it

0 commit comments

Comments
 (0)