All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec
@ 2014-09-13 16:44 Richard Henderson
  2014-09-13 20:03 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2014-09-13 16:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, afaerber, aliguori

Prompted by trying to review Martin's ARM exception vs gdb
problems, let's clean up cpu_exec so that it's almost readable.

After the 23 patches, there's one (interesting) ifdef left.
That is, i386 redefining CPU_INTERRUPT_RESET as CPU_INTERRUPT_INIT
for its own purposes.  I'm not sure why all that couldn't be done
under whatever hooks cpu_reset allows.  Failing that, we might be
able to redefine C_I_I as a new CPU_INTERRUPT_TGT_INT_3 bit.

I've done some smoke tests on i386, arm, xtensa, because I had
images handy.  But I've not done anything but compile the rest.

Comments appreciated.


r~


Richard Henderson (23):
  qom: Add cpu_exec_enter and cpu_exec_exit hooks
  cpu-exec: Remove do-nothing ifdef chains
  target-i386: Use cpu_exec_enter/exit qom hooks
  target-m68k: Use cpu_exec_enter/exit qom hooks
  target-ppc: Use cpu_exec_enter qom hook
  qom: Add cpu_exec_interrupt hook
  target-xtensa: Use cpu_exec_interrupt qom hook
  target-s390x: Use cpu_exec_interrupt qom hook
  target-m68k: Use cpu_exec_interrupt qom hook
  target-cris: Use cpu_exec_interrupt qom hook
  target-alpha: Use cpu_exec_interrupt qom hook
  target-sh4: Use cpu_exec_interrupt qom hook
  target-unicore32: Use cpu_exec_interrupt qom hook
  target-arm: Use cpu_exec_interrupt qom hook
  target-sparc: Use cpu_exec_interrupt qom hook
  target-openrisc: Use cpu_exec_interrupt qom hook
  target-tricore: Remove the dummy interrupt boilerplate
  target-mips: Use cpu_exec_interrupt qom hook
  target-microblaze: Use cpu_exec_interrupt qom hook
  target-lm32: Use cpu_exec_interrupt qom hook
  target-ppc: Use cpu_exec_interrupt qom hook
  target-i386: Use cpu_exec_interrupt qom hook
  cpu-exec: Do CPU_INTERRUPT_HALT unconditionally

 cpu-exec.c                  | 329 ++------------------------------------------
 include/qom/cpu.h           |   7 +
 qom/cpu.c                   |  12 +-
 target-alpha/cpu-qom.h      |   1 +
 target-alpha/cpu.c          |   1 +
 target-alpha/helper.c       |  44 ++++++
 target-arm/cpu-qom.h        |   1 +
 target-arm/cpu.c            |  34 +++++
 target-arm/cpu64.c          |   1 +
 target-cris/cpu-qom.h       |   1 +
 target-cris/cpu.c           |   1 +
 target-cris/helper.c        |  31 +++++
 target-i386/cpu-qom.h       |   4 +
 target-i386/cpu.c           |   3 +
 target-i386/helper.c        |  21 +++
 target-i386/seg_helper.c    |  69 ++++++++++
 target-lm32/cpu-qom.h       |   1 +
 target-lm32/cpu.c           |   1 +
 target-lm32/helper.c        |  13 ++
 target-m68k/cpu-qom.h       |   4 +
 target-m68k/cpu.c           |   4 +
 target-m68k/cpu.h           |   1 -
 target-m68k/helper.c        |  20 +++
 target-m68k/op_helper.c     |  22 ++-
 target-microblaze/cpu-qom.h |   1 +
 target-microblaze/cpu.c     |   1 +
 target-microblaze/helper.c  |  16 +++
 target-mips/cpu-qom.h       |   1 +
 target-mips/cpu.c           |   1 +
 target-mips/helper.c        |  17 +++
 target-openrisc/cpu.c       |   1 +
 target-openrisc/cpu.h       |   1 +
 target-openrisc/interrupt.c |  20 +++
 target-ppc/cpu-qom.h        |   1 +
 target-ppc/cpu.h            |   1 -
 target-ppc/excp_helper.c    |  19 ++-
 target-ppc/translate_init.c |  10 ++
 target-s390x/cpu-qom.h      |   1 +
 target-s390x/cpu.c          |   1 +
 target-s390x/helper.c       |  13 ++
 target-sh4/cpu-qom.h        |   1 +
 target-sh4/cpu.c            |   1 +
 target-sh4/helper.c         |   9 ++
 target-sparc/cpu.c          |  21 +++
 target-tricore/cpu-qom.h    |   1 -
 target-tricore/cpu.c        |   1 -
 target-tricore/cpu.h        |   2 -
 target-tricore/helper.c     |   4 -
 target-unicore32/cpu-qom.h  |   1 +
 target-unicore32/cpu.c      |   1 +
 target-unicore32/helper.c   |  15 ++
 target-xtensa/cpu-qom.h     |   1 +
 target-xtensa/cpu.c         |   1 +
 target-xtensa/helper.c      |  10 ++
 54 files changed, 464 insertions(+), 336 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec
  2014-09-13 16:44 [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec Richard Henderson
@ 2014-09-13 20:03 ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-09-13 20:03 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: peter.maydell, afaerber, aliguori

Il 13/09/2014 18:44, Richard Henderson ha scritto:
> 
> After the 23 patches, there's one (interesting) ifdef left.
> That is, i386 redefining CPU_INTERRUPT_RESET as CPU_INTERRUPT_INIT
> for its own purposes.  I'm not sure why all that couldn't be done
> under whatever hooks cpu_reset allows.

There are two reasons.

One is because INIT is intentionally weaker than RESET.  For example, it
doesn't clear many MSRs and the FPU state.

The second is because INIT can be intercepted by the virtual machine
monitor if SVM is enabled (KVM doesn't use it, but it is useful for
example when the virtual machine monitor is letting the virtual machine
use the hardware APIC).

The latter could well happen on more targets than just x86, so perhaps
we can have a reset_interrupt method that defaults to reset and is
overridden by x86?

> Failing that, we might be
> able to redefine C_I_I as a new CPU_INTERRUPT_TGT_INT_3 bit.

That would break migration, though admittedly only in a somewhat remote
case.

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec
  2014-09-13 16:45 Richard Henderson
@ 2014-09-26 10:45 ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2014-09-26 10:45 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Anthony Liguori, Andreas Färber

On 13 September 2014 17:45, Richard Henderson <rth@twiddle.net> wrote:
> Prompted by trying to review Martin's ARM exception vs gdb
> problems, let's clean up cpu_exec so that it's almost readable.
>
> After the 23 patches, there's one (interesting) ifdef left.
> That is, i386 redefining CPU_INTERRUPT_RESET as CPU_INTERRUPT_INIT
> for its own purposes.  I'm not sure why all that couldn't be done
> under whatever hooks cpu_reset allows.  Failing that, we might be
> able to redefine C_I_I as a new CPU_INTERRUPT_TGT_INT_3 bit.
>
> I've done some smoke tests on i386, arm, xtensa, because I had
> images handy.  But I've not done anything but compile the rest.
>
> Comments appreciated.

Applied to master, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec
@ 2014-09-13 16:45 Richard Henderson
  2014-09-26 10:45 ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2014-09-13 16:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, afaerber, aliguori

Prompted by trying to review Martin's ARM exception vs gdb
problems, let's clean up cpu_exec so that it's almost readable.

After the 23 patches, there's one (interesting) ifdef left.
That is, i386 redefining CPU_INTERRUPT_RESET as CPU_INTERRUPT_INIT
for its own purposes.  I'm not sure why all that couldn't be done
under whatever hooks cpu_reset allows.  Failing that, we might be
able to redefine C_I_I as a new CPU_INTERRUPT_TGT_INT_3 bit.

I've done some smoke tests on i386, arm, xtensa, because I had
images handy.  But I've not done anything but compile the rest.

Comments appreciated.


r~


Richard Henderson (23):
  qom: Add cpu_exec_enter and cpu_exec_exit hooks
  cpu-exec: Remove do-nothing ifdef chains
  target-i386: Use cpu_exec_enter/exit qom hooks
  target-m68k: Use cpu_exec_enter/exit qom hooks
  target-ppc: Use cpu_exec_enter qom hook
  qom: Add cpu_exec_interrupt hook
  target-xtensa: Use cpu_exec_interrupt qom hook
  target-s390x: Use cpu_exec_interrupt qom hook
  target-m68k: Use cpu_exec_interrupt qom hook
  target-cris: Use cpu_exec_interrupt qom hook
  target-alpha: Use cpu_exec_interrupt qom hook
  target-sh4: Use cpu_exec_interrupt qom hook
  target-unicore32: Use cpu_exec_interrupt qom hook
  target-arm: Use cpu_exec_interrupt qom hook
  target-sparc: Use cpu_exec_interrupt qom hook
  target-openrisc: Use cpu_exec_interrupt qom hook
  target-tricore: Remove the dummy interrupt boilerplate
  target-mips: Use cpu_exec_interrupt qom hook
  target-microblaze: Use cpu_exec_interrupt qom hook
  target-lm32: Use cpu_exec_interrupt qom hook
  target-ppc: Use cpu_exec_interrupt qom hook
  target-i386: Use cpu_exec_interrupt qom hook
  cpu-exec: Do CPU_INTERRUPT_HALT unconditionally

 cpu-exec.c                  | 329 ++------------------------------------------
 include/qom/cpu.h           |   7 +
 qom/cpu.c                   |  12 +-
 target-alpha/cpu-qom.h      |   1 +
 target-alpha/cpu.c          |   1 +
 target-alpha/helper.c       |  44 ++++++
 target-arm/cpu-qom.h        |   1 +
 target-arm/cpu.c            |  34 +++++
 target-arm/cpu64.c          |   1 +
 target-cris/cpu-qom.h       |   1 +
 target-cris/cpu.c           |   1 +
 target-cris/helper.c        |  31 +++++
 target-i386/cpu-qom.h       |   4 +
 target-i386/cpu.c           |   3 +
 target-i386/helper.c        |  21 +++
 target-i386/seg_helper.c    |  69 ++++++++++
 target-lm32/cpu-qom.h       |   1 +
 target-lm32/cpu.c           |   1 +
 target-lm32/helper.c        |  13 ++
 target-m68k/cpu-qom.h       |   4 +
 target-m68k/cpu.c           |   4 +
 target-m68k/cpu.h           |   1 -
 target-m68k/helper.c        |  20 +++
 target-m68k/op_helper.c     |  22 ++-
 target-microblaze/cpu-qom.h |   1 +
 target-microblaze/cpu.c     |   1 +
 target-microblaze/helper.c  |  16 +++
 target-mips/cpu-qom.h       |   1 +
 target-mips/cpu.c           |   1 +
 target-mips/helper.c        |  17 +++
 target-openrisc/cpu.c       |   1 +
 target-openrisc/cpu.h       |   1 +
 target-openrisc/interrupt.c |  20 +++
 target-ppc/cpu-qom.h        |   1 +
 target-ppc/cpu.h            |   1 -
 target-ppc/excp_helper.c    |  19 ++-
 target-ppc/translate_init.c |  10 ++
 target-s390x/cpu-qom.h      |   1 +
 target-s390x/cpu.c          |   1 +
 target-s390x/helper.c       |  13 ++
 target-sh4/cpu-qom.h        |   1 +
 target-sh4/cpu.c            |   1 +
 target-sh4/helper.c         |   9 ++
 target-sparc/cpu.c          |  21 +++
 target-tricore/cpu-qom.h    |   1 -
 target-tricore/cpu.c        |   1 -
 target-tricore/cpu.h        |   2 -
 target-tricore/helper.c     |   4 -
 target-unicore32/cpu-qom.h  |   1 +
 target-unicore32/cpu.c      |   1 +
 target-unicore32/helper.c   |  15 ++
 target-xtensa/cpu-qom.h     |   1 +
 target-xtensa/cpu.c         |   1 +
 target-xtensa/helper.c      |  10 ++
 54 files changed, 464 insertions(+), 336 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-26 10:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-13 16:44 [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec Richard Henderson
2014-09-13 20:03 ` Paolo Bonzini
2014-09-13 16:45 Richard Henderson
2014-09-26 10:45 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.