linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] uml: fix undeclared variables
@ 2008-11-18 17:42 Américo Wang
  2008-11-18 19:26 ` Al Viro
  0 siblings, 1 reply; 5+ messages in thread
From: Américo Wang @ 2008-11-18 17:42 UTC (permalink / raw)
  To: LKML; +Cc: Al Viro, Andrew Morton, Jeff Dike, user-mode-linux-devel


Fix three compile errors about undeclared variables in
arch/um/kernel/mem.c.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>


---
diff --git a/arch/um/include/asm/fixmap.h b/arch/um/include/asm/fixmap.h
index 69c0252..0af143d 100644
--- a/arch/um/include/asm/fixmap.h
+++ b/arch/um/include/asm/fixmap.h
@@ -41,6 +41,9 @@ enum fixed_addresses {
 	__end_of_fixed_addresses
 };
 
+extern pte_t *pkmap_page_table;
+extern pte_t *kmap_pte;
+extern pgprot_t kmap_prot;
 extern void __set_fixmap (enum fixed_addresses idx,
 			  unsigned long phys, pgprot_t flags);
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Patch] uml: fix undeclared variables
  2008-11-18 17:42 [Patch] uml: fix undeclared variables Américo Wang
@ 2008-11-18 19:26 ` Al Viro
  2008-11-19 18:40   ` Américo Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2008-11-18 19:26 UTC (permalink / raw)
  To: Am??rico Wang; +Cc: LKML, Andrew Morton, Jeff Dike, user-mode-linux-devel

On Tue, Nov 18, 2008 at 05:42:51PM +0000, Am??rico Wang wrote:
> 
> Fix three compile errors about undeclared variables in
> arch/um/kernel/mem.c.

And what, pray tell, would initialize it?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch] uml: fix undeclared variables
  2008-11-18 19:26 ` Al Viro
@ 2008-11-19 18:40   ` Américo Wang
  2008-11-19 19:06     ` Al Viro
  0 siblings, 1 reply; 5+ messages in thread
From: Américo Wang @ 2008-11-19 18:40 UTC (permalink / raw)
  To: Al Viro
  Cc: Am??rico Wang, LKML, Andrew Morton, Jeff Dike, user-mode-linux-devel

On Tue, Nov 18, 2008 at 07:26:26PM +0000, Al Viro wrote:
>On Tue, Nov 18, 2008 at 05:42:51PM +0000, Am??rico Wang wrote:
>> 
>> Fix three compile errors about undeclared variables in
>> arch/um/kernel/mem.c.
>
>And what, pray tell, would initialize it?

Sorry, I can't fully understand you. I got the following error:

arch/um/kernel/mem.c: In function ‘init_highmem’:
arch/um/kernel/mem.c:177: error: ‘pkmap_page_table’ undeclared (first
use in this function)
arch/um/kernel/mem.c:177: error: (Each undeclared identifier is
reported only once
arch/um/kernel/mem.c:177: error: for each function it appears in.)

Thanks.

-- 
"Sometimes the only way to stay sane is to go a little crazy."


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch] uml: fix undeclared variables
  2008-11-19 18:40   ` Américo Wang
@ 2008-11-19 19:06     ` Al Viro
  2008-11-21 17:07       ` Américo Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2008-11-19 19:06 UTC (permalink / raw)
  To: Am??rico Wang; +Cc: LKML, Andrew Morton, Jeff Dike, user-mode-linux-devel

On Wed, Nov 19, 2008 at 06:40:14PM +0000, Am??rico Wang wrote:
> On Tue, Nov 18, 2008 at 07:26:26PM +0000, Al Viro wrote:
> >On Tue, Nov 18, 2008 at 05:42:51PM +0000, Am??rico Wang wrote:
> >> 
> >> Fix three compile errors about undeclared variables in
> >> arch/um/kernel/mem.c.
> >
> >And what, pray tell, would initialize it?
> 
> Sorry, I can't fully understand you. I got the following error:
> 
> arch/um/kernel/mem.c: In function ???init_highmem???:
> arch/um/kernel/mem.c:177: error: ???pkmap_page_table??? undeclared (first
> use in this function)
> arch/um/kernel/mem.c:177: error: (Each undeclared identifier is
> reported only once
> arch/um/kernel/mem.c:177: error: for each function it appears in.)

The error is there, all right.  However, proposed patch only hides the
real problem.  Building uml/i386 with CONFIG_HIGHMEM will result in
a badly broken kernel with that patch, with no visible hints at the
cause of problems.

You've got it to link, but that's not enough.  The problems you are seeing
come from arch/x86/mm/highmem_32.c.  It uses several variables from
arch/x86/mm/init_32.c and you have copied them to arch/um.  However, getting
these variable defined is not going to make it work - the code that used
to set it had been in init_32.c too and you've just left your copy initialized
to NULL.  Which will *not* work.

IOW, it's still broken, but now you have lost all indications regarding the
source of problem.

Folks, "it doesn't build in that config" is _better_ than "it builds with
no complaints, but resulting binary is FUBAR".  As a short-term solution -
make HIGHMEM in arch/um/Kconfig.um depend on BROKEN.  The proper fix, of
course, is to try and make it _work_, not just compile, but that's going
to take a fair amount of digging in uml and x86 low-level VM guts.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch] uml: fix undeclared variables
  2008-11-19 19:06     ` Al Viro
@ 2008-11-21 17:07       ` Américo Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Américo Wang @ 2008-11-21 17:07 UTC (permalink / raw)
  To: Al Viro; +Cc: LKML, Andrew Morton, Jeff Dike, user-mode-linux-devel

On Wed, Nov 19, 2008 at 07:06:36PM +0000, Al Viro wrote:
>On Wed, Nov 19, 2008 at 06:40:14PM +0000, Am??rico Wang wrote:
>> On Tue, Nov 18, 2008 at 07:26:26PM +0000, Al Viro wrote:
>> >On Tue, Nov 18, 2008 at 05:42:51PM +0000, Am??rico Wang wrote:
>> >> 
>> >> Fix three compile errors about undeclared variables in
>> >> arch/um/kernel/mem.c.
>> >
>> >And what, pray tell, would initialize it?
>> 
>> Sorry, I can't fully understand you. I got the following error:
>> 
>> arch/um/kernel/mem.c: In function ???init_highmem???:
>> arch/um/kernel/mem.c:177: error: ???pkmap_page_table??? undeclared (first
>> use in this function)
>> arch/um/kernel/mem.c:177: error: (Each undeclared identifier is
>> reported only once
>> arch/um/kernel/mem.c:177: error: for each function it appears in.)
>
>The error is there, all right.  However, proposed patch only hides the
>real problem.  Building uml/i386 with CONFIG_HIGHMEM will result in
>a badly broken kernel with that patch, with no visible hints at the
>cause of problems.
>
>You've got it to link, but that's not enough.  The problems you are seeing
>come from arch/x86/mm/highmem_32.c.  It uses several variables from
>arch/x86/mm/init_32.c and you have copied them to arch/um.  However, getting
>these variable defined is not going to make it work - the code that used
>to set it had been in init_32.c too and you've just left your copy initialized
>to NULL.  Which will *not* work.
>

Thanks for teaching this! I will look deep into this problem.


-- 
"Sometimes the only way to stay sane is to go a little crazy."


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-21 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-18 17:42 [Patch] uml: fix undeclared variables Américo Wang
2008-11-18 19:26 ` Al Viro
2008-11-19 18:40   ` Américo Wang
2008-11-19 19:06     ` Al Viro
2008-11-21 17:07       ` Américo Wang

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).