2013-04-24 08:23:13

by Mike Qiu

[permalink] [raw]
Subject: "attempt to move .org backwards" still show up

Hi all

I get an error message when I compile the source code in Power7 platform
use the newest upstream kernel.

[[email protected] linux]# make -j60
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
CALL scripts/checksyscalls.sh
HOSTLD scripts/mod/modpost
CHK include/generated/compile.h
CALL arch/powerpc/kernel/systbl_chk.sh
CALL arch/powerpc/kernel/prom_init_check.sh
AS arch/powerpc/kernel/head_64.o
arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org
backwards
make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1
make: *** [arch/powerpc/kernel] Error 2
make: *** Waiting for unfinished jobs....

and I see this should be fixed by the commit:
087aa036eb79f24b856893190359ba812b460f45

But it still failed in my P7 machine.

the kernel source code info:
git tree : git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[[email protected] linux]# git log
commit 824282ca7d250bd7c301f221c3cd902ce906d731
Merge: f83b293 3b5e50e
Author: Linus Torvalds <[email protected]>
Date: Mon Apr 22 15:00:59 2013 -0700

Merge branch 'upstream' of
git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull MIPS fix from Ralf Baechle:
"Revert the change of the definition of PAGE_MASK which was prettier
but broke a few relativly rare platforms"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
Revert "MIPS: page.h: Provide more readable definition for PAGE_MASK."

commit 3b5e50edaf500f392f4a372296afc0b99ffa7e70
Author: Ralf Baechle <[email protected]>
Date: Mon Apr 22 17:57:54 2013 +0200

[[email protected] linux]# git branch
* master
[[email protected] linux]# git diff
[[email protected] linux]#

Thant means I have done nothing with the kernel

Thanks
Mike


2013-04-24 08:31:46

by Michael Ellerman

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
> Hi all
>
> I get an error message when I compile the source code in Power7 platform
> use the newest upstream kernel.

Hi Mike,

It depends on what your .config is. What defconfig are you building?

cheers

2013-04-24 08:35:34

by Mike Qiu

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

于 2013/4/24 16:31, Michael Ellerman 写道:
> On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
>> Hi all
>>
>> I get an error message when I compile the source code in Power7 platform
>> use the newest upstream kernel.
> Hi Mike,
>
> It depends on what your .config is. What defconfig are you building?
I just copy the config file from /boot/config.* to .config and use make
menuconfig
change nothing by manually, then save.
> cheers
>

2013-04-24 08:36:15

by Mike Qiu

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

于 2013/4/24 16:31, Michael Ellerman 写道:
> On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
>> Hi all
>>
>> I get an error message when I compile the source code in Power7 platform
>> use the newest upstream kernel.
> Hi Mike,
>
> It depends on what your .config is. What defconfig are you building?
>
> cheers
>
And I do know how to build the source code in this machine . . .

Thanks

2013-04-24 10:37:46

by Michael Neuling

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

Mike Qiu <[email protected]> wrote:

> 于 2013/4/24 16:31, Michael Ellerman 写道:
> > On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
> >> Hi all
> >>
> >> I get an error message when I compile the source code in Power7 platform
> >> use the newest upstream kernel.
> > Hi Mike,
> >
> > It depends on what your .config is. What defconfig are you building?
> I just copy the config file from /boot/config.* to .config and use make
> menuconfig
> change nothing by manually, then save.

Can you post the resulting config here?

Do you have commit in your tree?
commit 087aa036eb79f24b856893190359ba812b460f45
Author: Chen Gang <[email protected]>
powerpc: make additional room in exception vector area

Mikey

2013-04-24 12:47:54

by Mike Qiu

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

在 2013-04-24三的 20:37 +1000,Michael Neuling写道:
> Mike Qiu <[email protected]> wrote:
>
> > 于 2013/4/24 16:31, Michael Ellerman 写道:
> > > On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
> > >> Hi all
> > >>
> > >> I get an error message when I compile the source code in Power7 platform
> > >> use the newest upstream kernel.
> > > Hi Mike,
> > >
> > > It depends on what your .config is. What defconfig are you building?
> > I just copy the config file from /boot/config.* to .config and use make
> > menuconfig
> > change nothing by manually, then save.
>
> Can you post the resulting config here?
>
> Do you have commit in your tree?
> commit 087aa036eb79f24b856893190359ba812b460f45
> Author: Chen Gang <[email protected]>
> powerpc: make additional room in exception vector area
>
Sure, that commit certainly in my git tree. And I just try to remove the
code and re-git clone the source code from upstream, this problem still
happen.
I will post the config file as the attachment
:)

Thanks
Mike
> Mikey


Attachments:
config_3.9 (103.64 kB)

2013-04-25 01:06:42

by Chen Gang

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

On 2013年04月24日 20:47, Mike wrote:
> 在 2013-04-24三的 20:37 +1000,Michael Neuling写道:
>> > Mike Qiu <[email protected]> wrote:
>> >
>>> > > 于 2013/4/24 16:31, Michael Ellerman 写道:
>>>> > > > On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
>>>>> > > >> Hi all
>>>>> > > >>
>>>>> > > >> I get an error message when I compile the source code in Power7 platform
>>>>> > > >> use the newest upstream kernel.
>>>> > > > Hi Mike,
>>>> > > >
>>>> > > > It depends on what your .config is. What defconfig are you building?
>>> > > I just copy the config file from /boot/config.* to .config and use make
>>> > > menuconfig
>>> > > change nothing by manually, then save.
>> >
>> > Can you post the resulting config here?
>> >
>> > Do you have commit in your tree?
>> > commit 087aa036eb79f24b856893190359ba812b460f45
>> > Author: Chen Gang <[email protected]>
>> > powerpc: make additional room in exception vector area
>> >
> Sure, that commit certainly in my git tree. And I just try to remove the
> code and re-git clone the source code from upstream, this problem still
> happen.
> I will post the config file as the attachment
> :)
>
> Thanks

I will try, and plan to get a result within this week (2013-04-28)

Thanks.

--
Chen Gang

Asianux Corporation

2013-04-25 04:06:10

by Mike Qiu

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

于 2013/4/25 9:05, Chen Gang 写道:
> On 2013年04月24日 20:47, Mike wrote:
>> 在 2013-04-24三的 20:37 +1000,Michael Neuling写道:
>>>> Mike Qiu <[email protected]> wrote:
>>>>
>>>>>> 于 2013/4/24 16:31, Michael Ellerman 写道:
>>>>>>>> On Wed, Apr 24, 2013 at 04:22:53PM +0800, Mike Qiu wrote:
>>>>>>>>>> Hi all
>>>>>>>>>>
>>>>>>>>>> I get an error message when I compile the source code in Power7 platform
>>>>>>>>>> use the newest upstream kernel.
>>>>>>>> Hi Mike,
>>>>>>>>
>>>>>>>> It depends on what your .config is. What defconfig are you building?
>>>>>> I just copy the config file from /boot/config.* to .config and use make
>>>>>> menuconfig
>>>>>> change nothing by manually, then save.
>>>> Can you post the resulting config here?
>>>>
>>>> Do you have commit in your tree?
>>>> commit 087aa036eb79f24b856893190359ba812b460f45
>>>> Author: Chen Gang <[email protected]>
>>>> powerpc: make additional room in exception vector area
>>>>
>> Sure, that commit certainly in my git tree. And I just try to remove the
>> code and re-git clone the source code from upstream, this problem still
>> happen.
>> I will post the config file as the attachment
>> :)
>>
>> Thanks
> I will try, and plan to get a result within this week (2013-04-28)
>
> Thanks.
Hi
This has block my work now
So I hope you can take a look ASAP
Thanks
:)

Mike

2013-04-25 05:37:20

by Chen Gang

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

On 2013年04月25日 12:05, Mike Qiu wrote:
>> I will try, and plan to get a result within this week (2013-04-28)
>>
>> Thanks.
> Hi
> This has block my work now
> So I hope you can take a look ASAP
> Thanks
> :)

The root cause is the room 0x500..0xc00 is not enough when
KVM_HANDLER_PR expresses the real codes. The relationship is
KVM_HANDLER_PR depend on CONFIG_KVM_BOOK3S_PR depend on
CONFIG_KVM_BOOK3S_64_PR.

If possible, we can by pass it: just use CONFIG_KVM_BOOK3S_64_HV instead
of CONFIG_KVM_BOOK3S_64_PR (enter menuconfig -> Virtualization -> "KVM
support for POWER7 and PPC970 using hypervisor mode in host").

For 'allmodconfig', it will use CONFIG_KVM_BOOK3S_64_HV instead of
CONFIG_KVM_BOOK3S_64_PR, so 'allmodconfig' will not have this issue.


Next, I will continue to analyse how to fix it.

Welcome other members (especially the related maintainers) to provide
suggestions and completions.

Thanks.

--
Chen Gang

Asianux Corporation

2013-04-25 07:24:01

by Chen Gang

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

On 2013年04月25日 13:36, Chen Gang wrote:
> On 2013年04月25日 12:05, Mike Qiu wrote:
>>> I will try, and plan to get a result within this week (2013-04-28)
>>>
>>> Thanks.
>> Hi
>> This has block my work now
>> So I hope you can take a look ASAP
>> Thanks
>> :)
>
> The root cause is the room 0x500..0xc00 is not enough when
> KVM_HANDLER_PR expresses the real codes. The relationship is
> KVM_HANDLER_PR depend on CONFIG_KVM_BOOK3S_PR depend on
> CONFIG_KVM_BOOK3S_64_PR.
>

Sorry, the original root cause above is incorrect.

The real root cause:
__KVMTEST is used when CONFIG_KVM_BOOK3S_PR is defined.
MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer) includes __KVMTEST
(it will start at 0x900 and just end at 0x980 !!)
but STD_EXCEPTION_HV(0x980, 0x982, hdecrementer) is just started at 0x980 !

The relationship:
dependency: __KVMTEST --> KVMTEST_PR --> CONFIG_KVM_BOOK3S_PR --> CONFIG_KVM_BOOK3S_64_PR
using: MASKABLE_EXCEPTION_PSERIES --> SOFTEN_TEST_PR --> KVMTEST_PR --> __KVMTEST

Please reference below:
0x93c..0x944 is just for __KVMTEST which will be inserted into when CONFIG_KVM_BOOK3S_PR is defined
and the instructions of __KVMTEST are reordered for optimization.

0000000000000900 <decrementer_pSeries>:
900: 7c 42 13 78 mr r2,r2
904: 7d b2 43 a6 mtsprg 2,r13
908: 7d b1 42 a6 mfsprg r13,1
90c: f9 2d 00 80 std r9,128(r13)
910: 7d 20 e2 a6 mfspr r9,896
914: 7c 42 13 78 mr r2,r2
918: f9 4d 00 88 std r10,136(r13)
91c: 7d 5c 02 a6 mfspr r10,28
920: f9 2d 00 d8 std r9,216(r13)
924: f9 4d 00 d0 std r10,208(r13)
928: 7d 48 02 a6 mflr r10
92c: f9 4d 00 c8 std r10,200(r13)
930: 7d 20 00 26 mfcr r9
934: 89 4d 07 c8 lbz r10,1992(r13)
938: 2c 0a 00 00 cmpwi r10,0
93c: 40 82 10 70 bne- 19ac <do_kvm_0x900>
940: 89 4d 02 82 lbz r10,642(r13)
944: 2c 0a 00 00 cmpwi r10,0
948: 39 40 00 08 li r10,8
94c: 41 82 14 e4 beq- 1e30 <masked_interrupt>
950: f9 6d 00 90 std r11,144(r13)
954: f9 8d 00 98 std r12,152(r13)
958: 7d 52 42 a6 mfsprg r10,2
95c: f9 4d 00 a0 std r10,160(r13)
960: e9 8d 00 18 ld r12,24(r13)
964: e9 4d 00 20 ld r10,32(r13)
968: 7d 7a 02 a6 mfsrr0 r11
96c: 61 8c 24 80 ori r12,r12,9344
970: 7d 9a 03 a6 mtsrr0 r12
974: 7d 9b 02 a6 mfsrr1 r12
978: 7d 5b 03 a6 mtsrr1 r10
97c: 4c 00 00 24 rfid
980: 48 00 00 00 b 980 <decrementer_pSeries+0x80>


> If possible, we can by pass it: just use CONFIG_KVM_BOOK3S_64_HV instead
> of CONFIG_KVM_BOOK3S_64_PR (enter menuconfig -> Virtualization -> "KVM
> support for POWER7 and PPC970 using hypervisor mode in host").
>
> For 'allmodconfig', it will use CONFIG_KVM_BOOK3S_64_HV instead of
> CONFIG_KVM_BOOK3S_64_PR, so 'allmodconfig' will not have this issue.
>
>
> Next, I will continue to analyse how to fix it.
>
> Welcome other members (especially the related maintainers) to provide
> suggestions and completions.
>
> Thanks.
>


--
Chen Gang

Asianux Corporation

2013-04-25 08:19:05

by Chen Gang

[permalink] [raw]
Subject: [PATCH] PowerPC: kernel: compiling issue, make additional room in exception vector area


When CONFIG_KVM_BOOK3S_64_PR is enabled,
MASKABLE_EXCEPTION_PSERIES(0x900 ...) will includes __KVMTEST, it will
exceed 0x980 which STD_EXCEPTION_HV(0x980 ...) will use, it will cause
compiling issue.

The related errors:
arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1


Signed-off-by: Chen Gang <[email protected]>
---
arch/powerpc/include/asm/kvm_asm.h | 2 +-
arch/powerpc/kernel/exceptions-64s.S | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
index b9dd382..2c65bae 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -86,7 +86,7 @@
#define BOOK3S_INTERRUPT_PROGRAM 0x700
#define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
#define BOOK3S_INTERRUPT_DECREMENTER 0x900
-#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x980
+#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x988
#define BOOK3S_INTERRUPT_SYSCALL 0xc00
#define BOOK3S_INTERRUPT_TRACE 0xd00
#define BOOK3S_INTERRUPT_H_DATA_STORAGE 0xe00
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index e789ee7..bb0e677 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -255,7 +255,7 @@ hardware_interrupt_hv:
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)

MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
- STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
+ STD_EXCEPTION_HV(0x988, 0x982, hdecrementer)

MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xa00)
@@ -698,7 +698,7 @@ machine_check_common:

STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ)
STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt)
- STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt)
+ STD_EXCEPTION_COMMON(0x988, hdecrementer, .hdec_interrupt)
#ifdef CONFIG_PPC_DOORBELL
STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, .doorbell_exception)
#else
@@ -802,7 +802,7 @@ hardware_interrupt_relon_hv:
STD_RELON_EXCEPTION_PSERIES(0x4700, 0x700, program_check)
STD_RELON_EXCEPTION_PSERIES(0x4800, 0x800, fp_unavailable)
MASKABLE_RELON_EXCEPTION_PSERIES(0x4900, 0x900, decrementer)
- STD_RELON_EXCEPTION_HV(0x4980, 0x982, hdecrementer)
+ STD_RELON_EXCEPTION_HV(0x4988, 0x982, hdecrementer)
MASKABLE_RELON_EXCEPTION_PSERIES(0x4a00, 0xa00, doorbell_super)
STD_RELON_EXCEPTION_PSERIES(0x4b00, 0xb00, trap_0b)

--
1.7.7.6

2013-04-25 08:22:00

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH] PowerPC: kernel: compiling issue, make additional room in exception vector area

Hello Mike:

Please try this patch, at least it can pass compiling with the config
file which you provided under my cross-compiling envrionments.

I do not give a running test now, so better to try to run the new kernel
with this patch.

Thanks.

On 2013年04月25日 16:18, Chen Gang wrote:
>
> When CONFIG_KVM_BOOK3S_64_PR is enabled,
> MASKABLE_EXCEPTION_PSERIES(0x900 ...) will includes __KVMTEST, it will
> exceed 0x980 which STD_EXCEPTION_HV(0x980 ...) will use, it will cause
> compiling issue.
>
> The related errors:
> arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
> arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
> make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1
>
>
> Signed-off-by: Chen Gang <[email protected]>
> ---
> arch/powerpc/include/asm/kvm_asm.h | 2 +-
> arch/powerpc/kernel/exceptions-64s.S | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
> index b9dd382..2c65bae 100644
> --- a/arch/powerpc/include/asm/kvm_asm.h
> +++ b/arch/powerpc/include/asm/kvm_asm.h
> @@ -86,7 +86,7 @@
> #define BOOK3S_INTERRUPT_PROGRAM 0x700
> #define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
> #define BOOK3S_INTERRUPT_DECREMENTER 0x900
> -#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x980
> +#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x988
> #define BOOK3S_INTERRUPT_SYSCALL 0xc00
> #define BOOK3S_INTERRUPT_TRACE 0xd00
> #define BOOK3S_INTERRUPT_H_DATA_STORAGE 0xe00
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index e789ee7..bb0e677 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -255,7 +255,7 @@ hardware_interrupt_hv:
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>
> MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
> - STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
> + STD_EXCEPTION_HV(0x988, 0x982, hdecrementer)
>
> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xa00)
> @@ -698,7 +698,7 @@ machine_check_common:
>
> STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ)
> STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt)
> - STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt)
> + STD_EXCEPTION_COMMON(0x988, hdecrementer, .hdec_interrupt)
> #ifdef CONFIG_PPC_DOORBELL
> STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, .doorbell_exception)
> #else
> @@ -802,7 +802,7 @@ hardware_interrupt_relon_hv:
> STD_RELON_EXCEPTION_PSERIES(0x4700, 0x700, program_check)
> STD_RELON_EXCEPTION_PSERIES(0x4800, 0x800, fp_unavailable)
> MASKABLE_RELON_EXCEPTION_PSERIES(0x4900, 0x900, decrementer)
> - STD_RELON_EXCEPTION_HV(0x4980, 0x982, hdecrementer)
> + STD_RELON_EXCEPTION_HV(0x4988, 0x982, hdecrementer)
> MASKABLE_RELON_EXCEPTION_PSERIES(0x4a00, 0xa00, doorbell_super)
> STD_RELON_EXCEPTION_PSERIES(0x4b00, 0xb00, trap_0b)
>
>


--
Chen Gang

Asianux Corporation

2013-04-25 08:25:06

by Mike Qiu

[permalink] [raw]
Subject: Re: [PATCH] PowerPC: kernel: compiling issue, make additional room in exception vector area

于 2013/4/25 16:21, Chen Gang 写道:
> Hello Mike:
>
> Please try this patch, at least it can pass compiling with the config
> file which you provided under my cross-compiling envrionments.
>
> I do not give a running test now, so better to try to run the new kernel
> with this patch.
OK, I will use your patch, and I will send out the result later.

Thanks

Mike
> Thanks.
>
> On 2013年04月25日 16:18, Chen Gang wrote:
>> When CONFIG_KVM_BOOK3S_64_PR is enabled,
>> MASKABLE_EXCEPTION_PSERIES(0x900 ...) will includes __KVMTEST, it will
>> exceed 0x980 which STD_EXCEPTION_HV(0x980 ...) will use, it will cause
>> compiling issue.
>>
>> The related errors:
>> arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
>> arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
>> make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1
>>
>>
>> Signed-off-by: Chen Gang <[email protected]>
>> ---
>> arch/powerpc/include/asm/kvm_asm.h | 2 +-
>> arch/powerpc/kernel/exceptions-64s.S | 6 +++---
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
>> index b9dd382..2c65bae 100644
>> --- a/arch/powerpc/include/asm/kvm_asm.h
>> +++ b/arch/powerpc/include/asm/kvm_asm.h
>> @@ -86,7 +86,7 @@
>> #define BOOK3S_INTERRUPT_PROGRAM 0x700
>> #define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
>> #define BOOK3S_INTERRUPT_DECREMENTER 0x900
>> -#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x980
>> +#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x988
>> #define BOOK3S_INTERRUPT_SYSCALL 0xc00
>> #define BOOK3S_INTERRUPT_TRACE 0xd00
>> #define BOOK3S_INTERRUPT_H_DATA_STORAGE 0xe00
>> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
>> index e789ee7..bb0e677 100644
>> --- a/arch/powerpc/kernel/exceptions-64s.S
>> +++ b/arch/powerpc/kernel/exceptions-64s.S
>> @@ -255,7 +255,7 @@ hardware_interrupt_hv:
>> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>>
>> MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
>> - STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
>> + STD_EXCEPTION_HV(0x988, 0x982, hdecrementer)
>>
>> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
>> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xa00)
>> @@ -698,7 +698,7 @@ machine_check_common:
>>
>> STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ)
>> STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt)
>> - STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt)
>> + STD_EXCEPTION_COMMON(0x988, hdecrementer, .hdec_interrupt)
>> #ifdef CONFIG_PPC_DOORBELL
>> STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, .doorbell_exception)
>> #else
>> @@ -802,7 +802,7 @@ hardware_interrupt_relon_hv:
>> STD_RELON_EXCEPTION_PSERIES(0x4700, 0x700, program_check)
>> STD_RELON_EXCEPTION_PSERIES(0x4800, 0x800, fp_unavailable)
>> MASKABLE_RELON_EXCEPTION_PSERIES(0x4900, 0x900, decrementer)
>> - STD_RELON_EXCEPTION_HV(0x4980, 0x982, hdecrementer)
>> + STD_RELON_EXCEPTION_HV(0x4988, 0x982, hdecrementer)
>> MASKABLE_RELON_EXCEPTION_PSERIES(0x4a00, 0xa00, doorbell_super)
>> STD_RELON_EXCEPTION_PSERIES(0x4b00, 0xb00, trap_0b)
>>
>>
>

2013-04-25 09:00:44

by Michael Neuling

[permalink] [raw]
Subject: Re: [PATCH] PowerPC: kernel: compiling issue, make additional room in exception vector area

Chen Gang <[email protected]> wrote:

>
> When CONFIG_KVM_BOOK3S_64_PR is enabled,
> MASKABLE_EXCEPTION_PSERIES(0x900 ...) will includes __KVMTEST, it will
> exceed 0x980 which STD_EXCEPTION_HV(0x980 ...) will use, it will cause
> compiling issue.
>
> The related errors:
> arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
> arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
> make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1

This doesn't work at all. It might compile but it's never going to
actually work.

Comments below.

>
>
> Signed-off-by: Chen Gang <[email protected]>
> ---
> arch/powerpc/include/asm/kvm_asm.h | 2 +-
> arch/powerpc/kernel/exceptions-64s.S | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
> index b9dd382..2c65bae 100644
> --- a/arch/powerpc/include/asm/kvm_asm.h
> +++ b/arch/powerpc/include/asm/kvm_asm.h
> @@ -86,7 +86,7 @@
> #define BOOK3S_INTERRUPT_PROGRAM 0x700
> #define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
> #define BOOK3S_INTERRUPT_DECREMENTER 0x900
> -#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x980
> +#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x988

This is hardwird in the architecture.. you can't just move it

> #define BOOK3S_INTERRUPT_SYSCALL 0xc00
> #define BOOK3S_INTERRUPT_TRACE 0xd00
> #define BOOK3S_INTERRUPT_H_DATA_STORAGE 0xe00
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index e789ee7..bb0e677 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -255,7 +255,7 @@ hardware_interrupt_hv:
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>
> MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
> - STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
> + STD_EXCEPTION_HV(0x988, 0x982, hdecrementer)

Same here

>
> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xa00)
> @@ -698,7 +698,7 @@ machine_check_common:
>
> STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ)
> STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt)
> - STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt)
> + STD_EXCEPTION_COMMON(0x988, hdecrementer, .hdec_interrupt)

... and here

> #ifdef CONFIG_PPC_DOORBELL
> STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, .doorbell_exception)
> #else
> @@ -802,7 +802,7 @@ hardware_interrupt_relon_hv:
> STD_RELON_EXCEPTION_PSERIES(0x4700, 0x700, program_check)
> STD_RELON_EXCEPTION_PSERIES(0x4800, 0x800, fp_unavailable)
> MASKABLE_RELON_EXCEPTION_PSERIES(0x4900, 0x900, decrementer)
> - STD_RELON_EXCEPTION_HV(0x4980, 0x982, hdecrementer)
> + STD_RELON_EXCEPTION_HV(0x4988, 0x982, hdecrementer)

... and here

> MASKABLE_RELON_EXCEPTION_PSERIES(0x4a00, 0xa00, doorbell_super)
> STD_RELON_EXCEPTION_PSERIES(0x4b00, 0xb00, trap_0b)
>
> --
> 1.7.7.6
>

2013-04-25 09:05:53

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013年04月25日 17:00, Michael Neuling wrote:
>> >
>> > Signed-off-by: Chen Gang <[email protected]>
>> > ---
>> > arch/powerpc/include/asm/kvm_asm.h | 2 +-
>> > arch/powerpc/kernel/exceptions-64s.S | 6 +++---
>> > 2 files changed, 4 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
>> > index b9dd382..2c65bae 100644
>> > --- a/arch/powerpc/include/asm/kvm_asm.h
>> > +++ b/arch/powerpc/include/asm/kvm_asm.h
>> > @@ -86,7 +86,7 @@
>> > #define BOOK3S_INTERRUPT_PROGRAM 0x700
>> > #define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
>> > #define BOOK3S_INTERRUPT_DECREMENTER 0x900
>> > -#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x980
>> > +#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x988
> This is hardwird in the architecture.. you can't just move it
>

OK, thank you, I need continue to fix it. It seems we have to read the
details to shrink one instruction (4 bytes), at least.

Welcome additional suggestions or completions.

Thanks.

--
Chen Gang

Asianux Corporation

2013-04-25 09:31:32

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013年04月25日 17:05, Chen Gang wrote:
> On 2013年04月25日 17:00, Michael Neuling wrote:
>>>>
>>>> Signed-off-by: Chen Gang <[email protected]>
>>>> ---
>>>> arch/powerpc/include/asm/kvm_asm.h | 2 +-
>>>> arch/powerpc/kernel/exceptions-64s.S | 6 +++---
>>>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
>>>> index b9dd382..2c65bae 100644
>>>> --- a/arch/powerpc/include/asm/kvm_asm.h
>>>> +++ b/arch/powerpc/include/asm/kvm_asm.h
>>>> @@ -86,7 +86,7 @@
>>>> #define BOOK3S_INTERRUPT_PROGRAM 0x700
>>>> #define BOOK3S_INTERRUPT_FP_UNAVAIL 0x800
>>>> #define BOOK3S_INTERRUPT_DECREMENTER 0x900
>>>> -#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x980
>>>> +#define BOOK3S_INTERRUPT_HV_DECREMENTER 0x988
>> This is hardwird in the architecture.. you can't just move it
>>
>

I think of a way to solve it: we just move the related code to another
area, after enter the original entry (e.g. 0x900), we let it jump to
that area to excuse the related code.

:-)

> OK, thank you, I need continue to fix it. It seems we have to read the
> details to shrink one instruction (4 bytes), at least.
>
> Welcome additional suggestions or completions.
>
> Thanks.
>


--
Chen Gang

Asianux Corporation

2013-04-25 11:07:43

by Paul Mackerras

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

On Thu, Apr 25, 2013 at 12:05:54PM +0800, Mike Qiu wrote:
> This has block my work now
> So I hope you can take a look ASAP
> Thanks
> :)
>
> Mike

As a quick fix, turn on CONFIG_KVM_BOOK3S_64_HV. That will eliminate
the immediate problem.

Paul.

2013-04-25 11:16:58

by Chen Gang

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

On 2013年04月25日 14:25, Paul Mackerras wrote:
> On Thu, Apr 25, 2013 at 12:05:54PM +0800, Mike Qiu wrote:
>> > This has block my work now
>> > So I hope you can take a look ASAP
>> > Thanks
>> > :)
>> >
>> > Mike
> As a quick fix, turn on CONFIG_KVM_BOOK3S_64_HV. That will eliminate
> the immediate problem.

Yes, just as my original reply to Mike to bypass it, but get no reply, I
guess he has to face the CONFIG_KVM_BOOK3S_64_PR.

Now, I am just fixing it, when I finish one patch, please help check.

Thanks.

--
Chen Gang

Asianux Corporation

2013-04-25 11:51:58

by Chen Gang

[permalink] [raw]
Subject: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area


When CONFIG_KVM_BOOK3S_64_PR is enabled,
MASKABLE_EXCEPTION_PSERIES(0x900 ...) will includes __KVMTEST, it will
exceed 0x980 which STD_EXCEPTION_HV(0x980 ...) will use, it will cause
compiling issue.

The related errors:
arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1

The position 0x900 and 0x980 are solid, so can not move the position
to make room larger. The final solution is to jump to another area to
execute the related code.


Signed-off-by: Chen Gang <[email protected]>
---
arch/powerpc/kernel/exceptions-64s.S | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index e789ee7..8997de2 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -254,7 +254,11 @@ hardware_interrupt_hv:
STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)

- MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
+ . = 0x900
+ .globl decrementer_pSeries
+decrementer_pSeries:
+ b decrementer_pSeries_0
+
STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)

MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
@@ -536,6 +540,12 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
#endif

.align 7
+ /* moved from 0x900 */
+decrementer_pSeries_0:
+ _MASKABLE_EXCEPTION_PSERIES(0x900, decrementer,
+ EXC_STD, SOFTEN_TEST_PR)
+
+ .align 7
/* moved from 0xe00 */
STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)
--
1.7.7.6

2013-04-25 11:59:27

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

Hello Mike:

This patch can pass compiling with Mike's config file, under my
cross-compiling environments, but does not run under the real machine,
please try it.

Welcome other members to help check this patch whether valid.

Thanks.


On 2013年04月25日 19:51, Chen Gang wrote:
>
> When CONFIG_KVM_BOOK3S_64_PR is enabled,
> MASKABLE_EXCEPTION_PSERIES(0x900 ...) will includes __KVMTEST, it will
> exceed 0x980 which STD_EXCEPTION_HV(0x980 ...) will use, it will cause
> compiling issue.
>
> The related errors:
> arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
> arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
> make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1
>
> The position 0x900 and 0x980 are solid, so can not move the position
> to make room larger. The final solution is to jump to another area to
> execute the related code.
>
>
> Signed-off-by: Chen Gang <[email protected]>
> ---
> arch/powerpc/kernel/exceptions-64s.S | 12 +++++++++++-
> 1 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index e789ee7..8997de2 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -254,7 +254,11 @@ hardware_interrupt_hv:
> STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>
> - MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
> + . = 0x900
> + .globl decrementer_pSeries
> +decrementer_pSeries:
> + b decrementer_pSeries_0
> +
> STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
>
> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
> @@ -536,6 +540,12 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
> #endif
>
> .align 7
> + /* moved from 0x900 */
> +decrementer_pSeries_0:
> + _MASKABLE_EXCEPTION_PSERIES(0x900, decrementer,
> + EXC_STD, SOFTEN_TEST_PR)
> +
> + .align 7
> /* moved from 0xe00 */
> STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
> KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)
>


--
Chen Gang

Asianux Corporation

2013-04-25 23:16:12

by Michael Neuling

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

Chen Gang <[email protected]> wrote:

>
> When CONFIG_KVM_BOOK3S_64_PR is enabled,
> MASKABLE_EXCEPTION_PSERIES(0x900 ...) will includes __KVMTEST, it will
> exceed 0x980 which STD_EXCEPTION_HV(0x980 ...) will use, it will cause
> compiling issue.
>
> The related errors:
> arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
> arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
> make[1]: *** [arch/powerpc/kernel/head_64.o] Error 1
>
> The position 0x900 and 0x980 are solid, so can not move the position
> to make room larger. The final solution is to jump to another area to
> execute the related code.
>
>
> Signed-off-by: Chen Gang <[email protected]>
> ---
> arch/powerpc/kernel/exceptions-64s.S | 12 +++++++++++-
> 1 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index e789ee7..8997de2 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -254,7 +254,11 @@ hardware_interrupt_hv:
> STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>
> - MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
> + . = 0x900
> + .globl decrementer_pSeries
> +decrementer_pSeries:
> + b decrementer_pSeries_0
> +

Unfortunately you can't do this ether as we need to save the CFAR[1]
before it's overwritten by any branch. MASKABLE_EXCEPTION_PSERIES does
this.

CFAR is the Come From Register. It saves the location of the last
branch and is hence overwritten by any branch.

Thanks for trying.

Mikey

> STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
>
> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
> @@ -536,6 +540,12 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
> #endif
>
> .align 7
> + /* moved from 0x900 */
> +decrementer_pSeries_0:
> + _MASKABLE_EXCEPTION_PSERIES(0x900, decrementer,
> + EXC_STD, SOFTEN_TEST_PR)
> +
> + .align 7
> /* moved from 0xe00 */
> STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
> KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)
> --
> 1.7.7.6
>
>

2013-04-26 01:07:26

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013??04??26?? 07:16, Michael Neuling wrote:
>> > diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
>> > index e789ee7..8997de2 100644
>> > --- a/arch/powerpc/kernel/exceptions-64s.S
>> > +++ b/arch/powerpc/kernel/exceptions-64s.S
>> > @@ -254,7 +254,11 @@ hardware_interrupt_hv:
>> > STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
>> > KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>> >
>> > - MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
>> > + . = 0x900
>> > + .globl decrementer_pSeries
>> > +decrementer_pSeries:
>> > + b decrementer_pSeries_0
>> > +
> Unfortunately you can't do this ether as we need to save the CFAR[1]
> before it's overwritten by any branch. MASKABLE_EXCEPTION_PSERIES does
> this.
>

Thanks for your checking.

> CFAR is the Come From Register. It saves the location of the last
> branch and is hence overwritten by any branch.
>

Do we process it just like others done (e.g. 0x300, 0xe00, 0xe20 ...) ?
. = 0x900
.globl decrementer_pSeries
decrementer_pSeries:
HMT_MEDIUM_PPR_DISCARD
SET_SCRATCH0(r13)
b decrementer_pSeries_0

...


> Thanks for trying.
>

Not at all, before get fixed by other members, I should continue trying.

--
Chen Gang

Asianux Corporation

2013-04-26 01:19:06

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013??04??26?? 09:06, Chen Gang wrote:
>> CFAR is the Come From Register. It saves the location of the last
>> > branch and is hence overwritten by any branch.
>> >
> Do we process it just like others done (e.g. 0x300, 0xe00, 0xe20 ...) ?
> . = 0x900
> .globl decrementer_pSeries
> decrementer_pSeries:
> HMT_MEDIUM_PPR_DISCARD
> SET_SCRATCH0(r13)
> b decrementer_pSeries_0
>
> ...
>
>

Such as the fix below, is it OK (just like 0x300 or 0x200 has done) ?

Please check, thanks.

---------------------------diff begin-------------------------------------

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index e789ee7..a0a5ff2 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -254,7 +254,14 @@ hardware_interrupt_hv:
STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)

- MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
+ . = 0x900
+ .globl decrementer_pSeries
+decrementer_pSeries:
+ HMT_MEDIUM_PPR_DISCARD
+ SET_SCRATCH0(r13) /* save r13 */
+ EXCEPTION_PROLOG_0(PACA_EXGEN)
+ b decrementer_pSeries_0
+
STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)

MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
@@ -536,6 +543,12 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
#endif

.align 7
+ /* moved from 0x900 */
+decrementer_pSeries_0:
+ EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_PR, 0x900)
+ EXCEPTION_PROLOG_PSERIES_1(decrementer_common, EXC_STD)
+
+ .align 7
/* moved from 0xe00 */
STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)

---------------------------diff end---------------------------------------

--
Chen Gang

Asianux Corporation

2013-04-26 01:37:24

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013??04??26?? 09:18, Chen Gang wrote:
> On 2013??04??26?? 09:06, Chen Gang wrote:
>>> CFAR is the Come From Register. It saves the location of the last
>>>> branch and is hence overwritten by any branch.
>>>>
>> Do we process it just like others done (e.g. 0x300, 0xe00, 0xe20 ...) ?
>> . = 0x900
>> .globl decrementer_pSeries
>> decrementer_pSeries:
>> HMT_MEDIUM_PPR_DISCARD
>> SET_SCRATCH0(r13)
>> b decrementer_pSeries_0
>>
>> ...
>>
>>

Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which related
with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.

---------------------------------diff v2 begin-----------------------------

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index e789ee7..f0489c4 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -254,7 +254,15 @@ hardware_interrupt_hv:
STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)

- MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
+ . = 0x900
+ .globl decrementer_pSeries
+decrementer_pSeries:
+ HMT_MEDIUM_PPR_DISCARD
+ SET_SCRATCH0(r13) /* save r13 */
+ EXCEPTION_PROLOG_0(PACA_EXGEN)
+ EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_PR, 0x900)
+ b decrementer_pSeries_0
+
STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)

MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
@@ -536,6 +544,11 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
#endif

.align 7
+ /* moved from 0x900 */
+decrementer_pSeries_0:
+ EXCEPTION_PROLOG_PSERIES_1(decrementer_common, EXC_STD)
+
+ .align 7
/* moved from 0xe00 */
STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)


---------------------------------diff v2 end-------------------------------


>
> Such as the fix below, is it OK (just like 0x300 or 0x200 has done) ?
>
> Please check, thanks.
>
> ---------------------------diff begin-------------------------------------
>
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index e789ee7..a0a5ff2 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -254,7 +254,14 @@ hardware_interrupt_hv:
> STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>
> - MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
> + . = 0x900
> + .globl decrementer_pSeries
> +decrementer_pSeries:
> + HMT_MEDIUM_PPR_DISCARD
> + SET_SCRATCH0(r13) /* save r13 */
> + EXCEPTION_PROLOG_0(PACA_EXGEN)
> + b decrementer_pSeries_0
> +
> STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
>
> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
> @@ -536,6 +543,12 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
> #endif
>
> .align 7
> + /* moved from 0x900 */
> +decrementer_pSeries_0:
> + EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_PR, 0x900)
> + EXCEPTION_PROLOG_PSERIES_1(decrementer_common, EXC_STD)
> +
> + .align 7
> /* moved from 0xe00 */
> STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
> KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)
>
> ---------------------------diff end---------------------------------------
>


--
Chen Gang

Asianux Corporation

2013-04-26 01:58:31

by Mike Qiu

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

于 2013/4/25 19:16, Chen Gang 写道:
> On 2013年04月25日 14:25, Paul Mackerras wrote:
>> On Thu, Apr 25, 2013 at 12:05:54PM +0800, Mike Qiu wrote:
>>>> This has block my work now
>>>> So I hope you can take a look ASAP
>>>> Thanks
>>>> :)
>>>>
>>>> Mike
>> As a quick fix, turn on CONFIG_KVM_BOOK3S_64_HV. That will eliminate
>> the immediate problem.
> Yes, just as my original reply to Mike to bypass it, but get no reply, I
> guess he has to face the CONFIG_KVM_BOOK3S_64_PR.
>
> Now, I am just fixing it, when I finish one patch, please help check.
Actually, I have compile pass by your patch, but I see Micheal Neuling's
reply,
I just stop to do that, and wait for you new patch :)

Now I will use your V2 patch to build

Thanks

Mike
> Thanks.
>

2013-04-26 02:03:15

by Mike Qiu

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

?? 2013/4/26 9:36, Chen Gang д??:
> On 2013??04??26?? 09:18, Chen Gang wrote:
>> On 2013??04??26?? 09:06, Chen Gang wrote:
>>>> CFAR is the Come From Register. It saves the location of the last
>>>>> branch and is hence overwritten by any branch.
>>>>>
>>> Do we process it just like others done (e.g. 0x300, 0xe00, 0xe20 ...) ?
>>> . = 0x900
>>> .globl decrementer_pSeries
>>> decrementer_pSeries:
>>> HMT_MEDIUM_PPR_DISCARD
>>> SET_SCRATCH0(r13)
>>> b decrementer_pSeries_0
>>>
>>> ...
>>>
>>>
> Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which related
> with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.

I will try your diff V2, to see if the machine can boot up
> ---------------------------------diff v2 begin-----------------------------
>
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index e789ee7..f0489c4 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -254,7 +254,15 @@ hardware_interrupt_hv:
> STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>
> - MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
> + . = 0x900
> + .globl decrementer_pSeries
> +decrementer_pSeries:
> + HMT_MEDIUM_PPR_DISCARD
> + SET_SCRATCH0(r13) /* save r13 */
> + EXCEPTION_PROLOG_0(PACA_EXGEN)
> + EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_PR, 0x900)
> + b decrementer_pSeries_0
> +
> STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
>
> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
> @@ -536,6 +544,11 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
> #endif
>
> .align 7
> + /* moved from 0x900 */
> +decrementer_pSeries_0:
> + EXCEPTION_PROLOG_PSERIES_1(decrementer_common, EXC_STD)
> +
> + .align 7
> /* moved from 0xe00 */
> STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
> KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)
>
>
> ---------------------------------diff v2 end-------------------------------
>
>
>> Such as the fix below, is it OK (just like 0x300 or 0x200 has done) ?
>>
>> Please check, thanks.
>>
>> ---------------------------diff begin-------------------------------------
>>
>> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
>> index e789ee7..a0a5ff2 100644
>> --- a/arch/powerpc/kernel/exceptions-64s.S
>> +++ b/arch/powerpc/kernel/exceptions-64s.S
>> @@ -254,7 +254,14 @@ hardware_interrupt_hv:
>> STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
>> KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
>>
>> - MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
>> + . = 0x900
>> + .globl decrementer_pSeries
>> +decrementer_pSeries:
>> + HMT_MEDIUM_PPR_DISCARD
>> + SET_SCRATCH0(r13) /* save r13 */
>> + EXCEPTION_PROLOG_0(PACA_EXGEN)
>> + b decrementer_pSeries_0
>> +
>> STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
>>
>> MASKABLE_EXCEPTION_PSERIES(0xa00, 0xa00, doorbell_super)
>> @@ -536,6 +543,12 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_206)
>> #endif
>>
>> .align 7
>> + /* moved from 0x900 */
>> +decrementer_pSeries_0:
>> + EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_PR, 0x900)
>> + EXCEPTION_PROLOG_PSERIES_1(decrementer_common, EXC_STD)
>> +
>> + .align 7
>> /* moved from 0xe00 */
>> STD_EXCEPTION_HV_OOL(0xe02, h_data_storage)
>> KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0xe02)
>>
>> ---------------------------diff end---------------------------------------
>>
>

2013-04-26 02:05:56

by Chen Gang

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

On 2013年04月26日 09:58, Mike Qiu wrote:
> 于 2013/4/25 19:16, Chen Gang 写道:
>> On 2013年04月25日 14:25, Paul Mackerras wrote:
>>> On Thu, Apr 25, 2013 at 12:05:54PM +0800, Mike Qiu wrote:
>>>>> This has block my work now
>>>>> So I hope you can take a look ASAP
>>>>> Thanks
>>>>> :)
>>>>>
>>>>> Mike
>>> As a quick fix, turn on CONFIG_KVM_BOOK3S_64_HV. That will eliminate
>>> the immediate problem.
>> Yes, just as my original reply to Mike to bypass it, but get no reply, I
>> guess he has to face the CONFIG_KVM_BOOK3S_64_PR.
>>
>> Now, I am just fixing it, when I finish one patch, please help check.
> Actually, I have compile pass by your patch, but I see Micheal Neuling's
> reply,
> I just stop to do that, and wait for you new patch :)
>

I am just continuing (before get fixed, I should continue)


> Now I will use your V2 patch to build

Please see the discussion of patch v2, it still has another issues, but
I am still trying (I guess Michael is just checking).

:-)

--
Chen Gang

Asianux Corporation

2013-04-26 02:07:12

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013年04月26日 10:03, Mike Qiu wrote:
> �� 2013/4/26 9:36, Chen Gang �:
>> > On 2013��04��26�� 09:18, Chen Gang wrote:
>>> >> On 2013��04��26�� 09:06, Chen Gang wrote:
>>>>> >>>> CFAR is the Come From Register. It saves the location of the last
>>>>>> >>>>> branch and is hence overwritten by any branch.
>>>>>> >>>>>
>>>> >>> Do we process it just like others done (e.g. 0x300, 0xe00, 0xe20 ...) ?
>>>> >>> . = 0x900
>>>> >>> .globl decrementer_pSeries
>>>> >>> decrementer_pSeries:
>>>> >>> HMT_MEDIUM_PPR_DISCARD
>>>> >>> SET_SCRATCH0(r13)
>>>> >>> b decrementer_pSeries_0
>>>> >>>
>>>> >>> ...
>>>> >>>
>>>> >>>
>> > Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which related
>> > with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.
> I will try your diff V2, to see if the machine can boot up

OK, thanks. (hope it can work)

:-)

--
Chen Gang

Asianux Corporation

2013-04-26 03:08:56

by Mike Qiu

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

于 2013/4/26 10:06, Chen Gang 写道:
> On 2013年04月26日 10:03, Mike Qiu wrote:
>> �� 2013/4/26 9:36, Chen Gang �:
>>>> On 2013��04��26�� 09:18, Chen Gang wrote:
>>>>>> On 2013��04��26�� 09:06, Chen Gang wrote:
>>>>>>>>>> CFAR is the Come From Register. It saves the location of the last
>>>>>>>>>>>> branch and is hence overwritten by any branch.
>>>>>>>>>>>>
>>>>>>>> Do we process it just like others done (e.g. 0x300, 0xe00, 0xe20 ...) ?
>>>>>>>> . = 0x900
>>>>>>>> .globl decrementer_pSeries
>>>>>>>> decrementer_pSeries:
>>>>>>>> HMT_MEDIUM_PPR_DISCARD
>>>>>>>> SET_SCRATCH0(r13)
>>>>>>>> b decrementer_pSeries_0
>>>>>>>>
>>>>>>>> ...
>>>>>>>>
>>>>>>>>
>>>> Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which related
>>>> with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.
>> I will try your diff V2, to see if the machine can boot up
> OK, thanks. (hope it can work)
It seems that the machine can be bootup in powernv mode, but I'm not
sure if my machine call that module.

At lease my machine can boot up

Thanks
Mike
>
> :-)
>

2013-04-26 03:19:54

by Mike Qiu

[permalink] [raw]
Subject: Re: "attempt to move .org backwards" still show up

于 2013/4/25 14:25, Paul Mackerras 写道:
> On Thu, Apr 25, 2013 at 12:05:54PM +0800, Mike Qiu wrote:
>> This has block my work now
>> So I hope you can take a look ASAP
>> Thanks
>> :)
>>
>> Mike
> As a quick fix, turn on CONFIG_KVM_BOOK3S_64_HV. That will eliminate
> the immediate problem.
Thanks
got it, I will have a try.
> Paul.
>

2013-04-26 03:26:09

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013年04月26日 11:08, Mike Qiu wrote:
> 于 2013/4/26 10:06, Chen Gang 写道:
>> On 2013年04月26日 10:03, Mike Qiu wrote:
>>> �� 2013/4/26 9:36, Chen Gang �:
>>>>> On 2013��04��26�� 09:18, Chen Gang wrote:
>>>>>>> On 2013��04��26�� 09:06, Chen Gang wrote:
>>>>>>>>>>> CFAR is the Come From Register. It saves the location of the
>>>>>>>>>>> last
>>>>>>>>>>>>> branch and is hence overwritten by any branch.
>>>>>>>>>>>>>
>>>>>>>>> Do we process it just like others done (e.g. 0x300, 0xe00,
>>>>>>>>> 0xe20 ...) ?
>>>>>>>>> . = 0x900
>>>>>>>>> .globl decrementer_pSeries
>>>>>>>>> decrementer_pSeries:
>>>>>>>>> HMT_MEDIUM_PPR_DISCARD
>>>>>>>>> SET_SCRATCH0(r13)
>>>>>>>>> b decrementer_pSeries_0
>>>>>>>>>
>>>>>>>>> ...
>>>>>>>>>
>>>>>>>>>
>>>>> Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which related
>>>>> with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.
>>> I will try your diff V2, to see if the machine can boot up
>> OK, thanks. (hope it can work)
> It seems that the machine can be bootup in powernv mode, but I'm not
> sure if my machine call that module.
>
> At lease my machine can boot up

Thank you for your information !

I have checked the disassemble by powerpc64-linux-gnu-objdump, it seems
all we have done for 0x900 is almost like the original done for 0x200.

I am just learning about the CFAR (google it), And I plan to wait for a
day, if all things go smoothly, I will send patch v3.


:-)

--
Chen Gang

Asianux Corporation

2013-04-26 03:43:37

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013年04月26日 11:25, Chen Gang wrote:
> On 2013年04月26日 11:08, Mike Qiu wrote:
>> 于 2013/4/26 10:06, Chen Gang 写道:
>>> On 2013年04月26日 10:03, Mike Qiu wrote:
>>>> �� 2013/4/26 9:36, Chen Gang �:
>>>>>> On 2013��04��26�� 09:18, Chen Gang wrote:
>>>>>>>> On 2013��04��26�� 09:06, Chen Gang wrote:
>>>>>>>>>>>> CFAR is the Come From Register. It saves the location of the
>>>>>>>>>>>> last
>>>>>>>>>>>>>> branch and is hence overwritten by any branch.
>>>>>>>>>>>>>>
>>>>>>>>>> Do we process it just like others done (e.g. 0x300, 0xe00,
>>>>>>>>>> 0xe20 ...) ?
>>>>>>>>>> . = 0x900
>>>>>>>>>> .globl decrementer_pSeries
>>>>>>>>>> decrementer_pSeries:
>>>>>>>>>> HMT_MEDIUM_PPR_DISCARD
>>>>>>>>>> SET_SCRATCH0(r13)
>>>>>>>>>> b decrementer_pSeries_0
>>>>>>>>>>
>>>>>>>>>> ...
>>>>>>>>>>
>>>>>>>>>>
>>>>>> Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which related
>>>>>> with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.
>>>> I will try your diff V2, to see if the machine can boot up
>>> OK, thanks. (hope it can work)
>> It seems that the machine can be bootup in powernv mode, but I'm not
>> sure if my machine call that module.
>>
>> At lease my machine can boot up
>

Please reference commit number: 1707dd161349e6c54170c88d94fed012e3d224e3
(1707dd1 powerpc: Save CFAR before branching in interrupt entry paths)

What our diff v2 has done is just the fix for our patch v2 (just like
the commit 1707dd1 has done).

Please check, thanks.

:-)

> Thank you for your information !
>
> I have checked the disassemble by powerpc64-linux-gnu-objdump, it seems
> all we have done for 0x900 is almost like the original done for 0x200.
>
> I am just learning about the CFAR (google it), And I plan to wait for a
> day, if all things go smoothly, I will send patch v3.
>
>
> :-)
>


--
Chen Gang

Asianux Corporation

2013-04-26 03:55:08

by Mike Qiu

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

于 2013/4/26 11:42, Chen Gang 写道:
> On 2013年04月26日 11:25, Chen Gang wrote:
>> On 2013年04月26日 11:08, Mike Qiu wrote:
>>> 于 2013/4/26 10:06, Chen Gang 写道:
>>>> On 2013年04月26日 10:03, Mike Qiu wrote:
>>>>> �� 2013/4/26 9:36, Chen Gang �:
>>>>>>> On 2013��04��26�� 09:18, Chen Gang wrote:
>>>>>>>>> On 2013��04��26�� 09:06, Chen Gang wrote:
>>>>>>>>>>>>> CFAR is the Come From Register. It saves the location of the
>>>>>>>>>>>>> last
>>>>>>>>>>>>>>> branch and is hence overwritten by any branch.
>>>>>>>>>>>>>>>
>>>>>>>>>>> Do we process it just like others done (e.g. 0x300, 0xe00,
>>>>>>>>>>> 0xe20 ...) ?
>>>>>>>>>>> . = 0x900
>>>>>>>>>>> .globl decrementer_pSeries
>>>>>>>>>>> decrementer_pSeries:
>>>>>>>>>>> HMT_MEDIUM_PPR_DISCARD
>>>>>>>>>>> SET_SCRATCH0(r13)
>>>>>>>>>>> b decrementer_pSeries_0
>>>>>>>>>>>
>>>>>>>>>>> ...
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>> Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which related
>>>>>>> with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.
>>>>> I will try your diff V2, to see if the machine can boot up
>>>> OK, thanks. (hope it can work)
>>> It seems that the machine can be bootup in powernv mode, but I'm not
>>> sure if my machine call that module.
>>>
>>> At lease my machine can boot up
> Please reference commit number: 1707dd161349e6c54170c88d94fed012e3d224e3
> (1707dd1 powerpc: Save CFAR before branching in interrupt entry paths)
>
> What our diff v2 has done is just the fix for our patch v2 (just like
> the commit 1707dd1 has done).
>
> Please check, thanks.
>
> :-)
I will check this evening or tomorrow, I have something else to do this
afteroon.
>> Thank you for your information !
>>
>> I have checked the disassemble by powerpc64-linux-gnu-objdump, it seems
>> all we have done for 0x900 is almost like the original done for 0x200.
>>
>> I am just learning about the CFAR (google it), And I plan to wait for a
>> day, if all things go smoothly, I will send patch v3.
>>
>>
>> :-)
>>
>

2013-04-27 09:29:51

by Chen Gang F T

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013年04月26日 11:54, Mike Qiu wrote:
> 于 2013/4/26 11:42, Chen Gang 写道:
>> On 2013年04月26日 11:25, Chen Gang wrote:
>>> On 2013年04月26日 11:08, Mike Qiu wrote:
>>>> 于 2013/4/26 10:06, Chen Gang 写道:
>>>>> On 2013年04月26日 10:03, Mike Qiu wrote:
>>>>>> �� 2013/4/26 9:36, Chen Gang �:
>>>>>>>> On 2013��04��26�� 09:18, Chen Gang wrote:
>>>>>>>>>> On 2013��04��26�� 09:06, Chen Gang wrote:
>>>>>>>>>>>>>> CFAR is the Come From Register. It saves the location of the
>>>>>>>>>>>>>> last
>>>>>>>>>>>>>>>> branch and is hence overwritten by any branch.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>> Do we process it just like others done (e.g. 0x300, 0xe00,
>>>>>>>>>>>> 0xe20 ...) ?
>>>>>>>>>>>> . = 0x900
>>>>>>>>>>>> .globl decrementer_pSeries
>>>>>>>>>>>> decrementer_pSeries:
>>>>>>>>>>>> HMT_MEDIUM_PPR_DISCARD
>>>>>>>>>>>> SET_SCRATCH0(r13)
>>>>>>>>>>>> b decrementer_pSeries_0
>>>>>>>>>>>>
>>>>>>>>>>>> ...
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>> Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which
>>>>>>>> related
>>>>>>>> with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.
>>>>>> I will try your diff V2, to see if the machine can boot up
>>>>> OK, thanks. (hope it can work)
>>>> It seems that the machine can be bootup in powernv mode, but I'm not
>>>> sure if my machine call that module.
>>>>
>>>> At lease my machine can boot up
>> Please reference commit number: 1707dd161349e6c54170c88d94fed012e3d224e3
>> (1707dd1 powerpc: Save CFAR before branching in interrupt entry paths)
>>
>> What our diff v2 has done is just the fix for our patch v2 (just like
>> the commit 1707dd1 has done).
>>
>> Please check, thanks.
>>
>> :-)
> I will check this evening or tomorrow, I have something else to do this
> afteroon.

I think the diff v2 is correct, but is not the best one for this issue.

I prefer the Paul's patch for this issue which has better performance

:-)


Thanks.

--
Chen Gang

Flying Transformer

2013-04-27 09:32:42

by Mike Qiu

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

于 2013/4/27 17:28, Chen Gang F T 写道:
> On 2013年04月26日 11:54, Mike Qiu wrote:
>> 于 2013/4/26 11:42, Chen Gang 写道:
>>> On 2013年04月26日 11:25, Chen Gang wrote:
>>>> On 2013年04月26日 11:08, Mike Qiu wrote:
>>>>> 于 2013/4/26 10:06, Chen Gang 写道:
>>>>>> On 2013年04月26日 10:03, Mike Qiu wrote:
>>>>>>> �� 2013/4/26 9:36, Chen Gang �:
>>>>>>>>> On 2013��04��26�� 09:18, Chen Gang wrote:
>>>>>>>>>>> On 2013��04��26�� 09:06, Chen Gang wrote:
>>>>>>>>>>>>>>> CFAR is the Come From Register. It saves the location of the
>>>>>>>>>>>>>>> last
>>>>>>>>>>>>>>>>> branch and is hence overwritten by any branch.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>> Do we process it just like others done (e.g. 0x300, 0xe00,
>>>>>>>>>>>>> 0xe20 ...) ?
>>>>>>>>>>>>> . = 0x900
>>>>>>>>>>>>> .globl decrementer_pSeries
>>>>>>>>>>>>> decrementer_pSeries:
>>>>>>>>>>>>> HMT_MEDIUM_PPR_DISCARD
>>>>>>>>>>>>> SET_SCRATCH0(r13)
>>>>>>>>>>>>> b decrementer_pSeries_0
>>>>>>>>>>>>>
>>>>>>>>>>>>> ...
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>> Oh, it seems EXCEPTION_PROLOG_1 will save the regesters which
>>>>>>>>> related
>>>>>>>>> with CFAR, so I think need move EXCEPTION_PROLOG_1 to near 0x900.
>>>>>>> I will try your diff V2, to see if the machine can boot up
>>>>>> OK, thanks. (hope it can work)
>>>>> It seems that the machine can be bootup in powernv mode, but I'm not
>>>>> sure if my machine call that module.
>>>>>
>>>>> At lease my machine can boot up
>>> Please reference commit number: 1707dd161349e6c54170c88d94fed012e3d224e3
>>> (1707dd1 powerpc: Save CFAR before branching in interrupt entry paths)
>>>
>>> What our diff v2 has done is just the fix for our patch v2 (just like
>>> the commit 1707dd1 has done).
>>>
>>> Please check, thanks.
>>>
>>> :-)
>> I will check this evening or tomorrow, I have something else to do this
>> afteroon.
> I think the diff v2 is correct, but is not the best one for this issue.
>
> I prefer the Paul's patch for this issue which has better performance
>
> :-)
yes, I use your patch and it can work, also Paul's patch can work too.
>
> Thanks.
>

2013-04-27 09:33:56

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH v2] PowerPC: kernel: compiling issue, make additional room in exception vector area

On 2013年04月27日 17:32, Mike Qiu wrote:
>>>
>> I think the diff v2 is correct, but is not the best one for this issue.
>>
>> I prefer the Paul's patch for this issue which has better performance
>>
>> :-)
> yes, I use your patch and it can work, also Paul's patch can work too.

Good news.

Bye !

:-)

--
Chen Gang

Asianux Corporation