All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Scott Wood <scottwood@freescale.com>
Cc: Bharat Bhushan <r65777@freescale.com>, <kvm-ppc@vger.kernel.org>,
	<kvm@vger.kernel.org>,
	Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: Re: [PATCH 6/7] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER
Date: Thu, 28 Feb 2013 17:51:10 +0100	[thread overview]
Message-ID: <DBD226DD-03CC-477F-9ED4-7B6C7F5E4419@suse.de> (raw)
In-Reply-To: <1362069082.25315.2@snotra>


On 28.02.2013, at 17:31, Scott Wood wrote:

> On 02/27/2013 10:13:15 PM, Bharat Bhushan wrote:
>> Instruction emulation return EMULATE_DO_PAPR when it requires
>> exit to userspace on book3s. Similar return is required
>> for booke. EMULATE_DO_PAPR reads out to be confusing so it is
>> renamed to EMULATE_EXIT_USER.
>> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
>> ---
>> arch/powerpc/include/asm/kvm_ppc.h |    2 +-
>> arch/powerpc/kvm/book3s_emulate.c  |    2 +-
>> arch/powerpc/kvm/book3s_pr.c       |    2 +-
>> 3 files changed, 3 insertions(+), 3 deletions(-)
>> diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
>> index 44a657a..8b81468 100644
>> --- a/arch/powerpc/include/asm/kvm_ppc.h
>> +++ b/arch/powerpc/include/asm/kvm_ppc.h
>> @@ -44,7 +44,7 @@ enum emulation_result {
>> 	EMULATE_DO_DCR,       /* kvm_run filled with DCR request */
>> 	EMULATE_FAIL,         /* can't emulate this instruction */
>> 	EMULATE_AGAIN,        /* something went wrong. go again */
>> -	EMULATE_DO_PAPR,      /* kvm_run filled with PAPR request */
>> +	EMULATE_EXIT_USER,    /* emulation requires exit to user-space */
>> };
>> extern int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
>> diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c
>> index 836c569..cdd19d6 100644
>> --- a/arch/powerpc/kvm/book3s_emulate.c
>> +++ b/arch/powerpc/kvm/book3s_emulate.c
>> @@ -194,7 +194,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
>> 				run->papr_hcall.args[i] = gpr;
>> 			}
>> -			emulated = EMULATE_DO_PAPR;
>> +			emulated = EMULATE_EXIT_USER;
>> 			break;
>> 		}
>> #endif
>> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
>> index 73ed11c..8df2d2d 100644
>> --- a/arch/powerpc/kvm/book3s_pr.c
>> +++ b/arch/powerpc/kvm/book3s_pr.c
>> @@ -760,7 +760,7 @@ program_interrupt:
>> 			run->exit_reason = KVM_EXIT_MMIO;
>> 			r = RESUME_HOST_NV;
>> 			break;
>> -		case EMULATE_DO_PAPR:
>> +		case EMULATE_EXIT_USER:
>> 			run->exit_reason = KVM_EXIT_PAPR_HCALL;
>> 			vcpu->arch.hcall_needed = 1;
>> 			r = RESUME_HOST_NV;
> 
> I don't think it makes sense to genericize this.  

It makes sense if the run->exit_reason = ... and hcall_needed = ... lines get pulled into the emulator. The question is basically whether we want to have another layer of abstraction inside our own emulator / kvm interface. I don't have a strong feeling either way.


Alex

> It means more than just "return to user"; it indicates what sort of exit reason should be passed back.  What if book3s later wants to be able to return KVM_EXIT_DEBUG, or we want to have userspace-handled hcalls on booke?
> 
> -Scott
> --
> To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Scott Wood <scottwood@freescale.com>
Cc: Bharat Bhushan <r65777@freescale.com>,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org,
	Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: Re: [PATCH 6/7] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER
Date: Thu, 28 Feb 2013 16:51:10 +0000	[thread overview]
Message-ID: <DBD226DD-03CC-477F-9ED4-7B6C7F5E4419@suse.de> (raw)
In-Reply-To: <1362069082.25315.2@snotra>


On 28.02.2013, at 17:31, Scott Wood wrote:

> On 02/27/2013 10:13:15 PM, Bharat Bhushan wrote:
>> Instruction emulation return EMULATE_DO_PAPR when it requires
>> exit to userspace on book3s. Similar return is required
>> for booke. EMULATE_DO_PAPR reads out to be confusing so it is
>> renamed to EMULATE_EXIT_USER.
>> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
>> ---
>> arch/powerpc/include/asm/kvm_ppc.h |    2 +-
>> arch/powerpc/kvm/book3s_emulate.c  |    2 +-
>> arch/powerpc/kvm/book3s_pr.c       |    2 +-
>> 3 files changed, 3 insertions(+), 3 deletions(-)
>> diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
>> index 44a657a..8b81468 100644
>> --- a/arch/powerpc/include/asm/kvm_ppc.h
>> +++ b/arch/powerpc/include/asm/kvm_ppc.h
>> @@ -44,7 +44,7 @@ enum emulation_result {
>> 	EMULATE_DO_DCR,       /* kvm_run filled with DCR request */
>> 	EMULATE_FAIL,         /* can't emulate this instruction */
>> 	EMULATE_AGAIN,        /* something went wrong. go again */
>> -	EMULATE_DO_PAPR,      /* kvm_run filled with PAPR request */
>> +	EMULATE_EXIT_USER,    /* emulation requires exit to user-space */
>> };
>> extern int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
>> diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c
>> index 836c569..cdd19d6 100644
>> --- a/arch/powerpc/kvm/book3s_emulate.c
>> +++ b/arch/powerpc/kvm/book3s_emulate.c
>> @@ -194,7 +194,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
>> 				run->papr_hcall.args[i] = gpr;
>> 			}
>> -			emulated = EMULATE_DO_PAPR;
>> +			emulated = EMULATE_EXIT_USER;
>> 			break;
>> 		}
>> #endif
>> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
>> index 73ed11c..8df2d2d 100644
>> --- a/arch/powerpc/kvm/book3s_pr.c
>> +++ b/arch/powerpc/kvm/book3s_pr.c
>> @@ -760,7 +760,7 @@ program_interrupt:
>> 			run->exit_reason = KVM_EXIT_MMIO;
>> 			r = RESUME_HOST_NV;
>> 			break;
>> -		case EMULATE_DO_PAPR:
>> +		case EMULATE_EXIT_USER:
>> 			run->exit_reason = KVM_EXIT_PAPR_HCALL;
>> 			vcpu->arch.hcall_needed = 1;
>> 			r = RESUME_HOST_NV;
> 
> I don't think it makes sense to genericize this.  

It makes sense if the run->exit_reason = ... and hcall_needed = ... lines get pulled into the emulator. The question is basically whether we want to have another layer of abstraction inside our own emulator / kvm interface. I don't have a strong feeling either way.


Alex

> It means more than just "return to user"; it indicates what sort of exit reason should be passed back.  What if book3s later wants to be able to return KVM_EXIT_DEBUG, or we want to have userspace-handled hcalls on booke?
> 
> -Scott
> --
> To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2013-02-28 16:51 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  4:13 [PATCH 0/7] KVM :PPC: Userspace Debug support Bharat Bhushan
2013-02-28  4:25 ` Bharat Bhushan
2013-02-28  4:13 ` [PATCH 1/7] KVM: PPC: booke: Added debug handler Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 14:02   ` Alexander Graf
2013-03-07 14:02     ` Alexander Graf
2013-02-28  4:13 ` [PATCH 2/7] Added ONE_REG interface for debug instruction Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28 16:23   ` Scott Wood
2013-02-28 16:23     ` Scott Wood
2013-02-28 16:52     ` Alexander Graf
2013-02-28 16:52       ` Alexander Graf
2013-03-01  5:28       ` Bhushan Bharat-R65777
2013-03-01  5:28         ` Bhushan Bharat-R65777
2013-03-07 13:07   ` Alexander Graf
2013-03-07 13:07     ` Alexander Graf
2013-03-14  4:30     ` Bhushan Bharat-R65777
2013-03-14 11:56       ` Alexander Graf
2013-03-14 11:56         ` Alexander Graf
2013-02-28  4:13 ` [PATCH 3/7] KVM: PPC: debug stub interface parameter defined Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:20   ` Alexander Graf
2013-03-07 13:20     ` Alexander Graf
2013-03-14  4:42     ` Bhushan Bharat-R65777
2013-03-14 11:54       ` Alexander Graf
2013-03-14 11:54         ` Alexander Graf
2013-03-14 11:57         ` Jan Kiszka
2013-03-14 11:57           ` Jan Kiszka
2013-03-14 12:09           ` Alexander Graf
2013-03-14 12:09             ` Alexander Graf
2013-03-14 12:13             ` Jan Kiszka
2013-03-14 12:13               ` Jan Kiszka
2013-03-14 12:19               ` Alexander Graf
2013-03-14 12:19                 ` Alexander Graf
2013-03-14 12:22                 ` Jan Kiszka
2013-03-14 12:22                   ` Jan Kiszka
2013-03-14 12:28                   ` Alexander Graf
2013-03-14 12:28                     ` Alexander Graf
2013-02-28  4:13 ` [PATCH 4/7] booke: Save and restore debug registers on guest entry and exit Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:25   ` Alexander Graf
2013-03-07 13:25     ` Alexander Graf
2013-03-14  4:50     ` Bhushan Bharat-R65777
2013-03-14 11:52       ` Alexander Graf
2013-03-14 11:52         ` Alexander Graf
2013-03-14 14:44         ` Bhushan Bharat-R65777
2013-02-28  4:13 ` [PATCH 5/7] bookehv: " Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28  4:13 ` [PATCH 6/7] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28 16:31   ` Scott Wood
2013-02-28 16:31     ` Scott Wood
2013-02-28 16:51     ` Alexander Graf [this message]
2013-02-28 16:51       ` Alexander Graf
2013-02-28 16:53       ` Scott Wood
2013-02-28 16:53         ` Scott Wood
2013-03-07 10:47         ` Alexander Graf
2013-03-07 10:47           ` Alexander Graf
2013-03-14  5:59           ` Bhushan Bharat-R65777
2013-02-28  4:13 ` [PATCH 7/7] KVM: PPC: Add userspace debug stub support Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:39   ` Alexander Graf
2013-03-07 13:39     ` Alexander Graf
2013-03-14  5:18     ` Bhushan Bharat-R65777
2013-03-14  5:18       ` Bhushan Bharat-R65777
2013-03-14 11:50       ` Alexander Graf
2013-03-14 11:50         ` Alexander Graf
2013-03-14 13:57         ` Bhushan Bharat-R65777
2013-03-14 13:57           ` Bhushan Bharat-R65777
2013-03-14 16:05           ` Scott Wood
2013-03-14 16:05             ` Scott Wood
2013-03-14 16:11             ` Bhushan Bharat-R65777

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=DBD226DD-03CC-477F-9ED4-7B6C7F5E4419@suse.de \
    --to=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 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.