All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.0 0/2] prep: Remove some clearly wrong assumptions
@ 2014-04-01 21:18 Hervé Poussineau
  2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of PCI devices Hervé Poussineau
  2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc) Hervé Poussineau
  0 siblings, 2 replies; 7+ messages in thread
From: Hervé Poussineau @ 2014-04-01 21:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau, Andreas Färber, qemu-ppc

Hi,

These two patches remove some bugs for a PReP firmware. Note that first patch is very
PReP-oriented, and breaks OHW compatibility with other QEMU emulations (oldworld and
newworld machines).
Patches to remove corresponding hacks on QEMU side will be sent shortly.

Hervé

Hervé Poussineau (2):
  ohw: correctly program BAR addresses of PCI devices
  ohw: let the right reset entry point 0xfff00100 jump to the currently
    wrong entry point (0xfffffffc)

 src/pci.c     |    9 +++++++--
 src/vectors.S |    7 ++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

-- 
1.7.10.4

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

* [Qemu-devel] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of PCI devices
  2014-04-01 21:18 [Qemu-devel] [PATCH for-2.0 0/2] prep: Remove some clearly wrong assumptions Hervé Poussineau
@ 2014-04-01 21:18 ` Hervé Poussineau
  2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc) Hervé Poussineau
  1 sibling, 0 replies; 7+ messages in thread
From: Hervé Poussineau @ 2014-04-01 21:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau, Andreas Färber, qemu-ppc

Note that offsets are PReP ones, so this breaks compatibility with hardware which has different values.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 src/pci.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/pci.c b/src/pci.c
index 38aad27..7c0ebad 100644
--- a/src/pci.c
+++ b/src/pci.c
@@ -1723,8 +1723,13 @@ static inline void pci_update_device (pci_bridge_t *bridge,
                 addr = 0x30; /* PCI ROM */
             else
                 addr = 0x10 + (i * sizeof(uint32_t));
-            pci_config_writel(bridge, device->bus, device->devfn,
-                              addr, device->regions[i]);
+            if (device->regions[i] & 0x00000001) {
+                pci_config_writel(bridge, device->bus, device->devfn,
+                                  addr, device->regions[i] - 0x80000000);
+            } else {
+                pci_config_writel(bridge, device->bus, device->devfn,
+                                  addr, device->regions[i] - 0xc0000000);
+            }
         }
     }
 }
-- 
1.7.10.4

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

* [Qemu-devel] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc)
  2014-04-01 21:18 [Qemu-devel] [PATCH for-2.0 0/2] prep: Remove some clearly wrong assumptions Hervé Poussineau
  2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of PCI devices Hervé Poussineau
@ 2014-04-01 21:18 ` Hervé Poussineau
  2014-04-02  5:14   ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
  1 sibling, 1 reply; 7+ messages in thread
From: Hervé Poussineau @ 2014-04-01 21:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hervé Poussineau, Andreas Färber, qemu-ppc

This is easier to do this than to copy the code from the wrong entry point to the right entry point.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 src/vectors.S |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/vectors.S b/src/vectors.S
index 691d568..05cd1d9 100644
--- a/src/vectors.S
+++ b/src/vectors.S
@@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
 
         /* Exception vectors */
         /* Reset exception */
-        EXCP_BUG(0100)                                    ;
+.org 0x0100
+excp_0100:
+        lis r3,0
+        addi r3,r3,-4
+        mtlr r3
+        blr
 
         /* Machine check exception */
         EXCP_BUG(0200)                                    ;
-- 
1.7.10.4

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc)
  2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc) Hervé Poussineau
@ 2014-04-02  5:14   ` Alexander Graf
  2014-04-02  5:23     ` Hervé Poussineau
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Graf @ 2014-04-02  5:14 UTC (permalink / raw)
  To: Hervé Poussineau; +Cc: qemu-ppc, Andreas Färber, qemu-devel



> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
> 
> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
> 
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
> src/vectors.S |    7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/vectors.S b/src/vectors.S
> index 691d568..05cd1d9 100644
> --- a/src/vectors.S
> +++ b/src/vectors.S
> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
> 
>         /* Exception vectors */
>         /* Reset exception */
> -        EXCP_BUG(0100)                                    ;
> +.org 0x0100
> +excp_0100:
> +        lis r3,0
> +        addi r3,r3,-4
> +        mtlr r3
> +        blr

Doesn't ba -4 work?

Alex

> 
>         /* Machine check exception */
>         EXCP_BUG(0200)                                    ;
> -- 
> 1.7.10.4
> 
> 

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc)
  2014-04-02  5:14   ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
@ 2014-04-02  5:23     ` Hervé Poussineau
  2014-04-02  5:36       ` Alexander Graf
  0 siblings, 1 reply; 7+ messages in thread
From: Hervé Poussineau @ 2014-04-02  5:23 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Andreas Färber, qemu-ppc, qemu-devel

Le mer. 02 avril 2014 07:14:48 CEST, Alexander Graf a écrit :
>
>
>> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>>
>> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
>>
>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>> ---
>> src/vectors.S |    7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/vectors.S b/src/vectors.S
>> index 691d568..05cd1d9 100644
>> --- a/src/vectors.S
>> +++ b/src/vectors.S
>> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
>>
>>          /* Exception vectors */
>>          /* Reset exception */
>> -        EXCP_BUG(0100)                                    ;
>> +.org 0x0100
>> +excp_0100:
>> +        lis r3,0
>> +        addi r3,r3,-4
>> +        mtlr r3
>> +        blr
>
> Doesn't ba -4 work?
>

Yes, "ba -4" also works, I just tested it.

Hervé

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc)
  2014-04-02  5:23     ` Hervé Poussineau
@ 2014-04-02  5:36       ` Alexander Graf
  2014-04-02  5:45         ` Alexander Graf
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Graf @ 2014-04-02  5:36 UTC (permalink / raw)
  To: Hervé Poussineau; +Cc: Andreas Färber, qemu-ppc, qemu-devel



> Am 02.04.2014 um 07:23 schrieb Hervé Poussineau <hpoussin@reactos.org>:
> 
> Le mer. 02 avril 2014 07:14:48 CEST, Alexander Graf a écrit :
>> 
>> 
>>> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>>> 
>>> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
>>> 
>>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>>> ---
>>> src/vectors.S |    7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/src/vectors.S b/src/vectors.S
>>> index 691d568..05cd1d9 100644
>>> --- a/src/vectors.S
>>> +++ b/src/vectors.S
>>> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
>>> 
>>>         /* Exception vectors */
>>>         /* Reset exception */
>>> -        EXCP_BUG(0100)                                    ;
>>> +.org 0x0100
>>> +excp_0100:
>>> +        lis r3,0
>>> +        addi r3,r3,-4
>>> +        mtlr r3
>>> +        blr
>> 
>> Doesn't ba -4 work?
> 
> Yes, "ba -4" also works, I just tested it.

It's a lot cleaner because it doesn't modify registers. I don't think this is 2.0 material either - we're in the "critical bug fixes only" phase already, so no need to rush :).

Alex

> 
> Hervé
> 

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc)
  2014-04-02  5:36       ` Alexander Graf
@ 2014-04-02  5:45         ` Alexander Graf
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Graf @ 2014-04-02  5:45 UTC (permalink / raw)
  To: Hervé Poussineau; +Cc: Andreas Färber, qemu-ppc, qemu-devel



> Am 02.04.2014 um 07:36 schrieb Alexander Graf <agraf@suse.de>:
> 
> 
> 
>> Am 02.04.2014 um 07:23 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>> 
>> Le mer. 02 avril 2014 07:14:48 CEST, Alexander Graf a écrit :
>>> 
>>> 
>>>> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>>>> 
>>>> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
>>>> 
>>>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>>>> ---
>>>> src/vectors.S |    7 ++++++-
>>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>> 
>>>> diff --git a/src/vectors.S b/src/vectors.S
>>>> index 691d568..05cd1d9 100644
>>>> --- a/src/vectors.S
>>>> +++ b/src/vectors.S
>>>> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
>>>> 
>>>>        /* Exception vectors */
>>>>        /* Reset exception */
>>>> -        EXCP_BUG(0100)                                    ;
>>>> +.org 0x0100
>>>> +excp_0100:
>>>> +        lis r3,0
>>>> +        addi r3,r3,-4
>>>> +        mtlr r3
>>>> +        blr
>>> 
>>> Doesn't ba -4 work?
>> 
>> Yes, "ba -4" also works, I just tested it.
> 
> It's a lot cleaner because it doesn't modify registers. I don't think this is 2.0 material either - we're in the "critical bug fixes only" phase already, so no need to rush :).

Oh, and writing it as ba 0xfffffffc should work as well and be even clearer :)


Alex

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

end of thread, other threads:[~2014-04-02  5:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-01 21:18 [Qemu-devel] [PATCH for-2.0 0/2] prep: Remove some clearly wrong assumptions Hervé Poussineau
2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of PCI devices Hervé Poussineau
2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc) Hervé Poussineau
2014-04-02  5:14   ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-04-02  5:23     ` Hervé Poussineau
2014-04-02  5:36       ` Alexander Graf
2014-04-02  5:45         ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.