[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 04/54] target/arm: remove run time semihostin
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v4 04/54] target/arm: remove run time semihosting checks |
Date: |
Thu, 1 Aug 2019 07:53:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 7/31/19 9:06 AM, Alex Bennée wrote:
> -static inline bool check_for_semihosting(CPUState *cs)
> +/*
> + * Do semihosting call and set the appropriate return value. All the
> + * permission and validity checks have been done at translate time.
> + *
> + * We only see semihosting exceptions in TCG only as they are not
> + * trapped to the hypervisor in KVM.
> + */
> +static void handle_semihosting(CPUState *cs)
> {
> #ifdef CONFIG_TCG
Let's move the ifdef outside the function...
> - if (check_for_semihosting(cs)) {
> + if (cs->exception_index == EXCP_SEMIHOST) {
> + handle_semihosting(cs);
> return;
> }
... and put another one here.
Peter described how we can't get EXCP_SEMIHOST here from kvm, and suggested an
assert. Well, the assert is already present just below:
assert(!excp_is_internal(cs->exception_index));
All we need to do is not return early beforehand.
r~