All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Paul Mackerras <paulus@samba.org>, kvm-ppc@vger.kernel.org
Cc: kvm@vger.kernel.org
Subject: Re: [RFC PATCH 0/5] Improve PPC instruction emulation
Date: Mon, 28 Jul 2014 11:46:43 +0000	[thread overview]
Message-ID: <53D63823.1060500@suse.de> (raw)
In-Reply-To: <1405764872-8744-1-git-send-email-paulus@samba.org>


On 19.07.14 12:14, Paul Mackerras wrote:
> This series aims to increase the range of instructions that KVM on PPC
> can emulate and reduce code duplication by using the existing
> instruction emulation code from arch/powerpc/lib/sstep.c for KVM.
>
> The ultimate goal is to make PR KVM run faster on the kind of
> instruction sequences that we get in Linux's first-level interrupt
> handlers, where we have privileged instructions such as move to/from
> SPR, mtmsrd, rfid, etc., intermingled with ordinary unprivileged
> loads, stores, arithmetic instructions, etc.  If KVM could emulate
> those ordinary instructions as well as the privileged ones, we could
> emulate these code sequences without incurring the cost to exit and
> re-enter the guest for every single privileged instruction.  That
> would be a speedup provided the guest entry/exit cost was greater than
> the cost of emulating a few ordinary instructions.
>
> This series doesn't get to that ultimate goal but does lay the
> groundwork.  It splits the emulate_step() function into two parts,
> analyse_instr() and emulate_step(), and uses analyse_instr() in
> kvmppc_emulate_instruction().  This means that KVM needs to store its
> vcpu integer register state in a struct pt_regs like the rest of the
> kernel does.  We also need to make kvmppc_handle_load() and
> kvmppc_handle_store() handle loads and stores to ordinary guest memory
> as well as emulated MMIO.

Please take a look at my other patch set that implemented instruction 
emulation. There we split the code paths between MMIO emulation and 
normal instruction emulation.

I really think that approach is a prerequisite to doing full instruction 
emulation in longer code snippets. Obviously the generic load/store 
should then handle MMIO as well as generic memory operations.


Alex


WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Paul Mackerras <paulus@samba.org>, kvm-ppc@vger.kernel.org
Cc: kvm@vger.kernel.org
Subject: Re: [RFC PATCH 0/5] Improve PPC instruction emulation
Date: Mon, 28 Jul 2014 13:46:43 +0200	[thread overview]
Message-ID: <53D63823.1060500@suse.de> (raw)
In-Reply-To: <1405764872-8744-1-git-send-email-paulus@samba.org>


On 19.07.14 12:14, Paul Mackerras wrote:
> This series aims to increase the range of instructions that KVM on PPC
> can emulate and reduce code duplication by using the existing
> instruction emulation code from arch/powerpc/lib/sstep.c for KVM.
>
> The ultimate goal is to make PR KVM run faster on the kind of
> instruction sequences that we get in Linux's first-level interrupt
> handlers, where we have privileged instructions such as move to/from
> SPR, mtmsrd, rfid, etc., intermingled with ordinary unprivileged
> loads, stores, arithmetic instructions, etc.  If KVM could emulate
> those ordinary instructions as well as the privileged ones, we could
> emulate these code sequences without incurring the cost to exit and
> re-enter the guest for every single privileged instruction.  That
> would be a speedup provided the guest entry/exit cost was greater than
> the cost of emulating a few ordinary instructions.
>
> This series doesn't get to that ultimate goal but does lay the
> groundwork.  It splits the emulate_step() function into two parts,
> analyse_instr() and emulate_step(), and uses analyse_instr() in
> kvmppc_emulate_instruction().  This means that KVM needs to store its
> vcpu integer register state in a struct pt_regs like the rest of the
> kernel does.  We also need to make kvmppc_handle_load() and
> kvmppc_handle_store() handle loads and stores to ordinary guest memory
> as well as emulated MMIO.

Please take a look at my other patch set that implemented instruction 
emulation. There we split the code paths between MMIO emulation and 
normal instruction emulation.

I really think that approach is a prerequisite to doing full instruction 
emulation in longer code snippets. Obviously the generic load/store 
should then handle MMIO as well as generic memory operations.


Alex

  parent reply	other threads:[~2014-07-28 11:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19 10:14 [RFC PATCH 0/5] Improve PPC instruction emulation Paul Mackerras
2014-07-19 10:14 ` Paul Mackerras
2014-07-19 10:14 ` [RFC PATCH 1/5] powerpc: Split out instruction analysis part of emulate_step() Paul Mackerras
2014-07-19 10:14   ` Paul Mackerras
2014-07-28 12:01   ` Alexander Graf
2014-07-28 12:01     ` Alexander Graf
2014-07-19 10:14 ` [RFC PATCH 2/5] powerpc: Implement emulation of string loads and stores Paul Mackerras
2014-07-19 10:14   ` Paul Mackerras
2014-07-19 10:14 ` [RFC PATCH 3/5] KVM: PPC: Use pt_regs struct for integer registers in struct vcpu_arch Paul Mackerras
2014-07-19 10:14   ` Paul Mackerras
2014-07-19 10:14 ` [RFC PATCH 4/5] KVM: PPC: Use analyse_instr() in kvmppc_emulate_instruction() Paul Mackerras
2014-07-19 10:14   ` Paul Mackerras
2014-07-28 12:12   ` Alexander Graf
2014-07-28 12:12     ` Alexander Graf
2014-07-19 10:14 ` [RFC PATCH 5/5] KVM: PPC: Book3S: Make kvmppc_handle_load/store handle any load or store Paul Mackerras
2014-07-19 10:14   ` Paul Mackerras
2014-07-28 12:14   ` Alexander Graf
2014-07-28 12:14     ` Alexander Graf
2014-07-28 11:46 ` Alexander Graf [this message]
2014-07-28 11:46   ` [RFC PATCH 0/5] Improve PPC instruction emulation Alexander Graf

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=53D63823.1060500@suse.de \
    --to=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=paulus@samba.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 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.