[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/6] Handle CPU interrupts by inline checking of
From: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCH 4/6] Handle CPU interrupts by inline checking of a flag |
Date: |
Wed, 27 Feb 2013 20:22:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Forget it, I misread patch 6; sorry.
Lluis
Lluís Vilanova writes:
> Peter Maydell writes:
> [...]
>> diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h
>> index c858a73..384153b 100644
>> --- a/include/exec/gen-icount.h
>> +++ b/include/exec/gen-icount.h
>> @@ -7,10 +7,19 @@
>> static TCGArg *icount_arg;
>> static int icount_label;
>> +static int exitreq_label;
>> static inline void gen_icount_start(void)
>> {
>> TCGv_i32 count;
>> + TCGv_i32 flag;
>> +
>> + exitreq_label = gen_new_label();
>> + flag = tcg_temp_local_new_i32();
>> + tcg_gen_ld_i32(flag, cpu_env,
>> + offsetof(CPUState, tcg_exit_req) - ENV_OFFSET);
>> + tcg_gen_brcondi_i32(TCG_COND_NE, flag, 0, exitreq_label);
>> + tcg_temp_free_i32(flag);
> It feels weird to me that this code is in 'gen_icount_start' as opposed that
> some other separate function like 'gen_tb_exit_check'.
>> if (!use_icount)
>> return;
>> @@ -29,6 +38,9 @@ static inline void gen_icount_start(void)
>> static void gen_icount_end(TranslationBlock *tb, int num_insns)
>> {
>> + gen_set_label(exitreq_label);
>> + tcg_gen_exit_tb((tcg_target_long)tb + TB_EXIT_REQUESTED);
>> +
> This too feels weird to me.
> Lluis
> --
> "And it's much the same thing with knowledge, for whenever you learn
> something new, the whole world becomes that much richer."
> -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
> Tollbooth
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
- [Qemu-devel] [PATCH 0/6] Drop the irredeemably racy cpu_unlink_tb(), Peter Maydell, 2013/02/22
- [Qemu-devel] [PATCH 6/6] gen-icount.h: Rename gen_icount_start/end to gen_tb_start/end, Peter Maydell, 2013/02/22
- [Qemu-devel] [PATCH 5/6] translate-all.c: Remove cpu_unlink_tb(), Peter Maydell, 2013/02/22
- [Qemu-devel] [PATCH 3/6] cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC, Peter Maydell, 2013/02/22
- [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Peter Maydell, 2013/02/22