Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-12 Thread Mark Cave-Ayland
On 12/07/16 07:24, Cédric Le Goater wrote:

>> That's exactly what I see here, thanks for testing. For the unassigned
>> channels there is potentially scope for doing something better for ESCC,
>> however the aim for this patchset was to merge the minimal changes
>> required to enable testing.
> 
> So, what are the release plans for OpenBIOS ?  It would be good to have 
> the macos9 support available in qemu-2.7. 

Hopefully the repository migration will be finished over the next couple
of days, at which point I'll retest the current github master and if it
looks good, send a pull request to update the binaries.

The OS 9 issue is a bit tricky, the OS 9 bootloader is buggy in that it
fiddles with the r-stack which means it corrupts its own return address.
Hopefully I'll find some time over the next week or so to start looking
at this again.


ATB,

Mark.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Cédric Le Goater
Hello Mark,

On 07/11/2016 08:11 PM, Mark Cave-Ayland wrote:
> On 11/07/16 08:51, Cédric Le Goater wrote:
> 
>>> Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
>>> then it has been working fine here? From what I've seen both 9.2.1 and
>>> 9.2.2 now boot fine, but please test and report if that's not the case.
>>
>> Hello Mark,
>>
>> I managed to boot and install a 9.2.1. Here is what I have used for 
>> that :
>>
>>  * qemu, David's 2.7 branch, plus Ben's patch "v2 ppc: Fix support 
>>for odd MSR combinations". 
>>
>>  * openbios,  github's HEAD + the patch your patch from : 
>>
>>  https://www.coreboot.org/pipermail/openbios/2015-June/008722.html
>>
>>  * iso, the os9.osi from 
>>
>>  http://c-obrien.org/qemu-os9/testing/
>>
>> There are a  couple of qemu errors :
>>
>>  dbdma_unassigned_rw: use of unassigned channel 14
>>  dbdma_unassigned_flush: use of unassigned channel 14
>>  CUDA: unknown command 0x24
>>
>> and invalids read/write on SPRs but it didn't cause any issue in the guest
>> at installation time or later at runtime. I did not try network though.
>>
>> So mainline only misses your forth patch. Looking really good ! 
> 
> Hi Cédric,
> 
> That's exactly what I see here, thanks for testing. For the unassigned
> channels there is potentially scope for doing something better for ESCC,
> however the aim for this patchset was to merge the minimal changes
> required to enable testing.

So, what are the release plans for OpenBIOS ?  It would be good to have 
the macos9 support available in qemu-2.7. 

Thanks,

C.



Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Programmingkid

On Jul 11, 2016, at 2:37 PM, Mark Cave-Ayland wrote:

> On 11/07/16 15:42, Programmingkid wrote:
> 
>>> Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
>>> then it has been working fine here? From what I've seen both 9.2.1 and
>>> 9.2.2 now boot fine, but please test and report if that's not the case.
>>> 
>> I tried the Mac OS 9.2.1 iso and it does not boot. I used only your patch 
>> set.
> 
> On top of git master? In that case you still need Ben's patch to fix odd
> MSR combinations:
> http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg02066.html.

Thank you for this. 

> 
>> I would also like to report that I could not make networking work on Mac OS 
>> 9.0.4. I tried both the usb-net and rtl8139 nics. This is the command-line I 
>> used: -netdev user,id=mynet0 -device usb-net,netdev=mynet0 and -netdev 
>> user,id=mynet0 -device rtl8139,netdev=mynet0.
> 
> This seems to be slightly lacking as a bug report - does the NIC appear
> in the device tree, which drivers have you used, any relevant logs etc.?
> Anyhow it's probably worth spinning this out to a separate thread.

The USB NIC is not recognized by Mac OS 9.0.4. The RTL8139 is recognized but 
does not appear to be fully functional. DHCP does not work. 

I am pleased to announce that this patch set fixes the problem of Mac OS 9 
preventing QEMU from shutting down. Restarting Mac OS 9 does still cause QEMU 
to display a blank black screen.


Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Mark Cave-Ayland
On 11/07/16 15:42, Programmingkid wrote:

>> Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
>> then it has been working fine here? From what I've seen both 9.2.1 and
>> 9.2.2 now boot fine, but please test and report if that's not the case.
>>
> I tried the Mac OS 9.2.1 iso and it does not boot. I used only your patch set.

On top of git master? In that case you still need Ben's patch to fix odd
MSR combinations:
http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg02066.html.

> I would also like to report that I could not make networking work on Mac OS 
> 9.0.4. I tried both the usb-net and rtl8139 nics. This is the command-line I 
> used: -netdev user,id=mynet0 -device usb-net,netdev=mynet0 and -netdev 
> user,id=mynet0 -device rtl8139,netdev=mynet0.

This seems to be slightly lacking as a bug report - does the NIC appear
in the device tree, which drivers have you used, any relevant logs etc.?
Anyhow it's probably worth spinning this out to a separate thread.


ATB,

Mark.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Mark Cave-Ayland
On 11/07/16 08:51, Cédric Le Goater wrote:

>> Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
>> then it has been working fine here? From what I've seen both 9.2.1 and
>> 9.2.2 now boot fine, but please test and report if that's not the case.
> 
> Hello Mark,
> 
> I managed to boot and install a 9.2.1. Here is what I have used for 
> that :
> 
>  * qemu, David's 2.7 branch, plus Ben's patch "v2 ppc: Fix support 
>for odd MSR combinations". 
> 
>  * openbios,  github's HEAD + the patch your patch from : 
> 
>   https://www.coreboot.org/pipermail/openbios/2015-June/008722.html
> 
>  * iso, the os9.osi from 
> 
>   http://c-obrien.org/qemu-os9/testing/
> 
> There are a  couple of qemu errors :
> 
>   dbdma_unassigned_rw: use of unassigned channel 14
>   dbdma_unassigned_flush: use of unassigned channel 14
>   CUDA: unknown command 0x24
> 
> and invalids read/write on SPRs but it didn't cause any issue in the guest
> at installation time or later at runtime. I did not try network though.
> 
> So mainline only misses your forth patch. Looking really good ! 

Hi Cédric,

That's exactly what I see here, thanks for testing. For the unassigned
channels there is potentially scope for doing something better for ESCC,
however the aim for this patchset was to merge the minimal changes
required to enable testing.


ATB,

Mark.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Programmingkid

On Jul 11, 2016, at 3:04 AM, Mark Cave-Ayland wrote:

> On 10/07/16 23:14, Cédric Le Goater wrote:
> 
>> Mark, 
>> 
>> For OS 9, do you plan to commit these openbios patches soon ? 
>> 
>>  https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg02824.html
>> 
>> as we just gave them a good test. Or may be, include them under 
>> a github branch to make them easier to find.
> 
> All of the OS 9 patches for QEMU and OpenBIOS have been upstreamed,
> except this one for OpenBIOS:
> https://www.coreboot.org/pipermail/openbios/2015-June/008722.html. I
> currently keep a manually build binary at
> https://www.ilande.co.uk/tmp/openbios/openbios-ppc for people who can't
> build their own.
> 
>> Also, I found out that some OS 9 isos are not supported by qemu. 
>> These are ok : 
>>  
>>  
>> http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=0ef8922b24a51d2a9d546300aea69c64&start=250
>> 
>> But the one under :
>> 
>>  http://c-obrien.org/qemu-os9/testing/
>> 
>> does not boot. It loops on some CUDA commands and then hangs. 
>> I did not dig further. Is that a known issue ? 
> 
> Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
> then it has been working fine here? From what I've seen both 9.2.1 and
> 9.2.2 now boot fine, but please test and report if that's not the case.
> 
I tried the Mac OS 9.2.1 iso and it does not boot. I used only your patch set.

I would also like to report that I could not make networking work on Mac OS 
9.0.4. I tried both the usb-net and rtl8139 nics. This is the command-line I 
used: -netdev user,id=mynet0 -device usb-net,netdev=mynet0 and -netdev 
user,id=mynet0 -device rtl8139,netdev=mynet0.


Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Cédric Le Goater
On 07/11/2016 09:51 AM, Cédric Le Goater wrote:
> On 07/11/2016 09:04 AM, Mark Cave-Ayland wrote:
>> On 10/07/16 23:14, Cédric Le Goater wrote:
>>
>>> Mark, 
>>>
>>> For OS 9, do you plan to commit these openbios patches soon ? 
>>>
>>> https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg02824.html
>>>
>>> as we just gave them a good test. Or may be, include them under 
>>> a github branch to make them easier to find.
>>
>> All of the OS 9 patches for QEMU and OpenBIOS have been upstreamed,
>> except this one for OpenBIOS:
>> https://www.coreboot.org/pipermail/openbios/2015-June/008722.html. I
>> currently keep a manually build binary at
>> https://www.ilande.co.uk/tmp/openbios/openbios-ppc for people who can't
>> build their own.
>>
>>> Also, I found out that some OS 9 isos are not supported by qemu. 
>>> These are ok : 
>>> 
>>> 
>>> http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=0ef8922b24a51d2a9d546300aea69c64&start=250
>>>
>>> But the one under :
>>>
>>> http://c-obrien.org/qemu-os9/testing/
>>>
>>> does not boot. It loops on some CUDA commands and then hangs. 
>>> I did not dig further. Is that a known issue ? 
>>
>> Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
>> then it has been working fine here? From what I've seen both 9.2.1 and
>> 9.2.2 now boot fine, but please test and report if that's not the case.
> 
> Hello Mark,
> 
> I managed to boot and install a 9.2.1. Here is what I have used for 
> that :
> 
>  * qemu, David's 2.7 branch, plus Ben's patch "v2 ppc: Fix support 
>for odd MSR combinations". 
> 
>  * openbios,  github's HEAD + the patch your patch from : 
> 
>   https://www.coreboot.org/pipermail/openbios/2015-June/008722.html
> 
>  * iso, the os9.osi from 
> 
>   http://c-obrien.org/qemu-os9/testing/

That is a 9.2.1. Status is the same with a 9.2.2 I found on the net.

Cheers,

C. 


> There are a  couple of qemu errors :
> 
>   dbdma_unassigned_rw: use of unassigned channel 14
>   dbdma_unassigned_flush: use of unassigned channel 14
>   CUDA: unknown command 0x24
> 
> and invalids read/write on SPRs but it didn't cause any issue in the guest
> at installation time or later at runtime. I did not try network though.
> 
> So mainline only misses your forth patch. Looking really good ! 
> 
> Thanks,
> 
> C.
> 




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Cédric Le Goater
On 07/11/2016 09:04 AM, Mark Cave-Ayland wrote:
> On 10/07/16 23:14, Cédric Le Goater wrote:
> 
>> Mark, 
>>
>> For OS 9, do you plan to commit these openbios patches soon ? 
>>
>>  https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg02824.html
>>
>> as we just gave them a good test. Or may be, include them under 
>> a github branch to make them easier to find.
> 
> All of the OS 9 patches for QEMU and OpenBIOS have been upstreamed,
> except this one for OpenBIOS:
> https://www.coreboot.org/pipermail/openbios/2015-June/008722.html. I
> currently keep a manually build binary at
> https://www.ilande.co.uk/tmp/openbios/openbios-ppc for people who can't
> build their own.
> 
>> Also, I found out that some OS 9 isos are not supported by qemu. 
>> These are ok : 
>>  
>>  
>> http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=0ef8922b24a51d2a9d546300aea69c64&start=250
>>
>> But the one under :
>>
>>  http://c-obrien.org/qemu-os9/testing/
>>
>> does not boot. It loops on some CUDA commands and then hangs. 
>> I did not dig further. Is that a known issue ? 
> 
> Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
> then it has been working fine here? From what I've seen both 9.2.1 and
> 9.2.2 now boot fine, but please test and report if that's not the case.

Hello Mark,

I managed to boot and install a 9.2.1. Here is what I have used for 
that :

 * qemu, David's 2.7 branch, plus Ben's patch "v2 ppc: Fix support 
   for odd MSR combinations". 

 * openbios,  github's HEAD + the patch your patch from : 

https://www.coreboot.org/pipermail/openbios/2015-June/008722.html

 * iso, the os9.osi from 

http://c-obrien.org/qemu-os9/testing/

There are a  couple of qemu errors :

dbdma_unassigned_rw: use of unassigned channel 14
dbdma_unassigned_flush: use of unassigned channel 14
CUDA: unknown command 0x24

and invalids read/write on SPRs but it didn't cause any issue in the guest
at installation time or later at runtime. I did not try network though.

So mainline only misses your forth patch. Looking really good ! 

Thanks,

C.



Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Mark Cave-Ayland
On 10/07/16 23:14, Cédric Le Goater wrote:

> Mark, 
> 
> For OS 9, do you plan to commit these openbios patches soon ? 
> 
>   https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg02824.html
> 
> as we just gave them a good test. Or may be, include them under 
> a github branch to make them easier to find.

All of the OS 9 patches for QEMU and OpenBIOS have been upstreamed,
except this one for OpenBIOS:
https://www.coreboot.org/pipermail/openbios/2015-June/008722.html. I
currently keep a manually build binary at
https://www.ilande.co.uk/tmp/openbios/openbios-ppc for people who can't
build their own.

> Also, I found out that some OS 9 isos are not supported by qemu. 
> These are ok : 
>   
>   
> http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=0ef8922b24a51d2a9d546300aea69c64&start=250
> 
> But the one under :
> 
>   http://c-obrien.org/qemu-os9/testing/
> 
> does not boot. It loops on some CUDA commands and then hangs. 
> I did not dig further. Is that a known issue ? 

Hmmm if that's the same 9.2.1 image we were using for last year's GSoC
then it has been working fine here? From what I've seen both 9.2.1 and
9.2.2 now boot fine, but please test and report if that's not the case.


ATB,

Mark.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-11 Thread Mark Cave-Ayland
On 11/07/16 04:09, Alfonso Gamboa wrote:

> I removed OpenTransport and other extensions and control panels as well as
> patched the System Suitcase on some of those iso's on the emaculation.com
> forum. They are not stock images.  Perhaps we still need further work.   As
> far as 9.0.4 booting,  I have never succeeded in booting that,  awesome!

Quickly browsing through mails this morning, you should be able to
boot/install unmodified OS 9 ISOs with David's ppc-for-2.7 branch and a
slightly modified OpenBIOS. Note that the DBDMA code simply reports back
to OpenTransport that nothing is connected to the ESCC port, so it's not
as if you'll be able to run LocalTalk over emulated serial ports yet.
But it should be enough for people to test with OS 9 LAN drivers.

> Mark: do you have a link to the latest working openbios-ppc?

https://www.ilande.co.uk/tmp/openbios/openbios-ppc


ATB,

Mark.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-10 Thread Alfonso Gamboa
I removed OpenTransport and other extensions and control panels as well as
patched the System Suitcase on some of those iso's on the emaculation.com
forum. They are not stock images.  Perhaps we still need further work.   As
far as 9.0.4 booting,  I have never succeeded in booting that,  awesome!

Mark: do you have a link to the latest working openbios-ppc?

Regards,
Alfonso
On 07/09/2016 07:42 PM, G 3 wrote:
>> On 07/09/2016 02:43 AM, Mark Cave-Ayland wrote:
>>
>>> On 01/07/16 07:41, David Gibson wrote:
>>>
>>>
 From: Benjamin Herrenschmidt 

 The architecture specifies that any instruction that sets MSR:PR will
also
 set MSR:EE, IR and DR.

 Signed-off-by: Benjamin Herrenschmidt 
 Signed-off-by: C?dric Le Goater 
 Signed-off-by: David Gibson 
 ---
  target-ppc/helper_regs.h | 4 
  1 file changed, 4 insertions(+)

 diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
 index 8fc0934..8fdfa5c 100644
 --- a/target-ppc/helper_regs.h
 +++ b/target-ppc/helper_regs.h
 @@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState
*env, target_ulong value,
  /* Change the exception prefix on PowerPC 601 */
  env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF0;
  }
 +/* If PR=1 then EE, IR and DR must be 1 */
 +if ((value >> MSR_PR) & 1) {
 +value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR);
 +}
  #endif
  env->msr = value;
  hreg_compute_hflags(env);


>>>
>>> Unfortunately this patch causes a regression and breaks booting OS 9 and
>>> OS X under qemu-system-ppc.
>>>
>>
>> Ah This is curious.
>>
>>
>> I used :
>>
>> qemu-system-ppc -M g3beige -cdrom darwinppc-602.cdr -boot d
>> qemu-system-ppc -M mac99 -cdrom darwinppc-602.cdr -boot d
>> qemu-system-ppc64 -M g3beige -cdrom darwinppc-602.cdr -boot d
>>
>> which "work" as they reach the installation prompt :
>>
>> The following devices are available for installation.
>>
>> This one hangs :
>>
>> qemu-system-ppc64 -M mac99 -cdrom darwinppc-602.cdr -boot d
>>
>> But that is expected for a 970 cpu.
>>
>> The login prompt is reached with a full Darwin disk image.
>>
>> So I must be missing a scenario :/
>>
>> Thanks,
>>
>> C.
>
>
> I suggest you use a more up-to-date version of Darwin for PowerPC 64-bit
support:
>
> https://opensource.apple.com/static/iso/darwinppc-801.cdr.gz

ok. Will do.


Mark,

For OS 9, do you plan to commit these openbios patches soon ?


https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg02824.html

as we just gave them a good test. Or may be, include them under
a github branch to make them easier to find.


Also, I found out that some OS 9 isos are not supported by qemu.
These are ok :


http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=0ef8922b24a51d2a9d546300aea69c64&start=250

But the one under :

http://c-obrien.org/qemu-os9/testing/

does not boot. It loops on some CUDA commands and then hangs.
I did not dig further. Is that a known issue ?

Thanks,

C.


Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-10 Thread Cédric Le Goater
On 07/09/2016 07:42 PM, G 3 wrote:
>> On 07/09/2016 02:43 AM, Mark Cave-Ayland wrote:
>>
>>> On 01/07/16 07:41, David Gibson wrote:
>>>
>>>
 From: Benjamin Herrenschmidt 

 The architecture specifies that any instruction that sets MSR:PR will also
 set MSR:EE, IR and DR.

 Signed-off-by: Benjamin Herrenschmidt 
 Signed-off-by: C?dric Le Goater 
 Signed-off-by: David Gibson 
 ---
  target-ppc/helper_regs.h | 4 
  1 file changed, 4 insertions(+)

 diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
 index 8fc0934..8fdfa5c 100644
 --- a/target-ppc/helper_regs.h
 +++ b/target-ppc/helper_regs.h
 @@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState *env, 
 target_ulong value,
  /* Change the exception prefix on PowerPC 601 */
  env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF0;
  }
 +/* If PR=1 then EE, IR and DR must be 1 */
 +if ((value >> MSR_PR) & 1) {
 +value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR);
 +}
  #endif
  env->msr = value;
  hreg_compute_hflags(env);


>>>
>>> Unfortunately this patch causes a regression and breaks booting OS 9 and
>>> OS X under qemu-system-ppc.
>>>
>>
>> Ah This is curious.
>>
>>
>> I used :
>>
>> qemu-system-ppc -M g3beige -cdrom darwinppc-602.cdr -boot d
>> qemu-system-ppc -M mac99 -cdrom darwinppc-602.cdr -boot d
>> qemu-system-ppc64 -M g3beige -cdrom darwinppc-602.cdr -boot d
>>
>> which "work" as they reach the installation prompt :
>>
>> The following devices are available for installation.
>>
>> This one hangs :
>>
>> qemu-system-ppc64 -M mac99 -cdrom darwinppc-602.cdr -boot d
>>
>> But that is expected for a 970 cpu.
>>
>> The login prompt is reached with a full Darwin disk image.
>>
>> So I must be missing a scenario :/
>>
>> Thanks,
>>
>> C.
> 
> 
> I suggest you use a more up-to-date version of Darwin for PowerPC 64-bit 
> support:
> 
> https://opensource.apple.com/static/iso/darwinppc-801.cdr.gz

ok. Will do.


Mark, 

For OS 9, do you plan to commit these openbios patches soon ? 

https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg02824.html

as we just gave them a good test. Or may be, include them under 
a github branch to make them easier to find.


Also, I found out that some OS 9 isos are not supported by qemu. 
These are ok : 


http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=0ef8922b24a51d2a9d546300aea69c64&start=250

But the one under :

http://c-obrien.org/qemu-os9/testing/

does not boot. It loops on some CUDA commands and then hangs. 
I did not dig further. Is that a known issue ? 
 
Thanks,

C.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-09 Thread G 3

On 07/09/2016 02:43 AM, Mark Cave-Ayland wrote:


On 01/07/16 07:41, David Gibson wrote:


From: Benjamin Herrenschmidt  



The architecture specifies that any instruction that sets MSR:PR  
will also

set MSR:EE, IR and DR.

Signed-off-by: Benjamin Herrenschmidt 
Signed-off-by: C?dric Le Goater 
Signed-off-by: David Gibson 
---
 target-ppc/helper_regs.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
index 8fc0934..8fdfa5c 100644
--- a/target-ppc/helper_regs.h
+++ b/target-ppc/helper_regs.h
@@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState  
*env, target_ulong value,

 /* Change the exception prefix on PowerPC 601 */
 env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF0;
 }
+/* If PR=1 then EE, IR and DR must be 1 */
+if ((value >> MSR_PR) & 1) {
+value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR);
+}
 #endif
 env->msr = value;
 hreg_compute_hflags(env);




Unfortunately this patch causes a regression and breaks booting OS  
9 and

OS X under qemu-system-ppc.



Ah This is curious.


I used :

qemu-system-ppc -M g3beige -cdrom darwinppc-602.cdr -boot d
qemu-system-ppc -M mac99 -cdrom darwinppc-602.cdr -boot d
qemu-system-ppc64 -M g3beige -cdrom darwinppc-602.cdr -boot d

which "work" as they reach the installation prompt :

The following devices are available for installation.

This one hangs :

qemu-system-ppc64 -M mac99 -cdrom darwinppc-602.cdr -boot d

But that is expected for a 970 cpu.

The login prompt is reached with a full Darwin disk image.

So I must be missing a scenario :/

Thanks,

C.



I suggest you use a more up-to-date version of Darwin for PowerPC 64- 
bit support:


https://opensource.apple.com/static/iso/darwinppc-801.cdr.gz



Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-09 Thread Mark Cave-Ayland
On 09/07/16 04:08, Benjamin Herrenschmidt wrote:

> On Sat, 2016-07-09 at 13:00 +1000, Benjamin Herrenschmidt wrote:
>>> Additionally, hreg_compute_mem_idx() will treat PR=1 as DR=1/IR=1
>>> as well ! That means that if those old processors allow PR=1 and IR
>>> or DR=0 and MacOS uses it, we do have a TLB coherency problem in
>>> qemu.
>>
>> Wow, yes indeed, I see an MSR with PR=1 IR=0, IR=1 and EE=0 .. ugh.
> 
> Note that I see that happening with OS 9, but not with Darwin ... are
> you sure about OS X ?
> 
> Cheers,
> Ben.

Hmmm actually I think OS X might have been a red herring - I
double-checked and it looks like I was accidentally testing an illegal
combination, i.e. OS X 10.2 with -M mac99 which of course doesn't work.


ATB,

Mark.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-09 Thread Cédric Le Goater
On 07/09/2016 10:25 AM, Benjamin Herrenschmidt wrote:
> On Sat, 2016-07-09 at 10:16 +0200, Cédric Le Goater wrote:
>> The login prompt is reached with a full Darwin disk image. 
>>
>> So I must be missing a scenario :/
> 
> Yes same here, Darwin worked fine, but I did reproduce the problem with
> OS 9. See the fix I sent.

Yep. I need to get one of these installers then.

Thanks, 

C.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-09 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 10:16 +0200, Cédric Le Goater wrote:
> The login prompt is reached with a full Darwin disk image. 
> 
> So I must be missing a scenario :/

Yes same here, Darwin worked fine, but I did reproduce the problem with
OS 9. See the fix I sent.

Cheers,
Ben.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-09 Thread Cédric Le Goater
On 07/09/2016 02:43 AM, Mark Cave-Ayland wrote:
> On 01/07/16 07:41, David Gibson wrote:
> 
>> From: Benjamin Herrenschmidt 
>>
>> The architecture specifies that any instruction that sets MSR:PR will also
>> set MSR:EE, IR and DR.
>>
>> Signed-off-by: Benjamin Herrenschmidt 
>> Signed-off-by: Cédric Le Goater 
>> Signed-off-by: David Gibson 
>> ---
>>  target-ppc/helper_regs.h | 4 
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
>> index 8fc0934..8fdfa5c 100644
>> --- a/target-ppc/helper_regs.h
>> +++ b/target-ppc/helper_regs.h
>> @@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState *env, 
>> target_ulong value,
>>  /* Change the exception prefix on PowerPC 601 */
>>  env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF0;
>>  }
>> +/* If PR=1 then EE, IR and DR must be 1 */
>> +if ((value >> MSR_PR) & 1) {
>> +value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR);
>> +}
>>  #endif
>>  env->msr = value;
>>  hreg_compute_hflags(env);
>>
> 
> Unfortunately this patch causes a regression and breaks booting OS 9 and
> OS X under qemu-system-ppc.

Ah This is curious. 


I used :

qemu-system-ppc -M g3beige -cdrom darwinppc-602.cdr -boot d 
qemu-system-ppc -M mac99 -cdrom darwinppc-602.cdr -boot d 
qemu-system-ppc64 -M g3beige -cdrom darwinppc-602.cdr -boot d

which "work" as they reach the installation prompt :

The following devices are available for installation.

This one hangs :

qemu-system-ppc64 -M mac99 -cdrom darwinppc-602.cdr -boot d 

But that is expected for a 970 cpu.

The login prompt is reached with a full Darwin disk image. 

So I must be missing a scenario :/

Thanks,

C.


> 
> ATB,
> 
> Mark.
> 




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 13:00 +1000, Benjamin Herrenschmidt wrote:
> > Additionally, hreg_compute_mem_idx() will treat PR=1 as DR=1/IR=1
> > as well ! That means that if those old processors allow PR=1 and IR
> > or DR=0 and MacOS uses it, we do have a TLB coherency problem in
> > qemu.
> 
> Wow, yes indeed, I see an MSR with PR=1 IR=0, IR=1 and EE=0 .. ugh.

Note that I see that happening with OS 9, but not with Darwin ... are
you sure about OS X ?

Cheers,
Ben.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 12:52 +1000, Benjamin Herrenschmidt wrote:
> 
> Additionally, hreg_compute_mem_idx() will treat PR=1 as DR=1/IR=1
> as well ! That means that if those old processors allow PR=1 and IR
> or DR=0 and MacOS uses it, we do have a TLB coherency problem in
> qemu.

Wow, yes indeed, I see an MSR with PR=1 IR=0, IR=1 and EE=0 .. ugh.

Cheers,
Ben.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 12:46 +1000, Benjamin Herrenschmidt wrote:
> On Sat, 2016-07-09 at 01:43 +0100, Mark Cave-Ayland wrote:
> > On 01/07/16 07:41, David Gibson wrote:
> > 
> > > From: Benjamin Herrenschmidt 
> > > 
> > > The architecture specifies that any instruction that sets MSR:PR
> > > will also
> > > set MSR:EE, IR and DR.
> 
>  .../...
> 
> > Unfortunately this patch causes a regression and breaks booting OS
> > 9 and
> > OS X under qemu-system-ppc.
> 
> Any idea what is breaking specifically ? The architecture is pretty
> clear
> here, could it be that they rely on old implementations allowing the
> incorrect combination ?
> 
> Maybe we can make the restriction 64-bit server only...

Additionally, hreg_compute_mem_idx() will treat PR=1 as DR=1/IR=1
as well ! That means that if those old processors allow PR=1 and IR or
DR=0 and MacOS uses it, we do have a TLB coherency problem in qemu.

Cheers,
Ben.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 01:43 +0100, Mark Cave-Ayland wrote:
> On 01/07/16 07:41, David Gibson wrote:
> 
> > From: Benjamin Herrenschmidt 
> > 
> > The architecture specifies that any instruction that sets MSR:PR will also
> > set MSR:EE, IR and DR.

 .../...

> Unfortunately this patch causes a regression and breaks booting OS 9 and
> OS X under qemu-system-ppc.

Any idea what is breaking specifically ? The architecture is pretty clear
here, could it be that they rely on old implementations allowing the
incorrect combination ?

Maybe we can make the restriction 64-bit server only...

Cheers,
Ben.




Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Mark Cave-Ayland
On 01/07/16 07:41, David Gibson wrote:

> From: Benjamin Herrenschmidt 
> 
> The architecture specifies that any instruction that sets MSR:PR will also
> set MSR:EE, IR and DR.
> 
> Signed-off-by: Benjamin Herrenschmidt 
> Signed-off-by: Cédric Le Goater 
> Signed-off-by: David Gibson 
> ---
>  target-ppc/helper_regs.h | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
> index 8fc0934..8fdfa5c 100644
> --- a/target-ppc/helper_regs.h
> +++ b/target-ppc/helper_regs.h
> @@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState *env, 
> target_ulong value,
>  /* Change the exception prefix on PowerPC 601 */
>  env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF0;
>  }
> +/* If PR=1 then EE, IR and DR must be 1 */
> +if ((value >> MSR_PR) & 1) {
> +value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR);
> +}
>  #endif
>  env->msr = value;
>  hreg_compute_hflags(env);
> 

Unfortunately this patch causes a regression and breaks booting OS 9 and
OS X under qemu-system-ppc.


ATB,

Mark.