static struct resource xen_hypervisor_res;
static struct resource *xen_phys_cpus;
+size_t vmcoreinfo_size_xen;
+unsigned long paddr_vmcoreinfo_xen;
+
void __init xen_machine_kexec_setup_resources(void)
{
xen_kexec_range_t range;
crashk_res.end = range.start + range.size - 1;
}
+ /* get physical address of vmcoreinfo */
+ memset(&range, 0, sizeof(range));
+ range.range = KEXEC_RANGE_MA_VMCOREINFO;
+
+ if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range))
+ return;
+
+ if (range.size) {
+ paddr_vmcoreinfo_xen = range.start;
+ vmcoreinfo_size_xen = range.size;
+ }
+
if (machine_kexec_setup_resources(&xen_hypervisor_res, xen_phys_cpus,
xen_max_nr_phys_cpus))
goto err;
#include <xen/features.h>
#include <xen/hypervisor_sysfs.h>
#include <xen/xenbus.h>
+#include <xen/interface/kexec.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mike D. Day <ncmike@us.ibm.com>");
&xen_properties_group);
}
+static ssize_t vmcoreinfo_show(struct hyp_sysfs_attr *attr, char *page)
+{
+ return sprintf(page, "%lx %zx\n",
+ paddr_vmcoreinfo_xen, vmcoreinfo_size_xen);
+}
+
+HYPERVISOR_ATTR_RO(vmcoreinfo);
+
+static int __init xen_sysfs_vmcoreinfo_init(void)
+{
+ return sysfs_create_file(&hypervisor_subsys.kset.kobj, &vmcoreinfo_attr.attr);
+}
+
+static void xen_sysfs_vmcoreinfo_destroy(void)
+{
+ sysfs_remove_file(&hypervisor_subsys.kset.kobj, &vmcoreinfo_attr.attr);
+}
+
static int __init hyper_sysfs_init(void)
{
int ret;
if (ret)
goto uuid_out;
ret = xen_properties_init();
+ if (ret)
+ goto prop_out;
+ ret = xen_sysfs_vmcoreinfo_init();
if (!ret)
goto out;
+ xen_properties_destroy();
+prop_out:
xen_sysfs_uuid_destroy();
uuid_out:
xen_compilation_destroy();
static void __exit hyper_sysfs_exit(void)
{
+ xen_sysfs_vmcoreinfo_destroy();
xen_properties_destroy();
xen_compilation_destroy();
xen_sysfs_uuid_destroy();
* the ia64_boot_param */
#define KEXEC_RANGE_MA_EFI_MEMMAP 5 /* machine address and size of
* of the EFI Memory Map */
+#define KEXEC_RANGE_MA_VMCOREINFO 6 /* machine address and size of vmcoreinfo */
+
+extern size_t vmcoreinfo_size_xen;
+extern unsigned long paddr_vmcoreinfo_xen;
/*
* Find the address and size of certain memory areas