qemu: add NO_RNG quirk

Message ID 20181102072644.28286-1-clg@kaod.org
State New
Headers show
Series
  • qemu: add NO_RNG quirk
Related show

Checks

Context Check Description
snowpatch_ozlabs/make_check success Test make_check on branch master
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Cédric Le Goater Nov. 2, 2018, 7:26 a.m.
QEMU does not emulate a NX chip yet.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---

 This is the only patch needed to boot a QEMU PowerNV POWER9 machine
 using the Witherspoon OpenPOWER kernel and rootfs files.

 QEMU tree is available here :
 
   https://github.com/legoater/qemu/tree/powernv-3.1

 core/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Benjamin Herrenschmidt Nov. 3, 2018, 12:29 a.m. | #1
On Fri, 2018-11-02 at 08:26 +0100, Cédric Le Goater wrote:
> QEMU does not emulate a NX chip yet.

What about instead we check for NX in the DT ?

I'm about to implement the RNG in qemu :-)

> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> 
>  This is the only patch needed to boot a QEMU PowerNV POWER9 machine
>  using the Witherspoon OpenPOWER kernel and rootfs files.
> 
>  QEMU tree is available here :
>  
>    https://github.com/legoater/qemu/tree/powernv-3.1
> 
>  core/chip.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/chip.c b/core/chip.c
> index 65263253424d..48df1f052936 100644
> --- a/core/chip.c
> +++ b/core/chip.c
> @@ -146,7 +146,7 @@ void init_chips(void)
>  	/* Detect Qemu */
>  	if (dt_node_is_compatible(dt_root, "qemu,powernv")) {
>  		proc_chip_quirks |= QUIRK_NO_CHIPTOD | QUIRK_NO_PBA
> -			| QUIRK_NO_DIRECT_CTL;
> +			| QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
>  		prlog(PR_NOTICE, "CHIP: Detected Qemu simulator\n");
>  	}
>
Cédric Le Goater Nov. 3, 2018, 5:05 p.m. | #2
On 11/3/18 1:29 AM, Benjamin Herrenschmidt wrote:
> On Fri, 2018-11-02 at 08:26 +0100, Cédric Le Goater wrote:
>> QEMU does not emulate a NX chip yet.
> 
> What about instead we check for NX in the DT ?

As I understand it, init_chips() defines a set of features the 
platform can not use. It seems cleaner to use than testing for 
the platforms under each driver.    
 
> I'm about to implement the RNG in qemu :-)

Even better :) 

What other chiplets would be interesting to work on ? 

 - PHB4 of course
 - Aspeed MBOX support 
 - CAPP ? 

Cheers,

C. 

> 
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>>
>>  This is the only patch needed to boot a QEMU PowerNV POWER9 machine
>>  using the Witherspoon OpenPOWER kernel and rootfs files.
>>
>>  QEMU tree is available here :
>>  
>>    https://github.com/legoater/qemu/tree/powernv-3.1
>>
>>  core/chip.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/core/chip.c b/core/chip.c
>> index 65263253424d..48df1f052936 100644
>> --- a/core/chip.c
>> +++ b/core/chip.c
>> @@ -146,7 +146,7 @@ void init_chips(void)
>>  	/* Detect Qemu */
>>  	if (dt_node_is_compatible(dt_root, "qemu,powernv")) {
>>  		proc_chip_quirks |= QUIRK_NO_CHIPTOD | QUIRK_NO_PBA
>> -			| QUIRK_NO_DIRECT_CTL;
>> +			| QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
>>  		prlog(PR_NOTICE, "CHIP: Detected Qemu simulator\n");
>>  	}
>>  
>

Patch

diff --git a/core/chip.c b/core/chip.c
index 65263253424d..48df1f052936 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -146,7 +146,7 @@  void init_chips(void)
 	/* Detect Qemu */
 	if (dt_node_is_compatible(dt_root, "qemu,powernv")) {
 		proc_chip_quirks |= QUIRK_NO_CHIPTOD | QUIRK_NO_PBA
-			| QUIRK_NO_DIRECT_CTL;
+			| QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
 		prlog(PR_NOTICE, "CHIP: Detected Qemu simulator\n");
 	}