All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC 0/4] Enable MTTCG on PowerPC
@ 2016-09-02 14:27 Programmingkid
  2016-09-03 16:29 ` Nikunj A Dadhania
  0 siblings, 1 reply; 4+ messages in thread
From: Programmingkid @ 2016-09-02 14:27 UTC (permalink / raw)
  To: Nikunj A Dadhania, list@suse.de:PowerPC list:PowerPC,
	Alex Bennée, David Gibson, rth, qemu-devel qemu-devel

> On 09/02/2016 08:32 AM, Nikunj A Dadhania wrote:
>> The series is a first attempt at enabling Multi-Threaded TCG on PowerPC.
>> Changes that were needed to enable PowerPC are pretty simple;
>> 
>> Patch 01: Take a iothread lock during hcall, as hcall can generate io requests
>>      02: For TCG, we were harcoding smt as 1, this gets rid of the limitation
>>      03: Use atomic_cmpxchg in store conditional
>>      04: With more threads, flush the entry from each cpu. 
>> 	  This can be optimized further.
>> 
>> The patches are based on the Alex Bennee's base enabling patches for 
>> MTTCG[1] and Emilios's cmpxchg atomics. The consolidated tree of the 
>> above patches is here:
>> 
>> https://github.com/stsquad/qemu/tree/mttcg/base-patches-v4-with-cmpxchg-atomics-v2
>> 
>> Apart from the above, PPC patches are based out of ppc-for-2.8 and 
>> load/store consolidation patches [2]
>> 
>> Series with all dependent patches available here: 
>> https://github.com/nikunjad/qemu/tree/ppc_mttcg_v1
>> 
>> Testing: 
>> ========
>> 
>> -smp 4,cores=1,threads=4 -accel tcg,thread=multi
>> 
>> TODO
>> ====
>> Implement msgsndp instructions(door-bell), newer kernels enable it 
>> depending on the PVR. I have been using following workaround to boot.
>> https://github.com/nikunjad/qemu/commit/2c10052c5f93418a6b920e6ba3ce1813fcf50bc4
> 
> You could also introduce a Power8 DD1 in qemu. From the kernel cputable :
> 
> 	{	/* Power8 DD1: Does not support doorbell IPIs */
> 		.pvr_mask		= 0xffffff00,
> 		.pvr_value		= 0x004d0100,
> 		.cpu_name		= "POWER8 (raw)",
> 		.cpu_features		= CPU_FTRS_POWER8_DD1,
> 		...
> 
> Cheers,
> C.

What I did:

git clone https://github.com/nikunjad/qemu/tree/ppc_mttcg_v1

git checkout ppc_mttcg_v1

./configure --target-list=ppc-softmmu,i386-softmmu --cxx=gcc-4.9 --cc=gcc-4.9 --objcc=gcc-4.9 --disable-gtk --disable-sdl && make

After these steps I tried to test Windows XP and Windows 2000 using this command line:
./i386-softmmu/qemu-system-i386 -name 'Windows XP' -hda 'Windows XP Hard Drive.img' -boot c -smp 4,cores=1,threads=4 -accel tcg,thread=multi

This causes QEMU to crash. The cause is an abort trap. This is what I captured:

Thread 7 Crashed:
0   libSystem.B.dylib             	0x00007fff825559ce __semwait_signal_nocancel + 10
1   libSystem.B.dylib             	0x00007fff825558d0 nanosleep$NOCANCEL + 129
2   libSystem.B.dylib             	0x00007fff825b23ce usleep$NOCANCEL + 57
3   libSystem.B.dylib             	0x00007fff825d1a00 abort + 93
4   qemu-system-i386              	0x0000000100036c65 qemu_tcg_cpu_thread_fn + 325 (cpus.c:1384)
5   libSystem.B.dylib             	0x00007fff8251bfd6 _pthread_start + 331
6   libSystem.B.dylib             	0x00007fff8251be89 thread_start + 13

Trying Windows 2000 also causes the same crash.

I then tried Mac OS 10.4. The command line was:
./ppc-softmmu/qemu-system-ppc -smp 4,cores=1,threads=4 -M mac99 -m 512 -hda 'Mac OS 10.4.0.qcow2' -boot c -prom-env boot-args=-v -localtime

The result was this error message:
qemu-system-ppc: Number of SMP CPUs requested (4) exceeds max CPUs supported by machine 'mac99' (1)

I then tried using https://github.com/stsquad/qemu.git. The errors I see is this:

qemu-system-i386: -accel: invalid option

qemu-system-ppc: Number of SMP CPUs requested (4) exceeds max CPUs supported by machine 'mac99' (1)

I used the same command lines as above.

My info:
Host operating system: Mac OS 10.6.8
GCC 4.9

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC 0/4] Enable MTTCG on PowerPC
  2016-09-02 14:27 [Qemu-devel] [Qemu-ppc] [PATCH RFC 0/4] Enable MTTCG on PowerPC Programmingkid
@ 2016-09-03 16:29 ` Nikunj A Dadhania
  2016-09-03 17:11   ` Nikunj A Dadhania
  0 siblings, 1 reply; 4+ messages in thread
From: Nikunj A Dadhania @ 2016-09-03 16:29 UTC (permalink / raw)
  To: Programmingkid, list@suse.de:PowerPC list:PowerPC,
	Alex Bennée, David Gibson, rth, qemu-devel qemu-devel

Programmingkid <programmingkidx@gmail.com> writes:

>> On 09/02/2016 08:32 AM, Nikunj A Dadhania wrote:
>>> The series is a first attempt at enabling Multi-Threaded TCG on PowerPC.
>>> Changes that were needed to enable PowerPC are pretty simple;
>>> 
>>> Patch 01: Take a iothread lock during hcall, as hcall can generate io requests
>>>      02: For TCG, we were harcoding smt as 1, this gets rid of the limitation
>>>      03: Use atomic_cmpxchg in store conditional
>>>      04: With more threads, flush the entry from each cpu. 
>>> 	  This can be optimized further.
>>> 
>>> The patches are based on the Alex Bennee's base enabling patches for 
>>> MTTCG[1] and Emilios's cmpxchg atomics. The consolidated tree of the 
>>> above patches is here:
>>> 
>>> https://github.com/stsquad/qemu/tree/mttcg/base-patches-v4-with-cmpxchg-atomics-v2
>>> 
>>> Apart from the above, PPC patches are based out of ppc-for-2.8 and 
>>> load/store consolidation patches [2]
>>> 
>>> Series with all dependent patches available here: 
>>> https://github.com/nikunjad/qemu/tree/ppc_mttcg_v1
>>> 
>>> Testing: 
>>> ========
>>> 
>>> -smp 4,cores=1,threads=4 -accel tcg,thread=multi
>>> 
>>> TODO
>>> ====
>>> Implement msgsndp instructions(door-bell), newer kernels enable it 
>>> depending on the PVR. I have been using following workaround to boot.
>>> https://github.com/nikunjad/qemu/commit/2c10052c5f93418a6b920e6ba3ce1813fcf50bc4
>> 
>> You could also introduce a Power8 DD1 in qemu. From the kernel cputable :
>> 
>> 	{	/* Power8 DD1: Does not support doorbell IPIs */
>> 		.pvr_mask		= 0xffffff00,
>> 		.pvr_value		= 0x004d0100,
>> 		.cpu_name		= "POWER8 (raw)",
>> 		.cpu_features		= CPU_FTRS_POWER8_DD1,
>> 		...
>> 
>> Cheers,
>> C.
>
> What I did:
>
> git clone https://github.com/nikunjad/qemu/tree/ppc_mttcg_v1
>
> git checkout ppc_mttcg_v1
>
> ./configure --target-list=ppc-softmmu,i386-softmmu --cxx=gcc-4.9 --cc=gcc-4.9 --objcc=gcc-4.9 --disable-gtk --disable-sdl && make
>
> After these steps I tried to test Windows XP and Windows 2000 using this command line:
> ./i386-softmmu/qemu-system-i386 -name 'Windows XP' -hda 'Windows XP Hard Drive.img' -boot c -smp 4,cores=1,threads=4 -accel tcg,thread=multi

I haven't enabled x86. Not sure if that is supported in Alex Bennee's
tree either.

>
> This causes QEMU to crash. The cause is an abort trap. This is what I captured:
>
> Thread 7 Crashed:
> 0   libSystem.B.dylib             	0x00007fff825559ce __semwait_signal_nocancel + 10
> 1   libSystem.B.dylib             	0x00007fff825558d0 nanosleep$NOCANCEL + 129
> 2   libSystem.B.dylib             	0x00007fff825b23ce usleep$NOCANCEL + 57
> 3   libSystem.B.dylib             	0x00007fff825d1a00 abort + 93
> 4   qemu-system-i386              	0x0000000100036c65 qemu_tcg_cpu_thread_fn + 325 (cpus.c:1384)
> 5   libSystem.B.dylib             	0x00007fff8251bfd6 _pthread_start + 331
> 6   libSystem.B.dylib             	0x00007fff8251be89 thread_start + 13
>
> Trying Windows 2000 also causes the same crash.
>
> I then tried Mac OS 10.4. The command line was:
> ./ppc-softmmu/qemu-system-ppc -smp 4,cores=1,threads=4 -M mac99 -m 512 -hda 'Mac OS 10.4.0.qcow2' -boot c -prom-env boot-args=-v -localtime

I have tested with ppc64-softmmu. Haven't tried ppc-softmmu yet.

>
> The result was this error message:
> qemu-system-ppc: Number of SMP CPUs requested (4) exceeds max CPUs
> supported by machine 'mac99' (1)

This seems to be similar error which I got when enabling ppc64. 02/04 of
my patch has got over the limitation for ppc64. I guess some patch seems
to be missing for ppc.

I thought that something like this should work:

========================================================================

diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
index 20cbddb..e6522e5 100644
--- a/hw/ppc/mac.h
+++ b/hw/ppc/mac.h
@@ -32,7 +32,7 @@
 #include "hw/input/adb.h"
 
 /* SMP is not enabled, for now */
-#define MAX_CPUS 1
+#define MAX_CPUS 4
 
 #define BIOS_SIZE     (1024 * 1024)
 #define NVRAM_SIZE        0x2000
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 7d25106..13e7d1c 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -515,6 +515,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
 
+    fprintf(stderr, "%s: init %d\n", __func__, MAX_CPUS);
     mc->desc = "Mac99 based PowerMAC";
     mc->init = ppc_core99_init;
     mc->max_cpus = MAX_CPUS;

========================================================================


But I do not see this print at all. core99_machine_class_init() doesnt
get called ? Am I missing something?

Regards
Nikunj

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC 0/4] Enable MTTCG on PowerPC
  2016-09-03 16:29 ` Nikunj A Dadhania
@ 2016-09-03 17:11   ` Nikunj A Dadhania
  2016-09-03 17:13     ` Programmingkid
  0 siblings, 1 reply; 4+ messages in thread
From: Nikunj A Dadhania @ 2016-09-03 17:11 UTC (permalink / raw)
  To: Programmingkid, list@suse.de:PowerPC list:PowerPC,
	Alex Bennée, David Gibson, rth, qemu-devel qemu-devel

Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> writes:

> Programmingkid <programmingkidx@gmail.com> writes:
> The result was this error message:
>> qemu-system-ppc: Number of SMP CPUs requested (4) exceeds max CPUs
>> supported by machine 'mac99' (1)
>
> This seems to be similar error which I got when enabling ppc64. 02/04 of
> my patch has got over the limitation for ppc64. I guess some patch seems
> to be missing for ppc.
>
> I thought that something like this should work:

Working, still some issues though.

>
> ========================================================================
>
> diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
> index 20cbddb..e6522e5 100644
> --- a/hw/ppc/mac.h
> +++ b/hw/ppc/mac.h
> @@ -32,7 +32,7 @@
>  #include "hw/input/adb.h"
>  
>  /* SMP is not enabled, for now */
> -#define MAX_CPUS 1
> +#define MAX_CPUS 4
>  
>  #define BIOS_SIZE     (1024 * 1024)
>  #define NVRAM_SIZE        0x2000
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index 7d25106..13e7d1c 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -515,6 +515,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
>  {
>      MachineClass *mc = MACHINE_CLASS(oc);
>  
> +    fprintf(stderr, "%s: init %d\n", __func__, MAX_CPUS);
>      mc->desc = "Mac99 based PowerMAC";
>      mc->init = ppc_core99_init;
>      mc->max_cpus = MAX_CPUS;
>
> ========================================================================
>
>
> But I do not see this print at all. core99_machine_class_init() doesnt
> get called ? Am I missing something?

Wasnt compiling right target ppc-softmmu :(

Regards
Nikunj

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC 0/4] Enable MTTCG on PowerPC
  2016-09-03 17:11   ` Nikunj A Dadhania
@ 2016-09-03 17:13     ` Programmingkid
  0 siblings, 0 replies; 4+ messages in thread
From: Programmingkid @ 2016-09-03 17:13 UTC (permalink / raw)
  To: Nikunj A Dadhania
  Cc: list@suse.de:PowerPC list:PowerPC, Alex Bennée,
	David Gibson, rth, qemu-devel qemu-devel


On Sep 3, 2016, at 1:11 PM, Nikunj A Dadhania wrote:

> Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> writes:
> 
>> Programmingkid <programmingkidx@gmail.com> writes:
>> The result was this error message:
>>> qemu-system-ppc: Number of SMP CPUs requested (4) exceeds max CPUs
>>> supported by machine 'mac99' (1)
>> 
>> This seems to be similar error which I got when enabling ppc64. 02/04 of
>> my patch has got over the limitation for ppc64. I guess some patch seems
>> to be missing for ppc.
>> 
>> I thought that something like this should work:
> 
> Working, still some issues though.
> 
>> 
>> ========================================================================
>> 
>> diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
>> index 20cbddb..e6522e5 100644
>> --- a/hw/ppc/mac.h
>> +++ b/hw/ppc/mac.h
>> @@ -32,7 +32,7 @@
>> #include "hw/input/adb.h"
>> 
>> /* SMP is not enabled, for now */
>> -#define MAX_CPUS 1
>> +#define MAX_CPUS 4
>> 
>> #define BIOS_SIZE     (1024 * 1024)
>> #define NVRAM_SIZE        0x2000
>> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
>> index 7d25106..13e7d1c 100644
>> --- a/hw/ppc/mac_newworld.c
>> +++ b/hw/ppc/mac_newworld.c
>> @@ -515,6 +515,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
>> {
>>     MachineClass *mc = MACHINE_CLASS(oc);
>> 
>> +    fprintf(stderr, "%s: init %d\n", __func__, MAX_CPUS);
>>     mc->desc = "Mac99 based PowerMAC";
>>     mc->init = ppc_core99_init;
>>     mc->max_cpus = MAX_CPUS;
>> 
>> ========================================================================
>> 
>> 
>> But I do not see this print at all. core99_machine_class_init() doesnt
>> get called ? Am I missing something?
> 
> Wasnt compiling right target ppc-softmmu :(
> 
> Regards
> Nikunj

I have a lot of PowerPC operating systems here. Let me
know when you are ready and I will be glad to test out
your code.

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

end of thread, other threads:[~2016-09-03 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02 14:27 [Qemu-devel] [Qemu-ppc] [PATCH RFC 0/4] Enable MTTCG on PowerPC Programmingkid
2016-09-03 16:29 ` Nikunj A Dadhania
2016-09-03 17:11   ` Nikunj A Dadhania
2016-09-03 17:13     ` Programmingkid

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.