All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	Wood Scott-B07421 <B07421@freescale.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>
Subject: Re: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in sregs
Date: Wed, 27 Jun 2012 10:23:54 -0500	[thread overview]
Message-ID: <4FEB258A.7010601@freescale.com> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF151D68@039-SN2MPN1-013.039d.mgd.msft.net>

On 06/27/2012 06:41 AM, Caraman Mihai Claudiu-B02008 wrote:
>> -----Original Message-----
>> From: Wood Scott-B07421
>> Sent: Wednesday, June 27, 2012 1:35 AM
>> To: Caraman Mihai Claudiu-B02008
>> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
>> dev@lists.ozlabs.org; qemu-ppc@nongnu.org
>> Subject: Re: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in
>> sregs
>>
>> On 06/25/2012 07:26 AM, Mihai Caraman wrote:
>>> Add KVM_SREGS_E_64 feature and EPCR spr support in get/set sregs for
>>> 64-bit hosts.
>>>
>>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>>> ---
>>>  arch/powerpc/kvm/booke.c |   14 ++++++++++++++
>>>  1 files changed, 14 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index
>>> f9fa260..d15c4b5 100644
>>> --- a/arch/powerpc/kvm/booke.c
>>> +++ b/arch/powerpc/kvm/booke.c
>>> @@ -1052,6 +1052,9 @@ static void get_sregs_base(struct kvm_vcpu *vcpu,
>>>  	u64 tb = get_tb();
>>>
>>>  	sregs->u.e.features |= KVM_SREGS_E_BASE;
>>> +#ifdef CONFIG_64BIT
>>> +	sregs->u.e.features |= KVM_SREGS_E_64;0 #endif
>>>
>>>  	sregs->u.e.csrr0 = vcpu->arch.csrr0;
>>>  	sregs->u.e.csrr1 = vcpu->arch.csrr1; @@ -1063,6 +1066,9 @@ static
>>> void get_sregs_base(struct kvm_vcpu *vcpu,
>>>  	sregs->u.e.dec = kvmppc_get_dec(vcpu, tb);
>>>  	sregs->u.e.tb = tb;
>>>  	sregs->u.e.vrsave = vcpu->arch.vrsave;
>>> +#ifdef CONFIG_64BIT
>>> +	sregs->u.e.epcr = vcpu->arch.epcr;
>>> +#endif
>>>  }
>>>
>>>  static int set_sregs_base(struct kvm_vcpu *vcpu, @@ -1071,6 +1077,11
>>> @@ static int set_sregs_base(struct kvm_vcpu *vcpu,
>>>  	if (!(sregs->u.e.features & KVM_SREGS_E_BASE))
>>>  		return 0;
>>>
>>> +#ifdef CONFIG_64BIT
>>> +	if (!(sregs->u.e.features & KVM_SREGS_E_64))
>>> +		return 0;
>>> +#endif
>>
>> This means that a QEMU targeting a 32-bit guest won't be able to set any
>> special registers, if it sets feature bits manually rather than getting
>> them from GET_SREGS.
> 
> I had some concerns about his. I only check qemu ppc code which uses get/set
> approach and I followed the BASE model. Now I see that qemu x86 set them manually :(
> Why do we care if the caller set or not BASE?

BASE contains things which should be present on all booke chips.  If
that's not set something's wrong.

None of the other feature bits are handled that way.

-Scott

WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	Wood Scott-B07421 <B07421@freescale.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>
Subject: Re: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in sregs
Date: Wed, 27 Jun 2012 15:23:54 +0000	[thread overview]
Message-ID: <4FEB258A.7010601@freescale.com> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF151D68@039-SN2MPN1-013.039d.mgd.msft.net>

On 06/27/2012 06:41 AM, Caraman Mihai Claudiu-B02008 wrote:
>> -----Original Message-----
>> From: Wood Scott-B07421
>> Sent: Wednesday, June 27, 2012 1:35 AM
>> To: Caraman Mihai Claudiu-B02008
>> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
>> dev@lists.ozlabs.org; qemu-ppc@nongnu.org
>> Subject: Re: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in
>> sregs
>>
>> On 06/25/2012 07:26 AM, Mihai Caraman wrote:
>>> Add KVM_SREGS_E_64 feature and EPCR spr support in get/set sregs for
>>> 64-bit hosts.
>>>
>>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>>> ---
>>>  arch/powerpc/kvm/booke.c |   14 ++++++++++++++
>>>  1 files changed, 14 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index
>>> f9fa260..d15c4b5 100644
>>> --- a/arch/powerpc/kvm/booke.c
>>> +++ b/arch/powerpc/kvm/booke.c
>>> @@ -1052,6 +1052,9 @@ static void get_sregs_base(struct kvm_vcpu *vcpu,
>>>  	u64 tb = get_tb();
>>>
>>>  	sregs->u.e.features |= KVM_SREGS_E_BASE;
>>> +#ifdef CONFIG_64BIT
>>> +	sregs->u.e.features |= KVM_SREGS_E_64;0 #endif
>>>
>>>  	sregs->u.e.csrr0 = vcpu->arch.csrr0;
>>>  	sregs->u.e.csrr1 = vcpu->arch.csrr1; @@ -1063,6 +1066,9 @@ static
>>> void get_sregs_base(struct kvm_vcpu *vcpu,
>>>  	sregs->u.e.dec = kvmppc_get_dec(vcpu, tb);
>>>  	sregs->u.e.tb = tb;
>>>  	sregs->u.e.vrsave = vcpu->arch.vrsave;
>>> +#ifdef CONFIG_64BIT
>>> +	sregs->u.e.epcr = vcpu->arch.epcr;
>>> +#endif
>>>  }
>>>
>>>  static int set_sregs_base(struct kvm_vcpu *vcpu, @@ -1071,6 +1077,11
>>> @@ static int set_sregs_base(struct kvm_vcpu *vcpu,
>>>  	if (!(sregs->u.e.features & KVM_SREGS_E_BASE))
>>>  		return 0;
>>>
>>> +#ifdef CONFIG_64BIT
>>> +	if (!(sregs->u.e.features & KVM_SREGS_E_64))
>>> +		return 0;
>>> +#endif
>>
>> This means that a QEMU targeting a 32-bit guest won't be able to set any
>> special registers, if it sets feature bits manually rather than getting
>> them from GET_SREGS.
> 
> I had some concerns about his. I only check qemu ppc code which uses get/set
> approach and I followed the BASE model. Now I see that qemu x86 set them manually :(
> Why do we care if the caller set or not BASE?

BASE contains things which should be present on all booke chips.  If
that's not set something's wrong.

None of the other feature bits are handled that way.

-Scott


  reply	other threads:[~2012-06-27 15:23 UTC|newest]

Thread overview: 203+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 12:26 [RFC PATCH 00/17] KVM: PPC: 64-bit Book3E support Mihai Caraman
2012-06-25 12:26 ` Mihai Caraman
2012-06-25 12:26 ` [RFC PATCH 01/17] KVM: PPC64: booke: Set interrupt computation mode for 64-bit host Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 13:22   ` Alexander Graf
2012-07-04 13:22     ` Alexander Graf
2012-07-04 13:22     ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 02/17] KVM: PPC64: booke: Add EPCR support in mtspr/mfspr emulation Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 13:21   ` Alexander Graf
2012-07-04 13:21     ` Alexander Graf
2012-07-04 13:21     ` Alexander Graf
2012-07-04 14:14     ` Caraman Mihai Claudiu-B02008
2012-07-04 14:14       ` Caraman Mihai Claudiu-B02008
2012-07-04 14:14       ` Caraman Mihai Claudiu-B02008
2012-07-04 14:53       ` Alexander Graf
2012-07-04 14:53         ` Alexander Graf
2012-07-04 14:53         ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in sregs Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-06-25 12:59   ` Avi Kivity
2012-06-25 12:59     ` Avi Kivity
2012-06-25 12:59     ` Avi Kivity
2012-06-25 13:24     ` Caraman Mihai Claudiu-B02008
2012-06-25 13:24       ` Caraman Mihai Claudiu-B02008
2012-06-25 13:36       ` Avi Kivity
2012-06-25 13:36         ` Avi Kivity
2012-06-25 13:36         ` Avi Kivity
2012-06-26 22:34   ` Scott Wood
2012-06-26 22:34     ` Scott Wood
2012-06-26 22:34     ` Scott Wood
2012-06-27 11:41     ` Caraman Mihai Claudiu-B02008
2012-06-27 11:41       ` Caraman Mihai Claudiu-B02008
2012-06-27 11:41       ` Caraman Mihai Claudiu-B02008
2012-06-27 15:23       ` Scott Wood [this message]
2012-06-27 15:23         ` Scott Wood
2012-07-04 13:33   ` [Qemu-ppc] " Alexander Graf
2012-07-04 13:33     ` Alexander Graf
2012-07-04 13:33     ` Alexander Graf
2012-07-05 11:49     ` Caraman Mihai Claudiu-B02008
2012-07-05 11:49       ` Caraman Mihai Claudiu-B02008
2012-07-05 11:49       ` Caraman Mihai Claudiu-B02008
2012-07-05 12:12       ` Alexander Graf
2012-07-05 12:12         ` Alexander Graf
2012-07-05 12:12         ` Alexander Graf
2012-07-05 12:54         ` Caraman Mihai Claudiu-B02008
2012-07-05 12:54           ` Caraman Mihai Claudiu-B02008
2012-07-05 12:54           ` Caraman Mihai Claudiu-B02008
2012-07-11 18:07           ` Alexander Graf
2012-07-11 18:07             ` Alexander Graf
2012-07-11 18:07             ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 04/17] KVM: PPC64: booke: Add guest computation mode for irq delivery Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 13:40   ` [Qemu-ppc] " Alexander Graf
2012-07-04 13:40     ` Alexander Graf
2012-07-04 13:40     ` Alexander Graf
2012-07-05  9:28     ` Caraman Mihai Claudiu-B02008
2012-07-05  9:28       ` Caraman Mihai Claudiu-B02008
2012-07-05  9:28       ` Caraman Mihai Claudiu-B02008
2012-07-05 23:51     ` Scott Wood
2012-07-05 23:51       ` Scott Wood
2012-07-05 23:51       ` Scott Wood
2012-07-06  7:03       ` Alexander Graf
2012-07-06  7:03         ` Alexander Graf
2012-07-06  7:03         ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 05/17] KVM: PPC: booke: Extend MAS2 EPN mask for 64-bit Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 13:49   ` [Qemu-ppc] " Alexander Graf
2012-07-04 13:49     ` Alexander Graf
2012-07-04 13:49     ` Alexander Graf
2012-07-05 11:14     ` Caraman Mihai Claudiu-B02008
2012-07-05 11:14       ` Caraman Mihai Claudiu-B02008
2012-07-05 11:14       ` Caraman Mihai Claudiu-B02008
2012-10-08 10:10       ` Alexander Graf
2012-10-08 10:10         ` Alexander Graf
2012-10-08 10:10         ` Alexander Graf
2012-10-08 13:06         ` Caraman Mihai Claudiu-B02008
2012-10-08 13:06           ` Caraman Mihai Claudiu-B02008
2012-10-08 13:06           ` Caraman Mihai Claudiu-B02008
2012-10-08 13:10           ` Alexander Graf
2012-10-08 13:10             ` Alexander Graf
2012-10-08 13:10             ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 06/17] KVM: PPC: e500: Add emulation helper for getting instruction ea Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 13:56   ` Alexander Graf
2012-07-04 13:56     ` Alexander Graf
2012-07-04 13:56     ` Alexander Graf
2012-07-05 11:39     ` Caraman Mihai Claudiu-B02008
2012-07-05 11:39       ` Caraman Mihai Claudiu-B02008
2012-07-05 11:39       ` Caraman Mihai Claudiu-B02008
2012-07-11 17:53       ` Alexander Graf
2012-07-11 17:53         ` Alexander Graf
2012-07-11 17:53         ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 07/17] KVM: PPC: e500: Mask ea's high 32-bits in 32/64 instr emulation Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 14:00   ` [Qemu-ppc] " Alexander Graf
2012-07-04 14:00     ` Alexander Graf
2012-07-04 14:00     ` Alexander Graf
2012-07-04 14:05     ` Alexander Graf
2012-07-04 14:05       ` Alexander Graf
2012-07-04 14:05       ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 08/17] KVM: PPC: e500mc: Fix tlbilx emulation for 64-bit guests Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-06 14:54   ` Alexander Graf
2012-07-06 14:54     ` Alexander Graf
2012-07-06 14:54     ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 09/17] KVM: PPC64: booke: Hard disable interrupts when entering guest Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 14:14   ` [Qemu-ppc] " Alexander Graf
2012-07-04 14:14     ` Alexander Graf
2012-07-04 14:14     ` Alexander Graf
2012-07-04 22:21     ` Benjamin Herrenschmidt
2012-07-04 22:21       ` Benjamin Herrenschmidt
2012-07-06 23:03       ` Caraman Mihai Claudiu-B02008
2012-07-06 23:03         ` Caraman Mihai Claudiu-B02008
2012-07-06 23:03         ` Caraman Mihai Claudiu-B02008
2012-06-25 12:26 ` [RFC PATCH 10/17] PowerPC: booke64: Refactor exception prolog for save/restore regs Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-06-26 22:12   ` Benjamin Herrenschmidt
2012-06-26 22:12     ` Benjamin Herrenschmidt
2012-06-26 22:12     ` Benjamin Herrenschmidt
2012-06-27 11:49     ` Caraman Mihai Claudiu-B02008
2012-06-27 11:49       ` Caraman Mihai Claudiu-B02008
2012-06-27 11:49       ` Caraman Mihai Claudiu-B02008
2012-06-25 12:26 ` [RFC PATCH 11/17] PowerPC: booke64: Fix machine check handler to use the right prolog Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-06-26 22:13   ` Benjamin Herrenschmidt
2012-06-26 22:13     ` Benjamin Herrenschmidt
2012-06-26 22:13     ` Benjamin Herrenschmidt
2012-06-25 12:26 ` [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 14:29   ` [Qemu-ppc] " Alexander Graf
2012-07-04 14:29     ` Alexander Graf
2012-07-04 14:29     ` Alexander Graf
2012-07-04 15:27     ` Caraman Mihai Claudiu-B02008
2012-07-04 15:27       ` Caraman Mihai Claudiu-B02008
2012-07-04 15:27       ` Caraman Mihai Claudiu-B02008
2012-07-04 15:45       ` Alexander Graf
2012-07-04 15:45         ` Alexander Graf
2012-07-04 15:45         ` Alexander Graf
2012-07-04 18:15         ` Caraman Mihai Claudiu-B02008
2012-07-04 18:15           ` Caraman Mihai Claudiu-B02008
2012-07-04 18:15           ` Caraman Mihai Claudiu-B02008
2012-07-06  0:19           ` Scott Wood
2012-07-06  0:19             ` Scott Wood
2012-07-06  0:19             ` Scott Wood
2012-07-04 22:25     ` Benjamin Herrenschmidt
2012-07-04 22:25       ` Benjamin Herrenschmidt
2012-07-04 22:25       ` Benjamin Herrenschmidt
2012-07-06 22:33       ` Caraman Mihai Claudiu-B02008
2012-07-06 22:33         ` Caraman Mihai Claudiu-B02008
2012-07-06 22:33         ` Caraman Mihai Claudiu-B02008
2012-07-06 23:11         ` Alexander Graf
2012-07-06 23:11           ` Alexander Graf
2012-07-06 23:11           ` Alexander Graf
2012-07-07  8:39           ` Caraman Mihai Claudiu-B02008
2012-07-07  8:39             ` Caraman Mihai Claudiu-B02008
2012-07-07  8:39             ` Caraman Mihai Claudiu-B02008
2012-07-11 22:25             ` Alexander Graf
2012-07-11 22:25               ` Alexander Graf
2012-07-11 22:25               ` Alexander Graf
2012-07-11 22:28               ` Benjamin Herrenschmidt
2012-07-11 22:28                 ` Benjamin Herrenschmidt
2012-07-11 22:28                 ` Benjamin Herrenschmidt
2012-07-11 22:35                 ` Alexander Graf
2012-07-11 22:35                   ` Alexander Graf
2012-07-11 22:43                   ` Benjamin Herrenschmidt
2012-07-11 22:43                     ` Benjamin Herrenschmidt
2012-07-11 22:43                     ` Benjamin Herrenschmidt
2012-07-11 22:51                     ` Alexander Graf
2012-07-11 22:51                       ` Alexander Graf
2012-07-11 22:51                       ` Alexander Graf
2012-06-25 12:26 ` [RFC PATCH 13/17] PowerPC: booke64: Use SPRG0/3 scratch for bolted TLB miss & crit int Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-06-26 22:16   ` Benjamin Herrenschmidt
2012-06-26 22:16     ` Benjamin Herrenschmidt
2012-06-26 22:16     ` Benjamin Herrenschmidt
2012-07-05 15:51     ` Caraman Mihai Claudiu-B02008
2012-07-05 15:51       ` Caraman Mihai Claudiu-B02008
2012-07-05 15:51       ` Caraman Mihai Claudiu-B02008
2012-06-26 22:24   ` Scott Wood
2012-06-26 22:24     ` Scott Wood
2012-06-26 22:24     ` Scott Wood
2012-06-25 12:26 ` [RFC PATCH 14/17] KVM: PPC32: bookehv: Remove GET_VCPU macro from exception handler Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-06-25 12:26 ` [RFC PATCH 15/17] KVM: PPC64: bookehv: Add support for interrupt handling Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-07-04 15:13   ` [Qemu-ppc] " Alexander Graf
2012-07-04 15:13     ` Alexander Graf
2012-07-04 15:13     ` Alexander Graf
2012-07-04 15:37     ` Caraman Mihai Claudiu-B02008
2012-07-04 15:37       ` Caraman Mihai Claudiu-B02008
2012-07-04 15:37       ` Caraman Mihai Claudiu-B02008
2012-07-04 15:46       ` Alexander Graf
2012-07-04 15:46         ` Alexander Graf
2012-07-04 15:46         ` Alexander Graf
2012-07-04 18:21         ` Caraman Mihai Claudiu-B02008
2012-07-04 18:21           ` Caraman Mihai Claudiu-B02008
2012-07-04 18:21           ` Caraman Mihai Claudiu-B02008
2012-06-25 12:26 ` [RFC PATCH 16/17] KVM: PPC: e500: Silence bogus GCC warning in tlb code Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman
2012-06-25 12:26 ` [RFC PATCH 17/17] KVM: PPC: booke: Fix get_tb() compile error on 64-bit Mihai Caraman
2012-06-25 12:26   ` Mihai Caraman

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=4FEB258A.7010601@freescale.com \
    --to=scottwood@freescale.com \
    --cc=B02008@freescale.com \
    --cc=B07421@freescale.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=qemu-ppc@nongnu.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.