#include <public/xen.h>
#include <public/physdev.h>
#include <xsm/xsm.h>
+#include <asm/p2m.h>
#ifndef COMPAT
typedef long ret_t;
break;
}
- case PHYSDEVOP_pirq_eoi_mfn: {
- struct physdev_pirq_eoi_mfn info;
+ case PHYSDEVOP_pirq_eoi_gmfn: {
+ struct physdev_pirq_eoi_gmfn info;
+ unsigned long mfn;
BUILD_BUG_ON(NR_IRQS > (PAGE_SIZE * 8));
break;
ret = -EINVAL;
- if ( !mfn_valid(info.mfn) ||
- !get_page_and_type(mfn_to_page(info.mfn), v->domain,
+ mfn = gmfn_to_mfn(current->domain, info.gmfn);
+ if ( !mfn_valid(mfn) ||
+ !get_page_and_type(mfn_to_page(mfn), v->domain,
PGT_writable_page) )
break;
- if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn, 0, info.mfn) != 0 )
+ if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn, 0, mfn) != 0 )
{
- put_page_and_type(mfn_to_page(info.mfn));
+ put_page_and_type(mfn_to_page(mfn));
ret = -EBUSY;
break;
}
- v->domain->arch.pirq_eoi_map = map_domain_page_global(info.mfn);
+ v->domain->arch.pirq_eoi_map = map_domain_page_global(mfn);
if ( v->domain->arch.pirq_eoi_map == NULL )
{
v->domain->arch.pirq_eoi_map_mfn = 0;
- put_page_and_type(mfn_to_page(info.mfn));
+ put_page_and_type(mfn_to_page(mfn));
ret = -ENOSPC;
break;
}
#define physdev_eoi compat_physdev_eoi
#define physdev_eoi_t physdev_eoi_compat_t
-#define physdev_pirq_eoi_mfn compat_physdev_pirq_eoi_mfn
-#define physdev_pirq_eoi_mfn_t physdev_pirq_eoi_mfn_compat_t
+#define physdev_pirq_eoi_gmfn compat_physdev_pirq_eoi_gmfn
+#define physdev_pirq_eoi_gmfn_t physdev_pirq_eoi_gmfn_compat_t
#define physdev_set_iobitmap compat_physdev_set_iobitmap
#define physdev_set_iobitmap_t physdev_set_iobitmap_compat_t
* will automatically get unmasked. The page registered is used as a bit
* array indexed by Xen's PIRQ value.
*/
-#define PHYSDEVOP_pirq_eoi_mfn 17
-struct physdev_pirq_eoi_mfn {
+#define PHYSDEVOP_pirq_eoi_gmfn 17
+struct physdev_pirq_eoi_gmfn {
/* IN */
- xen_pfn_t mfn;
+ xen_pfn_t gmfn;
};
-typedef struct physdev_pirq_eoi_mfn physdev_pirq_eoi_mfn_t;
-DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_mfn_t);
+typedef struct physdev_pirq_eoi_gmfn physdev_pirq_eoi_gmfn_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_gmfn_t);
/*
* Query the status of an IRQ line.