2.6 uml & CONFIG_SMP fix
PATCH 1/1 2.6 uml & CONFIG_SMP fix
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
yesterday, I finally got around to fixing the code. Right now, it
compiles, but there are some warnings that I didn't take a look at. This patch makes it compile with CONFIG_SMP, nothing more.
I tested the resulting binary, and it works well in tt (I did NOT test skas.)
You should be able to pull the patch from
http://kernel.bkbits.net:14690/jeffpc/uml-smp/ (I think that pulling via web is not working, I'll check later.)
Jeff.
diff -Nru a/arch/um/Makefile b/arch/um/Makefile
- --- a/arch/um/Makefile Tue Feb 3 21:48:38 2004
+++ b/arch/um/Makefile Tue Feb 3 21:48:38 2004
@@ -170,7 +170,7 @@
ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
include/asm-um/arch:
- - cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch
+ cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch && ln -sf arch/spinlock.h
$(ARCH_DIR)/include/sysdep:
cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep
diff -Nru a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
- --- a/arch/um/kernel/irq.c Tue Feb 3 21:48:38 2004
+++ b/arch/um/kernel/irq.c Tue Feb 3 21:48:38 2004
@@ -584,7 +584,7 @@
unsigned long count, void *data)
{
int irq = (long) data, full_count = count, err;
- - cpumask_t new_value;
+ cpumask_t new_value, tmp;
if (!irq_desc[irq].handler->set_affinity)
return -EIO;
- --
"Intellectuals solve problems; geniuses prevent them"
- Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAIY28wFP0+seVj/4RAr8dAKCrYt3JZg+cFUIoKGVNpgxX9pGuqwCfUFsM vsjhr3DJcTBwzxkMwFNR+OU=
=GXuF
-----END PGP SIGNATURE-----
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Alle 01:26, giovedì 5 febbraio 2004, Josef 'Jeff' Sipek ha scritto:
Quoted 10 lines
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Hello,
yesterday, I finally got around to fixing the code. Right now, it
compiles, but there are some warnings that I didn't take a look at. This patch makes it compile withCONFIG_SMP, nothing more.
I tested the resulting binary, and it works well in tt (I did NOT test skas.)
Quoted 5 lines
You should be able to pull the patch from
http://kernel.bkbits.net:14690/jeffpc/uml-smp/ (I think that pulling via web is not working, I'll check later.)Jeff.
Without and with your patch, these warnings appear; they are some TODO needed to make SMP work actually.
arch/um/kernel/skas/process.c:372:2:
warning: #warning need cpu pid in switch_mm_skas
arch/um/kernel/skas/process.c:381:2:
warning: #warning need to loop over userspace_pids in kill_off_processes_skas
arch/um/kernel/skas/process_kern.c:179:2:
warning: #warning Need to look up userspace_pid by cpu
arch/um/kernel/skas/process_kern.c:185:2:
warning: #warning Need to look up userspace_pid by cpu
also, at arch/um/kernel/skas/process.c:98, NR_CPUS is defined as being 1, which actually disables SMP even with CONFIG_SMP enabled. If you try to change NR_CPUS to more than 1, you'll probably see (I guess since you also need to change some other code) that:
- more "kernel thread" should appear (thus
- until you fix the code marked with those warning, the kernel will not work well. If you don't succeed in this. For now those warning don't hurt because SMP is not *actually* enabled.
But do not directly change that: NR_CPUS in the UML kernel comes from a lot of different sources that assign to it different values: mainly /usr/include/linux/threads.h and <source tree>/include/linux/threads.h and arch/um/kernel/skas/process.c. And they all disagree. I.e. kern_util includes "linux/threads.h", but depending on the file it is included in it includes the system version (/usr/include) or the kernel version - and this cannot change. Please fix that - copy the relevant lines from <source tree>/include/linux/threads.h to kern_util.h.
Review line 590
Quoted 12 lines
diff -Nru
a/arch/um/kernel/irq.cb/arch/um/kernel/irq.c
- ---a/arch/um/kernel/irq.cTue Feb 3 21:48:38 2004
+++b/arch/um/kernel/irq.cTue Feb 3 21:48:38 2004(quoted diff) +1
-1@@ -584,7 +584,7 @@ unsigned long count, void *data) { int irq = (long) data, full_count = count, err; - - cpumask_t new_value; + cpumask_t new_value, tmp; if (!irq_desc[irq].handler->set_affinity) return -EIO;
That was removed because without CONFIG_SMP that is unused. So, give a look at arch/i386/kernel/irq.c and move the #ifdef CONFIG_SMP to the outer location (so to be around the whole irq_affinity_write_proc + the other similar stuff). If you have the time, there is a lot of other code to resync in those two files. Even moving the Uml specific stuff to another file and make the i386 work for both arch's (with proper #ifdef's, and remembering that it was *mostly copied*) would be very nice probably (there is a trick in the Makefiles to symlink files from other archs, like in the header you symlink).
Signature · 14 lines
Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Jeff Dike
AppliedQuoted 6 lines · Josef 'Jeff' Sipek
yesterday, I finally got around to fixing the code. Right now, it
compiles, but there are some warnings that I didn't take a look at. This patch makes it compile withCONFIG_SMP, nothing more.
I tested the resulting binary, and it works well in tt (I did NOT test skas.)
Applied, thanks. The spinlock.h part wasn't exactly right - the thing to do was create one that just includes the arch spinlock.h. Although, I'm not sure that symlinks are a bad idea in the case of those trivial headers.
Jeff
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 3 lines · Jeff Dike
Applied, thanks. The
spinlock.hpart wasn't exactly right - the thing to do was create one that just includes the archspinlock.h. Although, I'm not sure that symlinks are a bad idea in the case of those trivial headers.
That was a quick fix to make it compile. I have the next 9 days off, so I'll spend some quality time with the kernel :-)
Jeff.
- --
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFALYSzwFP0+seVj/4RAnCEAJ48X2ZFFolqeCQTsV+iakquJMHBMwCdGpUB r3rJMI3cJFXLEzy/3EFwWN8=
=LkAi
-----END PGP SIGNATURE-----
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel