public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "tiejun.chen" <tiejun.chen@windriver.com>
To: Bharat Bhushan <r65777@freescale.com>
Cc: <kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>, <agraf@suse.de>,
	<scottwood@freescale.com>,
	Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: Re: [PATCH 5/7 v3] KVM: PPC: exit to user space on "ehpriv" instruction
Date: Tue, 9 Apr 2013 16:28:34 +0800	[thread overview]
Message-ID: <5163D132.9080309@windriver.com> (raw)
In-Reply-To: <1365417138-8202-6-git-send-email-Bharat.Bhushan@freescale.com>

On 04/08/2013 06:32 PM, Bharat Bhushan wrote:
> From: Bharat Bhushan <bharat.bhushan@freescale.com>
>
> "ehpriv" instruction is used for setting software breakpoints
> by user space. This patch adds support to exit to user space
> with "run->debug" have relevant information.
>
> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> ---
>   arch/powerpc/kvm/e500_emulate.c |   10 ++++++++++
>   1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
> index e78f353..cefdd38 100644
> --- a/arch/powerpc/kvm/e500_emulate.c
> +++ b/arch/powerpc/kvm/e500_emulate.c
> @@ -26,6 +26,7 @@
>   #define XOP_TLBRE   946
>   #define XOP_TLBWE   978
>   #define XOP_TLBILX  18
> +#define XOP_EHPRIV  270
>
>   #ifdef CONFIG_KVM_E500MC
>   static int dbell2prio(ulong param)
> @@ -130,6 +131,15 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
>   			emulated = kvmppc_e500_emul_tlbivax(vcpu, ea);
>   			break;
>
> +		case XOP_EHPRIV:
> +			run->exit_reason = KVM_EXIT_DEBUG;

IIRC, the ehpriv instruction should generate a Hypervisor Privilege Exception to 
trap into the Hypervisor proactive. And we can use this ability to design 
something conveniently. And so, that is not only for the debug mechanism like 
you did.

So here if 'run->exit_reason' is fixed to KVM_EXIT_DEBUG, how to distinguish 
other scenarios? So as I understand, we should use 'ehpriv oc' exactly then 
resolve 'oc' further to go different cases, right?

Tiejun

> +			run->debug.arch.address = vcpu->arch.pc;
> +			run->debug.arch.status = 0;
> +			kvmppc_account_exit(vcpu, DEBUG_EXITS);
> +			emulated = EMULATE_EXIT_USER;
> +			*advance = 0;
> +			break;
> +
>   		default:
>   			emulated = EMULATE_FAIL;
>   		}
>

  parent reply	other threads:[~2013-04-09  8:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 10:32 [PATCH 0/7 v3] KVM :PPC: Userspace Debug support Bharat Bhushan
2013-04-08 10:32 ` [PATCH 1/7 v3] KVM: PPC: debug stub interface parameter defined Bharat Bhushan
2013-04-08 10:32   ` [PATCH 2/7 v3] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER Bharat Bhushan
2013-04-08 10:32     ` [PATCH 3/7 v3] KVM: extend EMULATE_EXIT_USER to support different exit reasons Bharat Bhushan
2013-04-08 10:32       ` [PATCH 4/7 v3] booke: exit to user space if emulator request Bharat Bhushan
2013-04-08 10:32         ` [PATCH 5/7 v3] KVM: PPC: exit to user space on "ehpriv" instruction Bharat Bhushan
2013-04-08 10:32           ` [PATCH 6/7 v3] powerpc: export debug register save function for KVM Bharat Bhushan
2013-04-08 10:32             ` [PATCH 7/7 v3] KVM: PPC: Add userspace debug stub support Bharat Bhushan
2013-04-26 11:15               ` Alexander Graf
2013-05-02  9:46                 ` Bhushan Bharat-R65777
2013-05-02 11:05                   ` Alexander Graf
2013-05-02 14:00                     ` Bhushan Bharat-R65777
2013-05-02 14:04                       ` Alexander Graf
2013-05-03 10:48                     ` Bhushan Bharat-R65777
2013-05-03 11:08                       ` Alexander Graf
2013-05-03 12:29                         ` Alexander Graf
2013-05-03 13:11                           ` Bhushan Bharat-R65777
2013-05-03 13:18                             ` Alexander Graf
2013-05-06  5:51                               ` Bhushan Bharat-R65777
2013-04-09  8:28           ` tiejun.chen [this message]
2013-04-26 10:45           ` [PATCH 5/7 v3] KVM: PPC: exit to user space on "ehpriv" instruction Alexander Graf
2013-04-26 10:56             ` tiejun.chen
2013-04-09 22:37     ` [PATCH 2/7 v3] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER Paul Mackerras
2013-04-10 22:09       ` Alexander Graf
2013-04-26 13:37 ` [PATCH 0/7 v3] KVM :PPC: Userspace Debug support 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=5163D132.9080309@windriver.com \
    --to=tiejun.chen@windriver.com \
    --cc=agraf@suse.de \
    --cc=bharat.bhushan@freescale.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=r65777@freescale.com \
    --cc=scottwood@freescale.com \
    /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