* [PATCH] i386: modified CONFIG_PHYSICAL_ALIGN @ 2007-08-14 0:55 Yoshimi Ichiyanagi 2007-08-14 3:29 ` Andi Kleen 0 siblings, 1 reply; 5+ messages in thread From: Yoshimi Ichiyanagi @ 2007-08-14 0:55 UTC (permalink / raw) To: rusty; +Cc: moriai.satoshi, virtualization CONFIG_PHYSICAL_ALIGN gives the physical address's alignment where the kernel is loaded. CONFIG_PHYSICAL_ALIGN's default value is different from i386 kernel with the x86_84 kernel. The i386's default CONFIG_PHYSICAL_ALIGN value is 1MB, but the x86_64's is 2MB. The problem is, if you compile x86_64 kernel, the value of CONFIG_PHYSICAL_ALIGN will be fixed, and the next time you compile i386 kernel, previous CONFIG_PHYSICAL_ALIGN value of x86_64(default: 2MB) will be used by default. The follwing patch will fix this problem. With this patch, either CONFIG_RELOCATABLE's option or CONFIG_EMNBEDDED's option is set "Y", you can configure the value of CONFIG_PHYSICAL_ALIGN. Signed-off-by: Yoshimi Ichiyanagi <ichiyanagi.yoshimi@lab.ntt.co.jp> --- diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index f952493..05c3316 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -880,7 +880,7 @@ config RELOCATABLE kernel. config PHYSICAL_ALIGN - hex "Alignment value to which kernel should be aligned" + hex "Alignment value to which kernel should be aligned" if (EMBEDDED || RELOCATABLE) default "0x100000" range 0x2000 0x400000 help -- Yoshimi Ichiyanagi Open source software computing project, NTT Cyber Space Laboratories E-mail : ichiyanagi.yoshimi@lab.ntt.co.jp ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] i386: modified CONFIG_PHYSICAL_ALIGN 2007-08-14 0:55 [PATCH] i386: modified CONFIG_PHYSICAL_ALIGN Yoshimi Ichiyanagi @ 2007-08-14 3:29 ` Andi Kleen 2007-08-14 3:17 ` Rusty Russell 0 siblings, 1 reply; 5+ messages in thread From: Andi Kleen @ 2007-08-14 3:29 UTC (permalink / raw) To: Yoshimi Ichiyanagi; +Cc: zippel, moriai.satoshi, virtualization On Tue, Aug 14, 2007 at 09:55:50AM +0900, Yoshimi Ichiyanagi wrote: How is this related to virtualization? > The problem is, if you compile x86_64 kernel, the value of > CONFIG_PHYSICAL_ALIGN will be fixed, and the next time you compile i386 > kernel, previous CONFIG_PHYSICAL_ALIGN value of x86_64(default: 2MB) will > be used by default. 2/4MB is better for i386 too for PAE/non PAE because it will use less TLB entries. I guess it's better to just change the defaults. Anyways, both values should work, or did you see failures? > The follwing patch will fix this problem. With this patch, either > CONFIG_RELOCATABLE's option or CONFIG_EMNBEDDED's option is set "Y", > you can configure the value of CONFIG_PHYSICAL_ALIGN. How does that change anything? iirc what you want cannot be really expressed in Kconfig :- what you would really want is a flag for the number that says "this came from a default value and user hasn't changed it" and then Kconfig knowing that if the new default is different change it to new default. But I'm not sure such complexity would be really a good idea. Probably it's not. -Andi ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i386: modified CONFIG_PHYSICAL_ALIGN 2007-08-14 3:29 ` Andi Kleen @ 2007-08-14 3:17 ` Rusty Russell 2007-08-14 8:59 ` Yoshimi Ichiyanagi 2007-08-14 18:35 ` Jeremy Fitzhardinge 0 siblings, 2 replies; 5+ messages in thread From: Rusty Russell @ 2007-08-14 3:17 UTC (permalink / raw) To: Andi Kleen; +Cc: zippel, moriai.satoshi, Yoshimi Ichiyanagi, virtualization On Tue, 2007-08-14 at 05:29 +0200, Andi Kleen wrote: > On Tue, Aug 14, 2007 at 09:55:50AM +0900, Yoshimi Ichiyanagi wrote: > > How is this related to virtualization? > > > The problem is, if you compile x86_64 kernel, the value of > > CONFIG_PHYSICAL_ALIGN will be fixed, and the next time you compile i386 > > kernel, previous CONFIG_PHYSICAL_ALIGN value of x86_64(default: 2MB) will > > be used by default. > > 2/4MB is better for i386 too for PAE/non PAE because > it will use less TLB entries. I guess it's better to just change > the defaults. > > Anyways, both values should work, or did you see > failures? I had this problem too: Lguest assumes 1MB when loading bzImages, and the only time that gets changed is when building from an x86-64 config. I considered it purely an lguest issue. The correct fix is to have lguest run bzImages rather than trying to unpack them itself, but that requires a bootloader change, and the proposals to do that got lost in a flurry of far more ambitious patches. Jeremy would know the status of that work... Rusty. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i386: modified CONFIG_PHYSICAL_ALIGN 2007-08-14 3:17 ` Rusty Russell @ 2007-08-14 8:59 ` Yoshimi Ichiyanagi 2007-08-14 18:35 ` Jeremy Fitzhardinge 1 sibling, 0 replies; 5+ messages in thread From: Yoshimi Ichiyanagi @ 2007-08-14 8:59 UTC (permalink / raw) To: Rusty Russell, Andi Kleen; +Cc: zippel, moriai.satoshi, virtualization Tue, 14 Aug 2007 13:17:28 +1000Rusty Russell <rusty@rustcorp.com.au> wrote >On Tue, 2007-08-14 at 05:29 +0200, Andi Kleen wrote: >> On Tue, Aug 14, 2007 at 09:55:50AM +0900, Yoshimi Ichiyanagi wrote: >> >> How is this related to virtualization? >> >> > The problem is, if you compile x86_64 kernel, the value of >> > CONFIG_PHYSICAL_ALIGN will be fixed, and the next time you compile i386 >> > kernel, previous CONFIG_PHYSICAL_ALIGN value of x86_64(default: 2MB) will >> > be used by default. >> >> 2/4MB is better for i386 too for PAE/non PAE because >> it will use less TLB entries. I guess it's better to just change >> the defaults. >> >> Anyways, both values should work, or did you see >> failures? > >I had this problem too: Lguest assumes 1MB when loading bzImages, and >the only time that gets changed is when building from an x86-64 config. >I considered it purely an lguest issue. > >The correct fix is to have lguest run bzImages rather than trying to >unpack them itself, but that requires a bootloader change, and the >proposals to do that got lost in a flurry of far more ambitious patches. > >Jeremy would know the status of that work... >Rusty. I think following 2 ways to gets the physical address where kernel loads : 1). Get the address from configuration file(i.e. .config) such as CONFIG_PAGE_OFFSET 2). Get the address from the bzImage In case 1), it's problem when configuration file(i.e. .config) does not exist. In case 2), it's necessary to copy "struct setup_header" which is defined in the kernel header file. You can not include this kernel header file in lguest utility's source file, because it can not solve the symbol for kernel(i.e. #ifdef __KERNEL__). Which is good? do you have any idea? Tue, 14 Aug 2007 05:29:03 +0200Andi Kleen <ak@suse.de> wrote : >On Tue, Aug 14, 2007 at 09:55:50AM +0900, Yoshimi Ichiyanagi wrote: > >> The following patch will fix this problem. With this patch, either >> CONFIG_RELOCATABLE's option or CONFIG_EMNBEDDED's option is set "Y", >> you can configure the value of CONFIG_PHYSICAL_ALIGN. > >How does that change anything? > >iirc what you want cannot be really expressed in Kconfig :- what >you would really want is a flag for the number that says >"this came from a default value and user hasn't changed it" >and then Kconfig knowing that if the new default is different >change it to new default. But I'm not sure such complexity would be really >a good idea. Probably it's not. Take a look at CONFIG_PHYSICAL_START. I modified CONFIG_PHYSICAL_ALIGN's configuration to be similar to CONFIG_PHYSICAL_START's configuration. -- Yoshimi Ichiyanagi Open source software computing project, NTT Cyber Space Laboratories ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i386: modified CONFIG_PHYSICAL_ALIGN 2007-08-14 3:17 ` Rusty Russell 2007-08-14 8:59 ` Yoshimi Ichiyanagi @ 2007-08-14 18:35 ` Jeremy Fitzhardinge 1 sibling, 0 replies; 5+ messages in thread From: Jeremy Fitzhardinge @ 2007-08-14 18:35 UTC (permalink / raw) To: Rusty Russell; +Cc: zippel, moriai.satoshi, Yoshimi Ichiyanagi, virtualization Rusty Russell wrote: > On Tue, 2007-08-14 at 05:29 +0200, Andi Kleen wrote: > >> On Tue, Aug 14, 2007 at 09:55:50AM +0900, Yoshimi Ichiyanagi wrote: >> >> How is this related to virtualization? >> >> >>> The problem is, if you compile x86_64 kernel, the value of >>> CONFIG_PHYSICAL_ALIGN will be fixed, and the next time you compile i386 >>> kernel, previous CONFIG_PHYSICAL_ALIGN value of x86_64(default: 2MB) will >>> be used by default. >>> >> 2/4MB is better for i386 too for PAE/non PAE because >> it will use less TLB entries. I guess it's better to just change >> the defaults. >> >> Anyways, both values should work, or did you see >> failures? >> > > I had this problem too: Lguest assumes 1MB when loading bzImages, and > the only time that gets changed is when building from an x86-64 config. > I considered it purely an lguest issue. > > The correct fix is to have lguest run bzImages rather than trying to > unpack them itself, but that requires a bootloader change, and the > proposals to do that got lost in a flurry of far more ambitious patches. > > Jeremy would know the status of that work... > A bit stalled. The format I proposed could theoretically break some bootloaders, and Eric has been too busy to talk about it. But we'll need to give it another go soon. J ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-14 18:35 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-08-14 0:55 [PATCH] i386: modified CONFIG_PHYSICAL_ALIGN Yoshimi Ichiyanagi 2007-08-14 3:29 ` Andi Kleen 2007-08-14 3:17 ` Rusty Russell 2007-08-14 8:59 ` Yoshimi Ichiyanagi 2007-08-14 18:35 ` Jeremy Fitzhardinge
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).