diff mbox

[kvm-unit-tests,v2,2/3] arm/run: ensure we use processor=host for kvm

Message ID 20170518160208.9674-3-alex.bennee@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Bennée May 18, 2017, 4:02 p.m. UTC
The configure script will happily default to cortex-a15 even when
running on a cortex-a7. This runs into problems when running KVM on
common dev boards as we should be using the "host" processor.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 arm/run | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paolo Bonzini May 18, 2017, 4:03 p.m. UTC | #1
On 18/05/2017 18:02, Alex Bennée wrote:
> The configure script will happily default to cortex-a15 even when
> running on a cortex-a7. This runs into problems when running KVM on
> common dev boards as we should be using the "host" processor.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

x86 can use different "-cpu" parameters for each test.  Would that make
sense for ARM?  Can the tests run successfully with cortex-a7 on an A15?

Thanks,

Paolo

> ---
>  arm/run | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arm/run b/arm/run
> index 700205b..f73593b 100755
> --- a/arm/run
> +++ b/arm/run
> @@ -44,9 +44,9 @@ if [ "$ACCEL" = "kvm" ]; then
>  	if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then
>  		M+=',gic-version=host'
>  	fi
> -	if [ "$HOST" = "aarch64" ]; then
> +	if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then
>  		processor="host"
> -		if [ "$ARCH" = "arm" ]; then
> +		if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
>  			processor+=",aarch64=off"
>  		fi
>  	fi
>
Christoffer Dall May 19, 2017, 6:29 a.m. UTC | #2
On Thu, May 18, 2017 at 6:03 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 18/05/2017 18:02, Alex Bennée wrote:
>> The configure script will happily default to cortex-a15 even when
>> running on a cortex-a7. This runs into problems when running KVM on
>> common dev boards as we should be using the "host" processor.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
> x86 can use different "-cpu" parameters for each test.  Would that make
> sense for ARM?  Can the tests run successfully with cortex-a7 on an A15?
>

For now, we only support same-guest-as-host-cpu configurations with
KVM.  In the future we may add the cross CPU-type support for KVM, and
I suppose we can do this with TCG already.

I would suggest merging this now though, to get kvm-unit-tests working
on the platforms we have available and then add the more complicated
tests when there's an actual need, but it's obviously up to you.

Thanks,
-Christoffer
Paolo Bonzini May 19, 2017, 8:11 a.m. UTC | #3
On 19/05/2017 08:29, Christoffer Dall wrote:
> On Thu, May 18, 2017 at 6:03 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 18/05/2017 18:02, Alex Bennée wrote:
>>> The configure script will happily default to cortex-a15 even when
>>> running on a cortex-a7. This runs into problems when running KVM on
>>> common dev boards as we should be using the "host" processor.
>>>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>
>> x86 can use different "-cpu" parameters for each test.  Would that make
>> sense for ARM?  Can the tests run successfully with cortex-a7 on an A15?
>>
> 
> For now, we only support same-guest-as-host-cpu configurations with
> KVM.  In the future we may add the cross CPU-type support for KVM, and
> I suppose we can do this with TCG already.
> 
> I would suggest merging this now though, to get kvm-unit-tests working
> on the platforms we have available and then add the more complicated
> tests when there's an actual need, but it's obviously up to you.

Sure - it was just for my own education. :)

Paolo
Andrew Jones May 22, 2017, 5:25 p.m. UTC | #4
On Thu, May 18, 2017 at 05:02:07PM +0100, Alex Bennée wrote:
> The configure script will happily default to cortex-a15 even when
> running on a cortex-a7. This runs into problems when running KVM on
> common dev boards as we should be using the "host" processor.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  arm/run | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arm/run b/arm/run
> index 700205b..f73593b 100755
> --- a/arm/run
> +++ b/arm/run
> @@ -44,9 +44,9 @@ if [ "$ACCEL" = "kvm" ]; then
>  	if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then
>  		M+=',gic-version=host'
>  	fi
> -	if [ "$HOST" = "aarch64" ]; then
> +	if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then
>  		processor="host"
> -		if [ "$ARCH" = "arm" ]; then
> +		if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
>  			processor+=",aarch64=off"
>  		fi
>  	fi
> -- 
> 2.13.0
>
 
Reviewed-by: Andrew Jones <drjones@redhat.com>
diff mbox

Patch

diff --git a/arm/run b/arm/run
index 700205b..f73593b 100755
--- a/arm/run
+++ b/arm/run
@@ -44,9 +44,9 @@  if [ "$ACCEL" = "kvm" ]; then
 	if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then
 		M+=',gic-version=host'
 	fi
-	if [ "$HOST" = "aarch64" ]; then
+	if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then
 		processor="host"
-		if [ "$ARCH" = "arm" ]; then
+		if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
 			processor+=",aarch64=off"
 		fi
 	fi