Date: Tue, 20 Jan 2015 12:28:24 +0000 (UTC) From: Roger Pau Monné <royger@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277418 - in head/sys: boot/i386/libi386 x86/xen Message-ID: <201501201228.t0KCSOPR082941@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: royger Date: Tue Jan 20 12:28:24 2015 New Revision: 277418 URL: https://svnweb.freebsd.org/changeset/base/277418 Log: loader: fix the size of MODINFOMD_MODULEP The data in MODINFOMD_MODULEP is packed by the loader as a 4 byte type, but the amd64 kernel expects a vm_paddr_t, which is of size 8 bytes. Fix this by saving it as 8 bytes in the loader and retrieving it using the proper type in the kernel. Sponsored by: Citrix Systems R&D Modified: head/sys/boot/i386/libi386/bootinfo64.c head/sys/x86/xen/pv.c Modified: head/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- head/sys/boot/i386/libi386/bootinfo64.c Tue Jan 20 11:43:16 2015 (r277417) +++ head/sys/boot/i386/libi386/bootinfo64.c Tue Jan 20 12:28:24 2015 (r277418) @@ -185,6 +185,7 @@ bi_load64(char *args, vm_offset_t addr, struct file_metadata *md; u_int64_t kernend; u_int64_t envp; + u_int64_t module; vm_offset_t size; char *rootdevname; int howto; @@ -222,7 +223,7 @@ bi_load64(char *args, vm_offset_t addr, addr = roundup(addr, PAGE_SIZE); /* place the metadata before anything */ - *modulep = addr; + module = *modulep = addr; kfp = file_findfile(NULL, "elf kernel"); if (kfp == NULL) @@ -233,7 +234,7 @@ bi_load64(char *args, vm_offset_t addr, file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); - file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof modulep, modulep); + file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof module, &module); if (add_smap != 0) bios_addsmapdata(kfp); Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Jan 20 11:43:16 2015 (r277417) +++ head/sys/x86/xen/pv.c Tue Jan 20 12:28:24 2015 (r277418) @@ -402,7 +402,7 @@ xen_pv_parse_preload_data(u_int64_t modu * then calculating the offset with mod_start, * which contains the relocated modulep address. */ - metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, int); + metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, vm_paddr_t); off = HYPERVISOR_start_info->mod_start - metadata; preload_bootstrap_relocate(off);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501201228.t0KCSOPR082941>