qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/4] mips_malta: Catch kernels linked at wrong a


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH 4/4] mips_malta: Catch kernels linked at wrong address
Date: Fri, 27 Jun 2014 10:43:56 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jun 26, 2014 at 10:44:25AM +0100, James Hogan wrote:
> Add error reporting if the wrong type of kernel is provided for the
> current mode of acceleration.
> 
> Currently a KVM kernel linked at 0x40000000 can't be used with TCG, and
> a normal kernel linked at 0x80000000 can't be used with KVM.
> 
> Signed-off-by: James Hogan <address@hidden>
> Cc: Aurelien Jarno <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> ---
>  hw/mips/mips_malta.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 76cf5f2c48f4..95df42e6a4d5 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -792,9 +792,23 @@ static int64_t load_kernel (void)
>                  loaderparams.kernel_filename);
>          exit(1);
>      }
> +
> +    /* Sanity check where the kernel has been linked */
>      if (kvm_enabled()) {
> +        if (kernel_entry & 0x80000000ll) {
> +            error_report("KVM guest kernels must be linked in useg. "
> +                         "Did you forget to enable CONFIG_KVM_GUEST?");
> +            exit(1);
> +        }
> +
>          xlate_to_kseg0 = cpu_mips_kvm_um_phys_to_kseg0;
>      } else {
> +        if (!(kernel_entry & 0x80000000ll)) {
> +            error_report("KVM guest kernels aren't supported with TCG. "
> +                         "Did you unintentionally enable CONFIG_KVM_GUEST?");
> +            exit(1);
> +        }
> +
>          xlate_to_kseg0 = cpu_mips_phys_to_kseg0;
>      }

Reviewed-by: Aurelien Jarno <address@hidden>
 

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]