@@ -19,6 +19,7 @@
#include <alloc_page.h>
#include <asm/facility.h>
#include <bitops.h>
+#include <uv.h>
static int share_pages(void *p, int count)
{
@@ -47,7 +48,7 @@ void *alloc_io_mem(int size, int flags)
assert(size);
p = alloc_pages_flags(order, AREA_DMA31 | flags);
- if (!p || !test_facility(158))
+ if (!p || !uv_os_is_guest())
return p;
n = share_pages(p, 1 << order);
@@ -65,7 +66,7 @@ void free_io_mem(void *p, int size)
assert(IS_ALIGNED((uintptr_t)p, PAGE_SIZE));
- if (test_facility(158))
+ if (uv_os_is_guest())
unshare_pages(p, 1 << order);
free_pages(p);
}
@@ -16,6 +16,7 @@
#include <asm/facility.h>
#include <asm/uv.h>
#include <sclp.h>
+#include <uv.h>
static unsigned long page;
@@ -142,6 +143,11 @@ int main(void)
goto done;
}
+ if (!uv_os_is_guest()) {
+ report_skip("Not a protected guest");
+ goto done;
+ }
+
page = (unsigned long)alloc_page();
test_priv();
test_invalid();