qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Emilio G. Cota" <cota@braap.org>
Cc: qemu-devel@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Alexander Graf" <agraf@suse.de>,
	qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v5 63/73] ppc: convert to cpu_has_work_with_iothread_lock
Date: Sat, 15 Dec 2018 20:07:22 +1100	[thread overview]
Message-ID: <20181215090722.GP29278@umbus.fritz.box> (raw)
In-Reply-To: <20181213050453.9677-64-cota@braap.org>

[-- Attachment #1: Type: text/plain, Size: 4399 bytes --]

On Thu, Dec 13, 2018 at 12:04:43AM -0500, Emilio G. Cota wrote:
> Soon we will call cpu_has_work without the BQL.
> 
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: qemu-ppc@nongnu.org
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  target/ppc/translate_init.inc.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
> index 757eb6df16..cf453cb099 100644
> --- a/target/ppc/translate_init.inc.c
> +++ b/target/ppc/translate_init.inc.c
> @@ -8462,6 +8462,8 @@ static bool cpu_has_work_POWER7(CPUState *cs)
>      PowerPCCPU *cpu = POWERPC_CPU(cs);
>      CPUPPCState *env = &cpu->env;
>  
> +    g_assert(qemu_mutex_iothread_locked());
> +
>      if (cpu_halted(cs)) {
>          if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) {
>              return false;
> @@ -8505,7 +8507,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data)
>      pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05;
>      pcc->init_proc = init_proc_POWER7;
>      pcc->check_pow = check_pow_nocheck;
> -    cc->has_work = cpu_has_work_POWER7;
> +    cc->has_work_with_iothread_lock = cpu_has_work_POWER7;
>      pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
>                         PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
>                         PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
> @@ -8616,6 +8618,8 @@ static bool cpu_has_work_POWER8(CPUState *cs)
>      PowerPCCPU *cpu = POWERPC_CPU(cs);
>      CPUPPCState *env = &cpu->env;
>  
> +    g_assert(qemu_mutex_iothread_locked());
> +
>      if (cpu_halted(cs)) {
>          if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) {
>              return false;
> @@ -8667,7 +8671,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
>      pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05;
>      pcc->init_proc = init_proc_POWER8;
>      pcc->check_pow = check_pow_nocheck;
> -    cc->has_work = cpu_has_work_POWER8;
> +    cc->has_work_with_iothread_lock = cpu_has_work_POWER8;
>      pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
>                         PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
>                         PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
> @@ -8808,6 +8812,8 @@ static bool cpu_has_work_POWER9(CPUState *cs)
>      PowerPCCPU *cpu = POWERPC_CPU(cs);
>      CPUPPCState *env = &cpu->env;
>  
> +    g_assert(qemu_mutex_iothread_locked());
> +
>      if (cpu_halted(cs)) {
>          if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) {
>              return false;
> @@ -8861,7 +8867,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data)
>                           PCR_COMPAT_2_05;
>      pcc->init_proc = init_proc_POWER9;
>      pcc->check_pow = check_pow_nocheck;
> -    cc->has_work = cpu_has_work_POWER9;
> +    cc->has_work_with_iothread_lock = cpu_has_work_POWER9;
>      pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
>                         PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
>                         PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
> @@ -10253,6 +10259,8 @@ static bool ppc_cpu_has_work(CPUState *cs)
>      PowerPCCPU *cpu = POWERPC_CPU(cs);
>      CPUPPCState *env = &cpu->env;
>  
> +    g_assert(qemu_mutex_iothread_locked());
> +
>      return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD);
>  }
>  
> @@ -10452,7 +10460,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
>      cc->class_by_name = ppc_cpu_class_by_name;
>      pcc->parent_parse_features = cc->parse_features;
>      cc->parse_features = ppc_cpu_parse_featurestr;
> -    cc->has_work = ppc_cpu_has_work;
> +    cc->has_work_with_iothread_lock = ppc_cpu_has_work;
>      cc->do_interrupt = ppc_cpu_do_interrupt;
>      cc->cpu_exec_interrupt = ppc_cpu_exec_interrupt;
>      cc->dump_state = ppc_cpu_dump_state;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-12-16  6:18 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13  5:03 [Qemu-devel] [PATCH v5 00/73] per-CPU locks Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 01/73] cpu: convert queued work to a QSIMPLEQ Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 02/73] cpu: rename cpu->work_mutex to cpu->lock Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 03/73] cpu: introduce cpu_mutex_lock/unlock Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 04/73] cpu: make qemu_work_cond per-cpu Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 05/73] cpu: move run_on_cpu to cpus-common Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 06/73] cpu: introduce process_queued_cpu_work_locked Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 07/73] cpu: make per-CPU locks an alias of the BQL in TCG rr mode Emilio G. Cota
2018-12-15  1:51   ` Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 08/73] tcg-runtime: define helper_cpu_halted_set Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 09/73] ppc: convert to helper_cpu_halted_set Emilio G. Cota
2018-12-15  9:00   ` David Gibson
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 10/73] cris: " Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 11/73] hppa: " Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 12/73] m68k: " Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 13/73] alpha: " Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 14/73] microblaze: " Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 15/73] cpu: define cpu_halted helpers Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 16/73] tcg-runtime: convert to cpu_halted_set Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 17/73] arm: convert to cpu_halted Emilio G. Cota
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 18/73] ppc: " Emilio G. Cota
2018-12-15  9:02   ` David Gibson
2018-12-13  5:03 ` [Qemu-devel] [PATCH v5 19/73] sh4: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 20/73] i386: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 21/73] lm32: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 22/73] m68k: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 23/73] mips: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 24/73] riscv: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 25/73] s390x: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 26/73] sparc: " Emilio G. Cota
2018-12-17 12:53   ` Mark Cave-Ayland
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 27/73] xtensa: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 28/73] gdbstub: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 29/73] openrisc: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 30/73] cpu-exec: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 31/73] cpu: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 32/73] cpu: define cpu_interrupt_request helpers Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 33/73] ppc: use cpu_reset_interrupt Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 34/73] exec: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 35/73] i386: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 36/73] s390x: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 37/73] openrisc: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 38/73] arm: convert to cpu_interrupt_request Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 39/73] i386: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 40/73] i386/kvm: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 41/73] i386/hax-all: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 42/73] i386/whpx-all: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 43/73] i386/hvf: convert to cpu_request_interrupt Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 44/73] ppc: convert to cpu_interrupt_request Emilio G. Cota
2018-12-15  9:06   ` David Gibson
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 45/73] sh4: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 46/73] cris: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 47/73] hppa: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 48/73] lm32: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 49/73] m68k: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 50/73] mips: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 51/73] nios: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 52/73] s390x: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 53/73] alpha: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 54/73] moxie: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 55/73] sparc: " Emilio G. Cota
2018-12-17 12:57   ` Mark Cave-Ayland
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 56/73] openrisc: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 57/73] unicore32: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 58/73] microblaze: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 59/73] accel/tcg: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 60/73] cpu: convert to interrupt_request Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 61/73] cpu: call .cpu_has_work with the CPU lock held Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 62/73] cpu: introduce cpu_has_work_with_iothread_lock Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 63/73] ppc: convert to cpu_has_work_with_iothread_lock Emilio G. Cota
2018-12-15  9:07   ` David Gibson [this message]
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 64/73] mips: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 65/73] s390x: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 66/73] riscv: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 67/73] sparc: " Emilio G. Cota
2018-12-17 12:58   ` Mark Cave-Ayland
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 68/73] xtensa: " Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 70/73] cpu: protect CPU state with cpu->lock instead of the BQL Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 71/73] cpus-common: release BQL earlier in run_on_cpu Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 72/73] cpu: add async_run_on_cpu_no_bql Emilio G. Cota
2018-12-13  5:04 ` [Qemu-devel] [PATCH v5 73/73] cputlb: queue async flush jobs without the BQL Emilio G. Cota

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=20181215090722.GP29278@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).