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~