if ( d == NULL )
return -ESRCH;
- if ( cmd == XENMEM_set_pod_target )
+ if ( !is_hvm_domain(d) )
+ rc = -EINVAL;
+ else if ( cmd == XENMEM_set_pod_target )
{
rc = xsm_set_pod_target(XSM_PRIV, d);
if ( rc )
#include <asm/p2m.h>
#include "mm-locks.h"
+#include "p2m.h"
#define superpage_aligned(_x) (((_x)&(SUPERPAGE_PAGES-1))==0)
mfn_t mfn;
unsigned long i;
+ if ( !p2m_is_hostp2m(p2m) )
+ {
+ ASSERT_UNREACHABLE();
+ return false;
+ }
+
ASSERT(gfn_locked_by_me(p2m, gfn));
pod_lock(p2m);
#include <xsm/xsm.h>
#include "mm-locks.h"
+#include "p2m.h"
/* Override macro from asm/page.h to make work with mfn_t */
#undef virt_to_mfn
p2m->default_access = p2m_access_rwx;
p2m->p2m_class = p2m_host;
+ if ( !is_hvm_domain(d) )
+ return 0;
+
p2m_pod_init(p2m);
p2m_nestedp2m_init(p2m);
int rc;
rc = p2m_init_hostp2m(d);
- if ( rc )
+ if ( rc || !is_hvm_domain(d) )
return rc;
#ifdef CONFIG_HVM
--- /dev/null
+/******************************************************************************
+ * arch/x86/mm/p2m.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
+ */
+
+void p2m_pod_init(struct p2m_domain *p2m);
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */