Re: [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering

2022-10-21 Thread Richard Weinberger
- Ursprüngliche Mail -
> Von: "Guilherme G. Piccoli" 
> Hi Richard / Johannes, is there any news on this one?
> Thanks in advance,

It's upstream:
git.kernel.org/linus/758dfdb9185cf94160f20e85bbe05583e3cd4ff4

Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering

2022-09-19 Thread Richard Weinberger
- Ursprüngliche Mail -
> Von: "Guilherme G. Piccoli" 
> On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
>> Currently the panic notifiers from user mode linux don't follow
>> the convention for most of the other notifiers present in the
>> kernel (indentation, priority setting, numeric return).
>> More important, the priorities could be improved, since it's a
>> special case (userspace), hence we could run the notifiers earlier;
>> user mode linux shouldn't care much with other panic notifiers but
>> the ordering among the mconsole and arch notifier is important,
>> given that the arch one effectively triggers a core dump.
>> 
>> Fix that by running the mconsole notifier as the first panic
>> notifier, followed by the architecture one (that coredumps).
>> 
>> Cc: Anton Ivanov 
>> Cc: Johannes Berg 
>> Cc: Richard Weinberger 
>> Signed-off-by: Guilherme G. Piccoli 
>> 
>> V3:
>> - No changes.
>> [...]
> 
> Hi Johannes, sorry for the ping. Do you think you could pick this one?
> Or if you prefer, I can resend it alone (not in the series) - let me
> know your preference.

This patch is on my TODO list.
Just had no chance to test it.

Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
Am 11.10.2013 18:55, schrieb Matthew Garrett:
> On Fri, Oct 11, 2013 at 06:47:19PM +0200, Richard Weinberger wrote:
> 
>> But you still need a magic tool which create you this list.
> 
> I just read /proc/kallsyms. I'm really not doing anything complicated.
> 
>> If you have a tool which takes two kernel images and create such
>> a delta, fine.
> 
> Isn't that ksplice?

So, you have a variant of ksplice which is able to kexec?

Thanks,
//richard


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
Am 11.10.2013 18:44, schrieb Matthew Garrett:
> On Fri, Oct 11, 2013 at 06:42:36PM +0200, Richard Weinberger wrote:
>> On Fri, Oct 11, 2013 at 6:39 PM, Matthew Garrett  wrote:
>>> On Fri, Oct 11, 2013 at 06:33:23PM +0200, Richard Weinberger wrote:
>>>> On Fri, Oct 11, 2013 at 5:48 PM, Matthew Garrett  
>>>> wrote:
>>>>> On Fri, Oct 11, 2013 at 11:44:50AM -0400, Vivek Goyal wrote:
>>>>>
>>>>>> Just Curious. How is it useful. IOW, what's your use case of booting a 
>>>>>> new
>>>>>> kernel and then jumping back.
>>>>>
>>>>> I'm kexecing into a kernel with a modified /dev/mem, modifying the
>>>>> original kernel and then jumping back into it.
>>>>
>>>> How do you update the original kernel?
>>>
>>> It's still in RAM, so the same way you'd modify any other arbitrary
>>> physical address?
>>
>> So, you have a tool like ksplice which patches the kernel in RAM?
> 
> I have /dev/mem and a list of addresses I want to modify.

But you still need a magic tool which create you this list.
If you have a tool which takes two kernel images and create such
a delta, fine.
I'm interested in that tool. :-)

Thanks,
//richard


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
On Fri, Oct 11, 2013 at 6:39 PM, Matthew Garrett  wrote:
> On Fri, Oct 11, 2013 at 06:33:23PM +0200, Richard Weinberger wrote:
>> On Fri, Oct 11, 2013 at 5:48 PM, Matthew Garrett  wrote:
>> > On Fri, Oct 11, 2013 at 11:44:50AM -0400, Vivek Goyal wrote:
>> >
>> >> Just Curious. How is it useful. IOW, what's your use case of booting a new
>> >> kernel and then jumping back.
>> >
>> > I'm kexecing into a kernel with a modified /dev/mem, modifying the
>> > original kernel and then jumping back into it.
>>
>> How do you update the original kernel?
>
> It's still in RAM, so the same way you'd modify any other arbitrary
> physical address?

So, you have a tool like ksplice which patches the kernel in RAM?

-- 
Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
On Fri, Oct 11, 2013 at 5:48 PM, Matthew Garrett  wrote:
> On Fri, Oct 11, 2013 at 11:44:50AM -0400, Vivek Goyal wrote:
>
>> Just Curious. How is it useful. IOW, what's your use case of booting a new
>> kernel and then jumping back.
>
> I'm kexecing into a kernel with a modified /dev/mem, modifying the
> original kernel and then jumping back into it.

How do you update the original kernel?
Sounds interesting.

-- 
Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH 2/2] [RFC] get rid of dist

2013-04-02 Thread Richard Weinberger
Am Tue, 2 Apr 2013 18:03:07 +0900
schrieb Simon Horman :

> On Tue, Apr 02, 2013 at 07:20:51AM +0200, Richard Weinberger wrote:
> > Am Tue, 02 Apr 2013 14:09:02 +0800
> > schrieb Zhang Yanfei :
> > > Yeah, this is one case.
> > > 
> > > Someone may also download a kexec-tools tarball from internet,
> > > and then want to build a RPM. Even git isn't installed in his
> > > system, the RPM could be built.
> > 
> > Building the tarball is maintainer work.
> > The maintainer creates a "clean" tarball to distribute it.
> > Don't tell me that the maintainer has no git installed.
> > 
> > End users fetch the generated tarball to build/distribute
> > kexec-tools. AFAIK the rpm spec file is generated and only
> > available in the generated tarball. They don't need git. Only the
> > maintainer which generates the distribution tarball needs git...
> 
> There are many ways to obtain kexec-tools.
> I'm really not very exited about requiring git to make a tarball.

So, messing around in every Makefile with "dist +=" is better...?
What about having a dist_file file in the top level directory?

Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH 2/2] [RFC] get rid of dist

2013-04-01 Thread Richard Weinberger
Am Tue, 02 Apr 2013 14:09:02 +0800
schrieb Zhang Yanfei :
> Yeah, this is one case.
> 
> Someone may also download a kexec-tools tarball from internet,
> and then want to build a RPM. Even git isn't installed in his system,
> the RPM could be built.

Building the tarball is maintainer work.
The maintainer creates a "clean" tarball to distribute it.
Don't tell me that the maintainer has no git installed.

End users fetch the generated tarball to build/distribute kexec-tools.
AFAIK the rpm spec file is generated and only available in the generated
tarball. They don't need git. Only the maintainer which generates the 
distribution
tarball needs git...

Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH 2/2] [RFC] get rid of dist

2013-04-01 Thread Richard Weinberger

Am 02.04.2013 07:51, schrieb Zhang Yanfei:

于 2013年04月02日 13:36, Richard Weinberger 写道:

Simon,

Am 02.04.2013 03:10, schrieb Simon Horman:

On Mon, Apr 01, 2013 at 01:23:05PM +0200, Richard Weinberger wrote:

Replace the dist variable by git ls-files.
The following files are now included in the dist tarball too:


I'm sorry but I don't think it is reasonable to
add git as a requirement for building a tarball.


It is not about building a tarball, it is about tracking files.
Currently you are abusing make to keep track of your files.
git does this already for you.
Tracking files manually in the Makefile is also error prone.
doc/mpc85xx.txt and arch/i386/timer.c have already been forgotten...
If I'm not mistaken kexec-tools uses git as SCM, so you'll need
git anyways to checkout the source and work with it.



I think what simon meant is that by using current ways, we can build a
tarball without git installed. By using your ways, if we want to build
a tarball, git is a must. So it is unnecessary to add git as a requirement
for there may be some condtions that we want to build a clean tarball in a
git-not-installed system.


But git is already a requirement to checkout the source from the git repo.
Or I'm mistaken?

Thanks,
//richard


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH 2/2] [RFC] get rid of dist

2013-04-01 Thread Richard Weinberger

Simon,

Am 02.04.2013 03:10, schrieb Simon Horman:

On Mon, Apr 01, 2013 at 01:23:05PM +0200, Richard Weinberger wrote:

Replace the dist variable by git ls-files.
The following files are now included in the dist tarball too:


I'm sorry but I don't think it is reasonable to
add git as a requirement for building a tarball.


It is not about building a tarball, it is about tracking files.
Currently you are abusing make to keep track of your files.
git does this already for you.
Tracking files manually in the Makefile is also error prone.
doc/mpc85xx.txt and arch/i386/timer.c have already been forgotten...
If I'm not mistaken kexec-tools uses git as SCM, so you'll need
git anyways to checkout the source and work with it.

Thanks,
//richard


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH 2/2 v2] [RFC] get rid of dist

2013-04-01 Thread Richard Weinberger
Replace the dist variable by git ls-files.
The following files are now included in the dist tarball too:

bootstrap
doc/mpc85xx.txt
.gitignore
kexec/.gitignore
kexec/libfdt/TODO

Signed-off-by: Richard Weinberger 
---
 Makefile.in|  8 +++-
 doc/Makefile   |  5 -
 include/Makefile   | 13 -
 kdump/Makefile |  1 -
 kexec/Makefile | 16 
 kexec/arch/alpha/Makefile  |  3 ---
 kexec/arch/arm/Makefile|  4 
 kexec/arch/cris/Makefile   |  5 -
 kexec/arch/i386/Makefile   |  5 -
 kexec/arch/ia64/Makefile   |  6 --
 kexec/arch/mips/Makefile   |  5 -
 kexec/arch/ppc/Makefile|  7 ---
 kexec/arch/ppc64/Makefile  |  5 -
 kexec/arch/s390/Makefile   |  4 
 kexec/arch/sh/Makefile |  5 -
 kexec/arch/x86_64/Makefile |  5 -
 kexec/libfdt/Makefile.libfdt   |  5 -
 kexec_test/Makefile|  3 ---
 purgatory/Makefile |  3 ---
 purgatory/arch/alpha/Makefile  |  3 ---
 purgatory/arch/arm/Makefile|  4 
 purgatory/arch/i386/Makefile   |  6 --
 purgatory/arch/ia64/Makefile   |  4 
 purgatory/arch/mips/Makefile   |  4 
 purgatory/arch/ppc/Makefile|  4 
 purgatory/arch/ppc64/Makefile  |  4 
 purgatory/arch/s390/Makefile   |  3 ---
 purgatory/arch/sh/Makefile |  3 ---
 purgatory/arch/x86_64/Makefile |  5 -
 util/Makefile  |  1 -
 util_lib/Makefile  |  2 --
 vmcore-dmesg/Makefile  |  1 -
 32 files changed, 3 insertions(+), 149 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index c1859d1..ae1dd2c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -119,9 +119,6 @@ all: targets
 # collect objects to be removed in 'make clean'
 clean =
 
-dist = AUTHORS COPYING INSTALL News TODO Makefile.in configure.ac configure \
-   kexec-tools.spec.in config/
-
 # utility function for converting a list of files (with extension) to
 # file.o (or file.d) format.
 objify = $(addsuffix .o, $(basename $(1)))
@@ -172,7 +169,8 @@ SPEC=$(PACKAGE_NAME).spec
 GENERATED_SRCS:= $(SPEC)
 TARBALL=$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
 TARBALL.gz=$(TARBALL).gz
-SRCS:= $(dist)
+SRCS:= $(shell git ls-files) configure include/config.h include/config.h.in \
+   kexec/purgatory.c kexec-tools.spec
 PSRCS:=$(foreach s, $(SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))
 PGSRCS:=$(foreach s, $(GENERATED_SRCS), 
$(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))
 
@@ -201,7 +199,7 @@ $(TARBALL): $(SRCS) $(GENERATED_SRCS)
$(LN) -sf . $(PACKAGE_NAME)-$(PACKAGE_VERSION)
$(TAR) -rf $@ $(PGSRCS)
$(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)
-   @echo $(dist)
+   @echo $(SRCS)
 
 $(TARBALL.gz): $(TARBALL)
gzip -c < $^ > $@
diff --git a/doc/Makefile b/doc/Makefile
index 3442e09..e69de29 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,5 +0,0 @@
-dist += doc/Makefile   \
-   doc/linux-i386-boot.txt \
-   doc/linux-i386-zero-page.txt\
-   doc/multiboot.html  \
-   doc/nbi-spec.txt
diff --git a/include/Makefile b/include/Makefile
index c26b503..e69de29 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -1,13 +0,0 @@
-dist += include/Makefile   \
-   include/config.h\
-   include/config.h.in \
-   include/kexec-uImage.h  \
-   include/x86/x86-linux.h \
-   include/x86/mb_info.h   \
-   include/x86/mb_header.h \
-   include/elf.h   \
-   include/image.h \
-   include/unused.h\
-   include/boot/linuxbios_tables.h \
-   include/boot/beoboot.h  \
-   include/boot/elf_boot.h
diff --git a/kdump/Makefile b/kdump/Makefile
index 307d59d..1ad36b2 100644
--- a/kdump/Makefile
+++ b/kdump/Makefile
@@ -10,7 +10,6 @@ KDUMP_DEPS = $(call depify, $(KDUMP_OBJS))
 KDUMP = $(SBINDIR)/kdump
 KDUMP_MANPAGE = $(MANDIR)/man8/kdump.8
 
-dist += kdump/Makefile $(KDUMP_SRCS) kdump/kdump.8
 clean += $(KDUMP_OBJS) $(KDUMP_DEPS) $(KDUMP) $(KDUMP_MANPAGE)
 
 -include $(KDUMP_DEPS)
diff --git a/kexec/Makefile b/kexec/Makefile
index 8a6138d..dced4eb 100644
--- a/kexec/Makefile
+++ b/kexec/Makefile
@@ -28,43 +28,27 @@ KEXEC_SRCS_base += kexec/zlib.c
 
 KEXEC_GENERATED_SRCS += $(PURGATORY_HEX_C)
 
-dist += kexec/Makefile $(KEXEC_GENERATED_SRCS) \
-   $(KEXEC_SRCS_base) kexec/crashdump-elf.c\
-   kexec/crashdump.h kexec/firmware_memmap.h   \
-   kexec/kexec-elf-boot.h  \
-   kexec/kexec-elf.h kexec/kexec-sha256.h  \
-   kexec/kexec-zlib.h kexec/kexec-lzma.h   \
-   kexec/kexec-syscall.h kexec/kexec.h kexec/kexec.8
-
-dist   += kexec/proc_iomem.c
 $(ARCH)_PROC_IOMEM 

Re: [PATCH 2/2] [RFC] get rid of dist

2013-04-01 Thread Richard Weinberger

Am 01.04.2013 13:23, schrieb Richard Weinberger:

-SRCS:= $(dist)
+SRCS:= $(call git ls-files) configure include/config.h include/config.h.in \
+   kexec/purgatory.c kexec-tools.spec


*grrr*, s/call/shell/g

A new patch is on the way.

Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH 2/2] [RFC] get rid of dist

2013-04-01 Thread Richard Weinberger
Replace the dist variable by git ls-files.
The following files are now included in the dist tarball too:

bootstrap
doc/mpc85xx.txt
.gitignore
kexec/.gitignore
kexec/libfdt/TODO

Signed-off-by: Richard Weinberger 
---
 Makefile.in|  8 +++-
 doc/Makefile   |  5 -
 include/Makefile   | 13 -
 kdump/Makefile |  1 -
 kexec/Makefile | 16 
 kexec/arch/alpha/Makefile  |  3 ---
 kexec/arch/arm/Makefile|  4 
 kexec/arch/cris/Makefile   |  5 -
 kexec/arch/i386/Makefile   |  5 -
 kexec/arch/ia64/Makefile   |  6 --
 kexec/arch/mips/Makefile   |  5 -
 kexec/arch/ppc/Makefile|  7 ---
 kexec/arch/ppc64/Makefile  |  5 -
 kexec/arch/s390/Makefile   |  4 
 kexec/arch/sh/Makefile |  5 -
 kexec/arch/x86_64/Makefile |  5 -
 kexec/libfdt/Makefile.libfdt   |  5 -
 kexec_test/Makefile|  3 ---
 purgatory/Makefile |  3 ---
 purgatory/arch/alpha/Makefile  |  3 ---
 purgatory/arch/arm/Makefile|  4 
 purgatory/arch/i386/Makefile   |  6 --
 purgatory/arch/ia64/Makefile   |  4 
 purgatory/arch/mips/Makefile   |  4 
 purgatory/arch/ppc/Makefile|  4 
 purgatory/arch/ppc64/Makefile  |  4 
 purgatory/arch/s390/Makefile   |  3 ---
 purgatory/arch/sh/Makefile |  3 ---
 purgatory/arch/x86_64/Makefile |  5 -
 util/Makefile  |  1 -
 util_lib/Makefile  |  2 --
 vmcore-dmesg/Makefile  |  1 -
 32 files changed, 3 insertions(+), 149 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index c1859d1..04fd52c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -119,9 +119,6 @@ all: targets
 # collect objects to be removed in 'make clean'
 clean =
 
-dist = AUTHORS COPYING INSTALL News TODO Makefile.in configure.ac configure \
-   kexec-tools.spec.in config/
-
 # utility function for converting a list of files (with extension) to
 # file.o (or file.d) format.
 objify = $(addsuffix .o, $(basename $(1)))
@@ -172,7 +169,8 @@ SPEC=$(PACKAGE_NAME).spec
 GENERATED_SRCS:= $(SPEC)
 TARBALL=$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
 TARBALL.gz=$(TARBALL).gz
-SRCS:= $(dist)
+SRCS:= $(call git ls-files) configure include/config.h include/config.h.in \
+   kexec/purgatory.c kexec-tools.spec
 PSRCS:=$(foreach s, $(SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))
 PGSRCS:=$(foreach s, $(GENERATED_SRCS), 
$(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))
 
@@ -201,7 +199,7 @@ $(TARBALL): $(SRCS) $(GENERATED_SRCS)
$(LN) -sf . $(PACKAGE_NAME)-$(PACKAGE_VERSION)
$(TAR) -rf $@ $(PGSRCS)
$(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)
-   @echo $(dist)
+   @echo $(SRCS)
 
 $(TARBALL.gz): $(TARBALL)
gzip -c < $^ > $@
diff --git a/doc/Makefile b/doc/Makefile
index 3442e09..e69de29 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,5 +0,0 @@
-dist += doc/Makefile   \
-   doc/linux-i386-boot.txt \
-   doc/linux-i386-zero-page.txt\
-   doc/multiboot.html  \
-   doc/nbi-spec.txt
diff --git a/include/Makefile b/include/Makefile
index c26b503..e69de29 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -1,13 +0,0 @@
-dist += include/Makefile   \
-   include/config.h\
-   include/config.h.in \
-   include/kexec-uImage.h  \
-   include/x86/x86-linux.h \
-   include/x86/mb_info.h   \
-   include/x86/mb_header.h \
-   include/elf.h   \
-   include/image.h \
-   include/unused.h\
-   include/boot/linuxbios_tables.h \
-   include/boot/beoboot.h  \
-   include/boot/elf_boot.h
diff --git a/kdump/Makefile b/kdump/Makefile
index 307d59d..1ad36b2 100644
--- a/kdump/Makefile
+++ b/kdump/Makefile
@@ -10,7 +10,6 @@ KDUMP_DEPS = $(call depify, $(KDUMP_OBJS))
 KDUMP = $(SBINDIR)/kdump
 KDUMP_MANPAGE = $(MANDIR)/man8/kdump.8
 
-dist += kdump/Makefile $(KDUMP_SRCS) kdump/kdump.8
 clean += $(KDUMP_OBJS) $(KDUMP_DEPS) $(KDUMP) $(KDUMP_MANPAGE)
 
 -include $(KDUMP_DEPS)
diff --git a/kexec/Makefile b/kexec/Makefile
index 8a6138d..dced4eb 100644
--- a/kexec/Makefile
+++ b/kexec/Makefile
@@ -28,43 +28,27 @@ KEXEC_SRCS_base += kexec/zlib.c
 
 KEXEC_GENERATED_SRCS += $(PURGATORY_HEX_C)
 
-dist += kexec/Makefile $(KEXEC_GENERATED_SRCS) \
-   $(KEXEC_SRCS_base) kexec/crashdump-elf.c\
-   kexec/crashdump.h kexec/firmware_memmap.h   \
-   kexec/kexec-elf-boot.h  \
-   kexec/kexec-elf.h kexec/kexec-sha256.h  \
-   kexec/kexec-zlib.h kexec/kexec-lzma.h   \
-   kexec/kexec-syscall.h kexec/kexec.h kexec/kexec.8
-
-dist   += kexec/proc_iomem.c
 $(ARCH)_PROC_IOMEM 

[PATCH 1/2] purgatory: remove arch/i386/timer.c

2013-04-01 Thread Richard Weinberger
This file is nowhere referenced, let's get rid of it.

Signed-off-by: Richard Weinberger 
---
 purgatory/arch/i386/timer.c | 9 -
 1 file changed, 9 deletions(-)
 delete mode 100644 purgatory/arch/i386/timer.c

diff --git a/purgatory/arch/i386/timer.c b/purgatory/arch/i386/timer.c
deleted file mode 100644
index 7a4bdaa..000
--- a/purgatory/arch/i386/timer.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include 
-#include "purgatory-x86.h"
-
-
-void x86_setup_legacy_timer(void)
-{
-   /* Load the legacy timer settings into the 8254 pit */
-}
-
-- 
1.8.1.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


Re: [PATCH] purgatory: compile sha256.c only on ia64 with -O0

2013-04-01 Thread Richard Weinberger

Simon, Zhang,

Am 01.04.2013 07:16, schrieb Zhang Yanfei:

I believe the above portion will break make dist my
causing it to omit purgatory/arch/* other than
purgatory/arch/$(ARCH)


Ah, I've missed this in my review, too.

Other than this, the change about purgatory/sha256.o below looks sound,
right?


The dist mechanism is quite strange and error prone.
Why can't you just use git archive in the $(TARBALL) target?
I'll happily send a patch...

Back to the purgatory/sha256.o issue, I did some more tests.
First I thought memcpy() within purgatory is slow, but it isn't.
Does kexec reset the CPU so some kind of legacy mode during purgatory?
It looks like the same code in sha256.o is fast in normal user space
but very slow during purgatory.

Computing sha256 of a 9MiB blob takes less than a second in user space
and 16 seconds (with my patch). Otherwise it takes > 25 seconds.

Thanks,
//richard

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH] purgatory: compile sha256.c only on ia64 with -O0

2013-03-31 Thread Richard Weinberger
If we have to compile sha256.c on ia64 with -O0 to produce sane code
do it only on ia64.

This change makes executing a new kernel on my AMD geode CPU much faster.
Without the patch "kexec -e" takes 27 seconds, with only 16.

Signed-off-by: Richard Weinberger 
---
 purgatory/Makefile   | 15 +--
 purgatory/arch/ia64/Makefile |  3 +++
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/purgatory/Makefile b/purgatory/Makefile
index e39adec..6be8362 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -16,16 +16,7 @@ PURGATORY_SRCS += purgatory/string.c
 dist += purgatory/Makefile $(PURGATORY_SRCS)   \
purgatory/include/purgatory.h purgatory/include/string.h
 
-include $(srcdir)/purgatory/arch/alpha/Makefile
-include $(srcdir)/purgatory/arch/arm/Makefile
-include $(srcdir)/purgatory/arch/i386/Makefile
-include $(srcdir)/purgatory/arch/ia64/Makefile
-include $(srcdir)/purgatory/arch/mips/Makefile
-include $(srcdir)/purgatory/arch/ppc/Makefile
-include $(srcdir)/purgatory/arch/ppc64/Makefile
-include $(srcdir)/purgatory/arch/s390/Makefile
-include $(srcdir)/purgatory/arch/sh/Makefile
-include $(srcdir)/purgatory/arch/x86_64/Makefile
+include $(srcdir)/purgatory/arch/$(ARCH)/Makefile
 
 PURGATORY_SRCS+=$($(ARCH)_PURGATORY_SRCS)
 
@@ -36,10 +27,6 @@ clean += $(PURGATORY_OBJS) $(PURGATORY_DEPS) $(PURGATORY)
 
 -include $(PURGATORY_DEPS)
 
-# sha256.c needs to be compiled without optimization, else
-# purgatory fails to execute on ia64.
-purgatory/sha256.o: CFLAGS += -O0
-
 purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
mkdir -p $(@D)
$(COMPILE.c) -o $@ $^
diff --git a/purgatory/arch/ia64/Makefile b/purgatory/arch/ia64/Makefile
index 32c3d97..a8a5c62 100644
--- a/purgatory/arch/ia64/Makefile
+++ b/purgatory/arch/ia64/Makefile
@@ -11,3 +11,6 @@ ia64_PURGATORY_EXTRA_CFLAGS = -ffixed-r28
 dist += purgatory/arch/ia64/Makefile $(ia64_PURGATORY_SRCS)\
purgatory/arch/ia64/io.h purgatory/arch/ia64/purgatory-ia64.h
 
+# sha256.c needs to be compiled without optimization, else
+# purgatory fails to execute on ia64.
+purgatory/sha256.o: ia64_PURGATORY_EXTRA_CFLAGS += -O0
-- 
1.8.1.4


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec