From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH for-4.1 v2 32/36] cpu: Move icount_decr to CPUNegativeOffsetState
Date: Mon, 29 Apr 2019 15:48:35 +0100 [thread overview]
Message-ID: <CAFEAcA-uRsaN7zPSWO5Ga8UnYHEbF5MdEKmnbt07N9nDoOXZ8A@mail.gmail.com> (raw)
In-Reply-To: <20190328230404.12909-33-richard.henderson@linaro.org>
On Thu, 28 Mar 2019 at 23:28, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Amusingly, we had already ignored the comment to keep this value at the
> end of CPUState. This restores the minimum negative offset from TCG_AREG0
> for code generation.
>
> For the couple of uses within qom/cpu.c, add a pointer from the CPUState
> object to the IcountDecr object within CPUNegativeOffsetState.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index 45ef41ebb2..032a62672e 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -54,7 +54,7 @@ typedef struct SyncClocks {
> #define MAX_DELAY_PRINT_RATE 2000000000LL
> #define MAX_NB_PRINTS 100
>
> -static void align_clocks(SyncClocks *sc, const CPUState *cpu)
> +static void align_clocks(SyncClocks *sc, CPUState *cpu)
> {
> int64_t cpu_icount;
>
> @@ -62,7 +62,7 @@ static void align_clocks(SyncClocks *sc, const CPUState *cpu)
> return;
> }
>
> - cpu_icount = cpu->icount_extra + cpu->icount_decr.u16.low;
> + cpu_icount = cpu->icount_extra + cpu_neg(cpu)->icount_decr.u16.low;
> sc->diff_clk += cpu_icount_to_ns(sc->last_cpu_icount - cpu_icount);
> sc->last_cpu_icount = cpu_icount;
Why does this require that we remove the 'const' from the cpu
argument to the function ?
> @@ -1404,7 +1405,7 @@ static void process_icount_data(CPUState *cpu)
> cpu_update_icount(cpu);
>
> /* Reset the counters */
> - cpu->icount_decr.u16.low = 0;
> + cpu_neg(cpu)->icount_decr.u16.low = 0;
> cpu->icount_extra = 0;
> cpu->icount_budget = 0;
>
> int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
> @@ -265,7 +265,7 @@ static void cpu_common_reset(CPUState *cpu)
> cpu->mem_io_pc = 0;
> cpu->mem_io_vaddr = 0;
> cpu->icount_extra = 0;
> - atomic_set(&cpu->icount_decr.u32, 0);
> + atomic_set(&cpu->icount_decr_ptr->u32, 0);
> cpu->can_do_io = 1;
> cpu->exception_index = -1;
> cpu->crash_occurred = false;
What determines when we need to access the icount fields
via icount_decr_ptr versus when we can just directly
access icount_decr ?
thanks
-- PMM
next prev parent reply other threads:[~2019-04-29 14:49 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190328230404.12909-1-richard.henderson@linaro.org>
[not found] ` <20190328230404.12909-2-richard.henderson@linaro.org>
2019-04-02 7:31 ` [Qemu-devel] [PATCH for-4.1 v2 01/36] tcg: Fold CPUTLBWindow into CPUTLBDesc Alex Bennée
[not found] ` <20190328230404.12909-3-richard.henderson@linaro.org>
2019-04-29 13:31 ` [Qemu-devel] [PATCH for-4.1 v2 02/36] tcg: Split out target/arch/cpu-param.h Peter Maydell
2019-04-29 13:31 ` Peter Maydell
[not found] ` <20190328230404.12909-4-richard.henderson@linaro.org>
2019-04-29 13:40 ` [Qemu-devel] [PATCH for-4.1 v2 03/36] tcg: Create struct CPUTLB Peter Maydell
2019-04-29 13:40 ` Peter Maydell
[not found] ` <20190328230404.12909-5-richard.henderson@linaro.org>
2019-04-29 13:41 ` [Qemu-devel] [PATCH for-4.1 v2 04/36] cpu: Define CPUArchState with typedef Peter Maydell
2019-04-29 13:41 ` Peter Maydell
[not found] ` <20190328230404.12909-6-richard.henderson@linaro.org>
2019-04-29 13:42 ` [Qemu-devel] [PATCH for-4.1 v2 05/36] cpu: Define ArchCPU Peter Maydell
2019-04-29 13:42 ` Peter Maydell
[not found] ` <20190328230404.12909-7-richard.henderson@linaro.org>
2019-04-29 13:45 ` [Qemu-devel] [PATCH for-4.1 v2 06/36] cpu: Replace ENV_GET_CPU with env_cpu Peter Maydell
2019-04-29 13:45 ` Peter Maydell
[not found] ` <20190328230404.12909-8-richard.henderson@linaro.org>
2019-04-29 13:46 ` [Qemu-devel] [PATCH for-4.1 v2 07/36] cpu: Introduce env_archcpu Peter Maydell
2019-04-29 13:46 ` Peter Maydell
[not found] ` <20190328230404.12909-9-richard.henderson@linaro.org>
2019-04-29 14:03 ` [Qemu-devel] [PATCH for-4.1 v2 08/36] target/alpha: Use env_cpu, env_archcpu Peter Maydell
2019-04-29 14:03 ` Peter Maydell
[not found] ` <20190328230404.12909-10-richard.henderson@linaro.org>
2019-04-29 14:06 ` [Qemu-devel] [PATCH for-4.1 v2 09/36] target/arm: " Peter Maydell
2019-04-29 14:06 ` Peter Maydell
[not found] ` <20190328230404.12909-11-richard.henderson@linaro.org>
2019-04-29 14:09 ` [Qemu-devel] [PATCH for-4.1 v2 10/36] target/cris: " Peter Maydell
2019-04-29 14:09 ` Peter Maydell
[not found] ` <20190328230404.12909-12-richard.henderson@linaro.org>
2019-04-29 14:10 ` [Qemu-devel] [PATCH for-4.1 v2 11/36] target/hppa: " Peter Maydell
2019-04-29 14:10 ` Peter Maydell
[not found] ` <20190328230404.12909-17-richard.henderson@linaro.org>
2019-04-29 14:12 ` [Qemu-devel] [PATCH for-4.1 v2 16/36] target/mips: " Philippe Mathieu-Daudé
2019-04-29 14:12 ` Philippe Mathieu-Daudé
[not found] ` <20190328230404.12909-13-richard.henderson@linaro.org>
2019-04-29 14:13 ` [Qemu-devel] [PATCH for-4.1 v2 12/36] target/i386: " Peter Maydell
2019-04-29 14:13 ` Peter Maydell
[not found] ` <20190328230404.12909-14-richard.henderson@linaro.org>
2019-04-29 14:13 ` [Qemu-devel] [PATCH for-4.1 v2 13/36] target/lm32: " Peter Maydell
2019-04-29 14:13 ` Peter Maydell
[not found] ` <20190328230404.12909-15-richard.henderson@linaro.org>
2019-04-29 14:14 ` [Qemu-devel] [PATCH for-4.1 v2 14/36] target/m68k: " Peter Maydell
2019-04-29 14:14 ` Peter Maydell
[not found] ` <20190328230404.12909-16-richard.henderson@linaro.org>
2019-04-29 14:15 ` [Qemu-devel] [PATCH for-4.1 v2 15/36] target/microblaze: " Peter Maydell
2019-04-29 14:15 ` Peter Maydell
[not found] ` <20190328230404.12909-18-richard.henderson@linaro.org>
2019-04-29 14:16 ` [Qemu-devel] [PATCH for-4.1 v2 17/36] target/moxie: " Peter Maydell
2019-04-29 14:16 ` Peter Maydell
[not found] ` <20190328230404.12909-19-richard.henderson@linaro.org>
2019-04-29 14:17 ` [Qemu-devel] [PATCH for-4.1 v2 18/36] target/nios2: " Peter Maydell
2019-04-29 14:17 ` Peter Maydell
[not found] ` <20190328230404.12909-24-richard.henderson@linaro.org>
2019-04-29 14:17 ` [Qemu-devel] [PATCH for-4.1 v2 23/36] target/sh4: " Philippe Mathieu-Daudé
2019-04-29 14:17 ` Philippe Mathieu-Daudé
[not found] ` <20190328230404.12909-20-richard.henderson@linaro.org>
2019-04-29 14:17 ` [Qemu-devel] [PATCH for-4.1 v2 19/36] target/openrisc: " Peter Maydell
2019-04-29 14:17 ` Peter Maydell
[not found] ` <20190328230404.12909-21-richard.henderson@linaro.org>
2019-04-29 14:18 ` [Qemu-devel] [PATCH for-4.1 v2 20/36] target/ppc: " Peter Maydell
2019-04-29 14:18 ` Peter Maydell
[not found] ` <20190328230404.12909-25-richard.henderson@linaro.org>
2019-04-29 14:19 ` [Qemu-devel] [PATCH for-4.1 v2 24/36] target/sparc: " Philippe Mathieu-Daudé
2019-04-29 14:19 ` Philippe Mathieu-Daudé
[not found] ` <20190328230404.12909-23-richard.henderson@linaro.org>
2019-04-29 14:21 ` [Qemu-devel] [PATCH for-4.1 v2 22/36] target/s390x: " Peter Maydell
2019-04-29 14:21 ` Peter Maydell
[not found] ` <20190328230404.12909-26-richard.henderson@linaro.org>
2019-04-29 14:24 ` [Qemu-devel] [PATCH for-4.1 v2 25/36] target/tilegx: Use env_cpu Peter Maydell
2019-04-29 14:24 ` Peter Maydell
[not found] ` <20190328230404.12909-27-richard.henderson@linaro.org>
2019-04-29 14:24 ` [Qemu-devel] [PATCH for-4.1 v2 26/36] target/tricore: " Peter Maydell
2019-04-29 14:24 ` Peter Maydell
[not found] ` <20190328230404.12909-28-richard.henderson@linaro.org>
2019-04-29 14:26 ` [Qemu-devel] [PATCH for-4.1 v2 27/36] target/unicore32: Use env_cpu, env_archcpu Peter Maydell
2019-04-29 14:26 ` Peter Maydell
[not found] ` <20190328230404.12909-29-richard.henderson@linaro.org>
2019-04-29 14:36 ` [Qemu-devel] [PATCH for-4.1 v2 28/36] target/xtensa: " Peter Maydell
2019-04-29 14:36 ` Peter Maydell
2019-04-29 15:20 ` Richard Henderson
2019-04-29 15:20 ` Richard Henderson
2019-04-29 15:29 ` Peter Maydell
2019-04-29 15:29 ` Peter Maydell
[not found] ` <20190328230404.12909-30-richard.henderson@linaro.org>
2019-04-29 14:37 ` [Qemu-devel] [PATCH for-4.1 v2 29/36] cpu: Move ENV_OFFSET to exec/gen-icount.h Peter Maydell
2019-04-29 14:37 ` Peter Maydell
[not found] ` <20190328230404.12909-31-richard.henderson@linaro.org>
2019-04-29 14:40 ` [Qemu-devel] [PATCH for-4.1 v2 30/36] cpu: Introduce cpu_set_cpustate_pointers Peter Maydell
2019-04-29 14:40 ` Peter Maydell
2019-05-07 5:03 ` Richard Henderson
[not found] ` <20190328230404.12909-32-richard.henderson@linaro.org>
2019-04-29 14:43 ` [Qemu-devel] [PATCH for-4.1 v2 31/36] cpu: Introduce CPUNegativeOffsetState Peter Maydell
2019-04-29 14:43 ` Peter Maydell
2019-04-29 15:23 ` Richard Henderson
2019-04-29 15:23 ` Richard Henderson
[not found] ` <20190328230404.12909-33-richard.henderson@linaro.org>
2019-04-29 14:48 ` Peter Maydell [this message]
2019-04-29 14:48 ` [Qemu-devel] [PATCH for-4.1 v2 32/36] cpu: Move icount_decr to CPUNegativeOffsetState Peter Maydell
2019-04-29 15:32 ` Richard Henderson
2019-04-29 15:32 ` Richard Henderson
[not found] ` <20190328230404.12909-35-richard.henderson@linaro.org>
2019-04-29 14:51 ` [Qemu-devel] [PATCH for-4.1 v2 34/36] cpu: Remove CPU_COMMON Peter Maydell
2019-04-29 14:51 ` Peter Maydell
[not found] ` <20190328230404.12909-36-richard.henderson@linaro.org>
2019-04-29 14:55 ` [Qemu-devel] [PATCH for-4.1 v2 35/36] tcg/aarch64: Use LDP to load tlb mask+table Peter Maydell
2019-04-29 14:55 ` Peter Maydell
[not found] ` <20190328230404.12909-37-richard.henderson@linaro.org>
2019-04-29 15:00 ` [Qemu-devel] [PATCH for-4.1 v2 36/36] tcg/arm: Use LDRD " Peter Maydell
2019-04-29 15:00 ` Peter Maydell
2019-04-29 15:42 ` Richard Henderson
2019-04-29 15:42 ` Richard Henderson
[not found] ` <20190328230404.12909-34-richard.henderson@linaro.org>
2019-04-29 15:08 ` [Qemu-devel] [PATCH for-4.1 v2 33/36] cpu: Move the softmmu tlb to CPUNegativeOffsetState Peter Maydell
2019-04-29 15:08 ` Peter Maydell
[not found] ` <155381739615.24.12240723664123883584@76452e4e88f2>
2019-04-29 15:12 ` [Qemu-devel] [PATCH for-4.1 v2 00/36] tcg: " Peter Maydell
2019-04-29 15:12 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA-uRsaN7zPSWO5Ga8UnYHEbF5MdEKmnbt07N9nDoOXZ8A@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).