Re: [PATCH 05/14] x86, ACPI: Find acpi tables in initrd early at head_32.S/head64.c
On Thu, Mar 07, 2013 at 11:02:15PM -0800, Yinghai Lu wrote: > > Also, does it really have to be called from head_32.S? No way this > > can be done after entering C code? It would be great if you can > > explain overall design choices in the head message (and important > > patches). > > have to be with head_32.S and it is with 32bit flat mode, so could access > 4G blow without setting page table. > > Will try add to more in the change log. Yes, please. In the comment too. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] x86, ACPI: Find acpi tables in initrd early at head_32.S/head64.c
On Thu, Mar 7, 2013 at 9:57 PM, Tejun Heo wrote: > On Thu, Mar 07, 2013 at 08:58:31PM -0800, Yinghai Lu wrote: >> diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S >> index 73afd11..ca08f0e 100644 >> --- a/arch/x86/kernel/head_32.S >> +++ b/arch/x86/kernel/head_32.S >> @@ -149,6 +149,10 @@ ENTRY(startup_32) >> call load_ucode_bsp >> #endif >> >> +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE >> + call x86_acpi_override_find >> +#endif > > The function is always defined. We can probalby lose ifdef here? just mimic microcode updating again. > > Also, does it really have to be called from head_32.S? No way this > can be done after entering C code? It would be great if you can > explain overall design choices in the head message (and important > patches). have to be with head_32.S and it is with 32bit flat mode, so could access 4G blow without setting page table. Will try add to more in the change log. > >> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >> index 668e658..d43545a 100644 >> --- a/arch/x86/kernel/setup.c >> +++ b/arch/x86/kernel/setup.c >> @@ -424,6 +424,32 @@ static void __init reserve_initrd(void) >> } >> #endif /* CONFIG_BLK_DEV_INITRD */ >> >> +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE >> +void __init x86_acpi_override_find(void) >> +{ >> + unsigned long ramdisk_image, ramdisk_size; >> + unsigned char *p = NULL; >> + >> +#ifdef CONFIG_X86_32 >> + struct boot_params *boot_params_p; >> + >> + boot_params_p = (struct boot_params *)__pa_symbol(_params); >> + ramdisk_image = boot_params_p->hdr.ramdisk_image; >> + ramdisk_size = boot_params_p->hdr.ramdisk_size; >> + p = (unsigned char *)ramdisk_image; >> + acpi_initrd_override_find(p, ramdisk_size, true); >> +#else >> + ramdisk_image = get_ramdisk_image(); >> + ramdisk_size = get_ramdisk_size(); >> + if (ramdisk_image) >> + p = __va(ramdisk_image); >> + acpi_initrd_override_find(p, ramdisk_size, false); >> +#endif >> +} >> +#else >> +void __init x86_acpi_override_find(void) { } > > And add a comment here why we're not doing static inline for the dummy > function? ... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] x86, ACPI: Find acpi tables in initrd early at head_32.S/head64.c
On Thu, Mar 07, 2013 at 08:58:31PM -0800, Yinghai Lu wrote: > diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S > index 73afd11..ca08f0e 100644 > --- a/arch/x86/kernel/head_32.S > +++ b/arch/x86/kernel/head_32.S > @@ -149,6 +149,10 @@ ENTRY(startup_32) > call load_ucode_bsp > #endif > > +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE > + call x86_acpi_override_find > +#endif The function is always defined. We can probalby lose ifdef here? Also, does it really have to be called from head_32.S? No way this can be done after entering C code? It would be great if you can explain overall design choices in the head message (and important patches). > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index 668e658..d43545a 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -424,6 +424,32 @@ static void __init reserve_initrd(void) > } > #endif /* CONFIG_BLK_DEV_INITRD */ > > +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE > +void __init x86_acpi_override_find(void) > +{ > + unsigned long ramdisk_image, ramdisk_size; > + unsigned char *p = NULL; > + > +#ifdef CONFIG_X86_32 > + struct boot_params *boot_params_p; > + > + boot_params_p = (struct boot_params *)__pa_symbol(_params); > + ramdisk_image = boot_params_p->hdr.ramdisk_image; > + ramdisk_size = boot_params_p->hdr.ramdisk_size; > + p = (unsigned char *)ramdisk_image; > + acpi_initrd_override_find(p, ramdisk_size, true); > +#else > + ramdisk_image = get_ramdisk_image(); > + ramdisk_size = get_ramdisk_size(); > + if (ramdisk_image) > + p = __va(ramdisk_image); > + acpi_initrd_override_find(p, ramdisk_size, false); > +#endif > +} > +#else > +void __init x86_acpi_override_find(void) { } And add a comment here why we're not doing static inline for the dummy function? Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] x86, ACPI: Find acpi tables in initrd early at head_32.S/head64.c
On Thu, Mar 07, 2013 at 08:58:31PM -0800, Yinghai Lu wrote: diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 73afd11..ca08f0e 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -149,6 +149,10 @@ ENTRY(startup_32) call load_ucode_bsp #endif +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE + call x86_acpi_override_find +#endif The function is always defined. We can probalby lose ifdef here? Also, does it really have to be called from head_32.S? No way this can be done after entering C code? It would be great if you can explain overall design choices in the head message (and important patches). diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 668e658..d43545a 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -424,6 +424,32 @@ static void __init reserve_initrd(void) } #endif /* CONFIG_BLK_DEV_INITRD */ +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE +void __init x86_acpi_override_find(void) +{ + unsigned long ramdisk_image, ramdisk_size; + unsigned char *p = NULL; + +#ifdef CONFIG_X86_32 + struct boot_params *boot_params_p; + + boot_params_p = (struct boot_params *)__pa_symbol(boot_params); + ramdisk_image = boot_params_p-hdr.ramdisk_image; + ramdisk_size = boot_params_p-hdr.ramdisk_size; + p = (unsigned char *)ramdisk_image; + acpi_initrd_override_find(p, ramdisk_size, true); +#else + ramdisk_image = get_ramdisk_image(); + ramdisk_size = get_ramdisk_size(); + if (ramdisk_image) + p = __va(ramdisk_image); + acpi_initrd_override_find(p, ramdisk_size, false); +#endif +} +#else +void __init x86_acpi_override_find(void) { } And add a comment here why we're not doing static inline for the dummy function? Thanks. -- tejun -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] x86, ACPI: Find acpi tables in initrd early at head_32.S/head64.c
On Thu, Mar 7, 2013 at 9:57 PM, Tejun Heo t...@kernel.org wrote: On Thu, Mar 07, 2013 at 08:58:31PM -0800, Yinghai Lu wrote: diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 73afd11..ca08f0e 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -149,6 +149,10 @@ ENTRY(startup_32) call load_ucode_bsp #endif +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE + call x86_acpi_override_find +#endif The function is always defined. We can probalby lose ifdef here? just mimic microcode updating again. Also, does it really have to be called from head_32.S? No way this can be done after entering C code? It would be great if you can explain overall design choices in the head message (and important patches). have to be with head_32.S and it is with 32bit flat mode, so could access 4G blow without setting page table. Will try add to more in the change log. diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 668e658..d43545a 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -424,6 +424,32 @@ static void __init reserve_initrd(void) } #endif /* CONFIG_BLK_DEV_INITRD */ +#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE +void __init x86_acpi_override_find(void) +{ + unsigned long ramdisk_image, ramdisk_size; + unsigned char *p = NULL; + +#ifdef CONFIG_X86_32 + struct boot_params *boot_params_p; + + boot_params_p = (struct boot_params *)__pa_symbol(boot_params); + ramdisk_image = boot_params_p-hdr.ramdisk_image; + ramdisk_size = boot_params_p-hdr.ramdisk_size; + p = (unsigned char *)ramdisk_image; + acpi_initrd_override_find(p, ramdisk_size, true); +#else + ramdisk_image = get_ramdisk_image(); + ramdisk_size = get_ramdisk_size(); + if (ramdisk_image) + p = __va(ramdisk_image); + acpi_initrd_override_find(p, ramdisk_size, false); +#endif +} +#else +void __init x86_acpi_override_find(void) { } And add a comment here why we're not doing static inline for the dummy function? ... -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] x86, ACPI: Find acpi tables in initrd early at head_32.S/head64.c
On Thu, Mar 07, 2013 at 11:02:15PM -0800, Yinghai Lu wrote: Also, does it really have to be called from head_32.S? No way this can be done after entering C code? It would be great if you can explain overall design choices in the head message (and important patches). have to be with head_32.S and it is with 32bit flat mode, so could access 4G blow without setting page table. Will try add to more in the change log. Yes, please. In the comment too. -- tejun -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/