[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC for-2.13 02/12] target/ppc: Simplify cpu valid check
From: |
Thomas Huth |
Subject: |
Re: [Qemu-ppc] [RFC for-2.13 02/12] target/ppc: Simplify cpu valid check in ppc_cpu_realize |
Date: |
Tue, 27 Mar 2018 08:36:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 27.03.2018 06:37, David Gibson wrote:
> The #if isn't necessary, because there's a suitable one inside
> ppc_cpu_is_valid(). We've already filtered for suitable cpu models in the
> functions that search and register them. So by the time we get to realize
> having an invalid one indicates a code error, not a user error, so an
> assert() is more appropriate than error_setg().
>
> Signed-off-by: David Gibson <address@hidden>
> ---
> target/ppc/translate_init.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
> index 56b80a204a..2ae718242a 100644
> --- a/target/ppc/translate_init.c
> +++ b/target/ppc/translate_init.c
> @@ -9749,14 +9749,7 @@ static void ppc_cpu_realize(DeviceState *dev, Error
> **errp)
> }
> }
>
> -#if defined(TARGET_PPCEMB)
> - if (!ppc_cpu_is_valid(pcc)) {
> - error_setg(errp, "CPU does not possess a BookE or 4xx MMU. "
> - "Please use qemu-system-ppc or qemu-system-ppc64 instead "
> - "or choose another CPU model.");
> - goto unrealize;
> - }
> -#endif
> + assert(ppc_cpu_is_valid(pcc));
>
> create_ppc_opcodes(cpu, &local_err);
> if (local_err != NULL) {
>
Reviewed-by: Thomas Huth <address@hidden>
- [Qemu-ppc] [RFC for-2.13 00/12] target/ppc: Assorted cpu cleanups (esp. hash64 MMU), David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 02/12] target/ppc: Simplify cpu valid check in ppc_cpu_realize, David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 01/12] target/ppc: Standardize instance_init and realize function names, David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 03/12] target/ppc: Pass cpu instead of env to ppc_create_page_sizes_prop(), David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 04/12] target/ppc: Avoid taking "env" parameter to mmu-hash64 functions, David Gibson, 2018/03/27
- [Qemu-ppc] [RFC for-2.13 05/12] target/ppc: Remove fallback 64k pagesize information, David Gibson, 2018/03/27