From: "=?utf-8?q?S=2E=C3=87a=C4=9Flar?= Onur" Subject: [PATCH] enable CONFIG_EDD for 3.1-testing Date: Mon, 4 Feb 2008 03:13:17 +0200 Message-ID: <200802040313.18833.caglar@pardus.org.tr> Reply-To: caglar@pardus.org.tr Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi; Following patch enables CONFIG_EDD (is needed for our distro. specific to= ols) for xen-3.1-testing, backported from xen-unstable ([1] and [2]). Ple= ase apply. =20 [1] http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/706976fe8333 [2] http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/6433fb4f88d6 Signed-off-by: S.=C3=87a=C4=9Flar Onur diff -r dbe47d8cb825 buildconfigs/linux-defconfig_xen0_x86_32 --- a/buildconfigs/linux-defconfig_xen0_x86_32 Thu Jan 31 10:07:57 2008 += 0000 +++ b/buildconfigs/linux-defconfig_xen0_x86_32 Mon Feb 04 03:06:47 2008 += 0200 @@ -155,12 +155,14 @@ CONFIG_VM86=3Dy # CONFIG_I8K is not set # CONFIG_X86_REBOOTFIXUPS is not set CONFIG_MICROCODE=3Dy +CONFIG_X86_MSR=3Dy CONFIG_X86_CPUID=3Dy CONFIG_SWIOTLB=3Dy =20 # # Firmware Drivers # +CONFIG_EDD=3Dy # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set # CONFIG_NOHIGHMEM is not set diff -r dbe47d8cb825 buildconfigs/linux-defconfig_xenU_x86_32 --- a/buildconfigs/linux-defconfig_xenU_x86_32 Thu Jan 31 10:07:57 2008 += 0000 +++ b/buildconfigs/linux-defconfig_xenU_x86_32 Mon Feb 04 03:06:47 2008 += 0200 @@ -152,12 +152,14 @@ CONFIG_VM86=3Dy # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_X86_REBOOTFIXUPS is not set +# CONFIG_X86_MSR is not set CONFIG_X86_CPUID=3Dy CONFIG_SWIOTLB=3Dy =20 # # Firmware Drivers # +# CONFIG_EDD is not set # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set # CONFIG_NOHIGHMEM is not set diff -r dbe47d8cb825 buildconfigs/linux-defconfig_xen_x86_32 --- a/buildconfigs/linux-defconfig_xen_x86_32 Thu Jan 31 10:07:57 2008 +0= 000 +++ b/buildconfigs/linux-defconfig_xen_x86_32 Mon Feb 04 03:06:47 2008 +0= 200 @@ -160,12 +160,14 @@ CONFIG_VM86=3Dy # CONFIG_I8K is not set # CONFIG_X86_REBOOTFIXUPS is not set CONFIG_MICROCODE=3Dy +CONFIG_X86_MSR=3Dy CONFIG_X86_CPUID=3Dm CONFIG_SWIOTLB=3Dy =20 # # Firmware Drivers # +CONFIG_EDD=3Dy CONFIG_DELL_RBU=3Dm CONFIG_DCDBAS=3Dm # CONFIG_NOHIGHMEM is not set diff -r dbe47d8cb825 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c --- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Thu Jan 31 10:07:= 57 2008 +0000 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Mon Feb 04 03:06:= 47 2008 +0200 @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -740,6 +741,7 @@ struct edd edd; #ifdef CONFIG_EDD_MODULE EXPORT_SYMBOL(edd); #endif +#ifndef CONFIG_XEN /** * copy_edd() - Copy the BIOS EDD information * from boot_params into a safe place. @@ -752,6 +754,7 @@ static inline void copy_edd(void) edd.mbr_signature_nr =3D EDD_MBR_SIG_NR; edd.edd_info_nr =3D EDD_NR; } +#endif #else static inline void copy_edd(void) { diff -r dbe47d8cb825 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Thu Jan 31 10:0= 7:57 2008 +0000 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Mon Feb 04 03:0= 6:47 2008 +0200 @@ -71,6 +71,7 @@ #include #include #include +#include #include #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) #define PFN_PHYS(x) ((x) << PAGE_SHIFT) @@ -534,6 +535,7 @@ struct edd edd; #ifdef CONFIG_EDD_MODULE EXPORT_SYMBOL(edd); #endif +#ifndef CONFIG_XEN /** * copy_edd() - Copy the BIOS EDD information * from boot_params into a safe place. @@ -546,6 +548,7 @@ static inline void copy_edd(void) edd.mbr_signature_nr =3D EDD_MBR_SIG_NR; edd.edd_info_nr =3D EDD_NR; } +#endif #else static inline void copy_edd(void) { diff -r dbe47d8cb825 linux-2.6-xen-sparse/drivers/firmware/Kconfig --- a/linux-2.6-xen-sparse/drivers/firmware/Kconfig Thu Jan 31 10:07:57 2= 008 +0000 +++ b/linux-2.6-xen-sparse/drivers/firmware/Kconfig Mon Feb 04 03:06:47 2= 008 +0200 @@ -8,7 +8,6 @@ config EDD config EDD tristate "BIOS Enhanced Disk Drive calls determine boot disk" depends on !IA64 - depends on !XEN help Say Y or M here if you want to enable BIOS Enhanced Disk Drive Services real mode BIOS calls to determine which disk diff -r dbe47d8cb825 linux-2.6-xen-sparse/drivers/xen/core/Makefile --- a/linux-2.6-xen-sparse/drivers/xen/core/Makefile Thu Jan 31 10:07:57 = 2008 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/core/Makefile Mon Feb 04 03:06:47 = 2008 +0200 @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # =20 -obj-y :=3D evtchn.o gnttab.o features.o reboot.o machine_reboot.o +obj-y :=3D evtchn.o gnttab.o features.o reboot.o machine_reboot.o firmwa= re.o =20 obj-$(CONFIG_PROC_FS) +=3D xen_proc.o obj-$(CONFIG_SYS_HYPERVISOR) +=3D hypervisor_sysfs.o diff -r dbe47d8cb825 linux-2.6-xen-sparse/drivers/xen/core/firmware.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/core/firmware.c Mon Feb 04 03:06:4= 7 2008 +0200 @@ -0,0 +1,56 @@ +#include +#include +#include +#include +#include +#include + +#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) +void __init copy_edd(void) +{ + int ret; + xen_platform_op_t op; + + if (!is_initial_xendomain()) + return; + + op.cmd =3D XENPF_firmware_info; + + for (op.u.firmware_info.index =3D 0, ret =3D 0; + ret !=3D -ESRCH && ret !=3D -ENOSYS && edd.edd_info_nr < EDDMAXNR; + ++op.u.firmware_info.index) { + struct edd_info *info =3D edd.edd_info + edd.edd_info_nr; + + op.u.firmware_info.type =3D XEN_FW_DISK_INFO; + info->params.length =3D sizeof(info->params); + set_xen_guest_handle(op.u.firmware_info.u.disk_info.edd_params, + &info->params); + ret =3D HYPERVISOR_platform_op(&op); + if (ret) + continue; + +#define C(x) info->x =3D op.u.firmware_info.u.disk_info.x + C(device); + C(version); + C(interface_support); + C(legacy_max_cylinder); + C(legacy_max_head); + C(legacy_sectors_per_track); +#undef C + + ++edd.edd_info_nr; + } + + op.u.firmware_info.type =3D XEN_FW_DISK_MBR_SIGNATURE; + for (op.u.firmware_info.index =3D 0, ret =3D 0; + (ret !=3D -ESRCH && ret !=3D -ENOSYS && + edd.mbr_signature_nr < EDD_MBR_SIG_MAX); + ++op.u.firmware_info.index) { + ret =3D HYPERVISOR_platform_op(&op); + if (ret) + continue; + edd.mbr_signature[edd.mbr_signature_nr++] =3D + op.u.firmware_info.u.disk_mbr_signature.mbr_signature; + } +} +#endif diff -r dbe47d8cb825 linux-2.6-xen-sparse/include/xen/firmware.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-2.6-xen-sparse/include/xen/firmware.h Mon Feb 04 03:06:47 200= 8 +0200=09 @@ -0,0 +1,8 @@ +#ifndef __XEN_FIRMWARE_H__ +#define __XEN_FIRMWARE_H__ + +#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) +void copy_edd(void); +#endif + +#endif /* __XEN_FIRMWARE_H__ */ Cheers --=20 S.=C3=87a=C4=9Flar Onur http://cekirdek.pardus.org.tr/~caglar/ Linux is like living in a teepee. No Windows, no Gates and an Apache in h= ouse!