[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/3] xsm: Add missing dummy hooks



A few XSM hooks have been defined without implementation in dummy.c;
these will cause a null function pointer deference if called. Also
implement the efi_call hook, which was incorrectly added without any
implementations.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 xen/xsm/dummy.c       | 30 ++++++++++++++++++++++++++++++
 xen/xsm/flask/hooks.c |  6 ++++++
 2 files changed, 36 insertions(+)

diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 7027ee7..5d35342 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -295,6 +295,21 @@ static char *dummy_show_security_evtchn (struct domain *d, 
const struct evtchn *
     return NULL;
 }
 
+static int dummy_get_pod_target(struct domain *d)
+{
+    return 0;
+}
+
+static int dummy_set_pod_target(struct domain *d)
+{
+    return 0;
+}
+
+static int dummy_get_device_group (uint32_t machine_bdf)
+{
+    return 0;
+}
+
 static int dummy_test_assign_device (uint32_t machine_bdf)
 {
     return 0;
@@ -503,6 +518,11 @@ static int dummy_firmware_info (void)
     return 0;
 }
 
+static int dummy_efi_call(void)
+{
+    return 0;
+}
+
 static int dummy_acpi_sleep (void)
 {
     return 0;
@@ -565,6 +585,11 @@ static int dummy_bind_pt_irq (struct domain *d, struct 
xen_domctl_bind_pt_irq *b
     return 0;
 }
 
+static int dummy_unbind_pt_irq (struct domain *d)
+{
+    return 0;
+}
+
 static int dummy_pin_mem_cacheattr (struct domain *d)
 {
     return 0;
@@ -652,6 +677,8 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, alloc_security_evtchn);
     set_to_dummy_if_null(ops, free_security_evtchn);
     set_to_dummy_if_null(ops, show_security_evtchn);
+    set_to_dummy_if_null(ops, get_pod_target);
+    set_to_dummy_if_null(ops, set_pod_target);
 
     set_to_dummy_if_null(ops, memory_adjust_reservation);
     set_to_dummy_if_null(ops, memory_stat_reservation);
@@ -670,6 +697,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, iomem_permission);
     set_to_dummy_if_null(ops, pci_config_permission);
 
+    set_to_dummy_if_null(ops, get_device_group);
     set_to_dummy_if_null(ops, test_assign_device);
     set_to_dummy_if_null(ops, assign_device);
     set_to_dummy_if_null(ops, deassign_device);
@@ -711,6 +739,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, physinfo);
     set_to_dummy_if_null(ops, platform_quirk);
     set_to_dummy_if_null(ops, firmware_info);
+    set_to_dummy_if_null(ops, efi_call);
     set_to_dummy_if_null(ops, acpi_sleep);
     set_to_dummy_if_null(ops, change_freq);
     set_to_dummy_if_null(ops, getidletime);
@@ -723,6 +752,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, remove_from_physmap);
     set_to_dummy_if_null(ops, sendtrigger);
     set_to_dummy_if_null(ops, bind_pt_irq);
+    set_to_dummy_if_null(ops, unbind_pt_irq);
     set_to_dummy_if_null(ops, pin_mem_cacheattr);
     set_to_dummy_if_null(ops, ext_vcpucontext);
     set_to_dummy_if_null(ops, vcpuextstate);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 23b84f3..de79d66 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1280,6 +1280,11 @@ static int flask_firmware_info(void)
     return domain_has_xen(current->domain, XEN__FIRMWARE);
 }
 
+static int flask_efi_call(void)
+{
+    return domain_has_xen(current->domain, XEN__FIRMWARE);
+}
+
 static int flask_acpi_sleep(void)
 {
     return domain_has_xen(current->domain, XEN__SLEEP);
@@ -1663,6 +1668,7 @@ static struct xsm_operations flask_ops = {
     .physinfo = flask_physinfo,
     .platform_quirk = flask_platform_quirk,
     .firmware_info = flask_firmware_info,
+    .efi_call = flask_efi_call,
     .acpi_sleep = flask_acpi_sleep,
     .change_freq = flask_change_freq,
     .getidletime = flask_getidletime,
-- 
1.7.11.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.