Re: [PATCH V4] POWERPC: BOOK3S: KVM: Use the saved dar value and generic make_dsisr

2014-05-06 Thread Alexander Graf


On 06.05.14 02:41, Paul Mackerras wrote:

On Mon, May 05, 2014 at 01:19:30PM +0200, Alexander Graf wrote:

On 05/04/2014 07:21 PM, Aneesh Kumar K.V wrote:

+#ifdef CONFIG_PPC_BOOK3S_64
+   return vcpu-arch.fault_dar;

How about PA6T and G5s?

G5 sets DAR on an alignment interrupt.

As for PA6T, I don't know for sure, but if it doesn't, ordinary
alignment interrupts wouldn't be handled properly, since the code in
arch/powerpc/kernel/align.c assumes DAR contains the address being
accessed on all PowerPC CPUs.


Now that's a good point. If we simply behave like Linux, I'm fine. This 
definitely deserves a comment on the #ifdef in the code.



Alex

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4] POWERPC: BOOK3S: KVM: Use the saved dar value and generic make_dsisr

2014-05-06 Thread Aneesh Kumar K.V
Alexander Graf ag...@suse.de writes:

 On 06.05.14 02:41, Paul Mackerras wrote:
 On Mon, May 05, 2014 at 01:19:30PM +0200, Alexander Graf wrote:
 On 05/04/2014 07:21 PM, Aneesh Kumar K.V wrote:
 +#ifdef CONFIG_PPC_BOOK3S_64
 +  return vcpu-arch.fault_dar;
 How about PA6T and G5s?
 G5 sets DAR on an alignment interrupt.

 As for PA6T, I don't know for sure, but if it doesn't, ordinary
 alignment interrupts wouldn't be handled properly, since the code in
 arch/powerpc/kernel/align.c assumes DAR contains the address being
 accessed on all PowerPC CPUs.

 Now that's a good point. If we simply behave like Linux, I'm fine. This 
 definitely deserves a comment on the #ifdef in the code.


Will update and send V5

-aneesh

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4] POWERPC: BOOK3S: KVM: Use the saved dar value and generic make_dsisr

2014-05-06 Thread Alexander Graf

On 05/06/2014 04:12 PM, Aneesh Kumar K.V wrote:

Alexander Graf ag...@suse.de writes:


On 06.05.14 02:41, Paul Mackerras wrote:

On Mon, May 05, 2014 at 01:19:30PM +0200, Alexander Graf wrote:

On 05/04/2014 07:21 PM, Aneesh Kumar K.V wrote:

+#ifdef CONFIG_PPC_BOOK3S_64
+   return vcpu-arch.fault_dar;

How about PA6T and G5s?

G5 sets DAR on an alignment interrupt.

As for PA6T, I don't know for sure, but if it doesn't, ordinary
alignment interrupts wouldn't be handled properly, since the code in
arch/powerpc/kernel/align.c assumes DAR contains the address being
accessed on all PowerPC CPUs.

Now that's a good point. If we simply behave like Linux, I'm fine. This
definitely deserves a comment on the #ifdef in the code.


How about ?

#ifdef CONFIG_PPC_BOOK3S_64
/*
 * Linux always expect a valid  dar as per alignment
 * interrupt handling code (fix_alignment()). Don't compute the dar
 * value here, instead used the saved dar value. Right now we restrict
 * this only for BOOK3S-64.
 */


/* Linux's fix_alignment() assumes that DAR is valid, so can we */


Alex


return vcpu-arch.fault_dar;
#else


-aneesh



--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4] POWERPC: BOOK3S: KVM: Use the saved dar value and generic make_dsisr

2014-05-05 Thread Christian Zigotzky

Am 05.05.14 16:57, schrieb Olof Johansson:

[Now without HTML email -- it's what you get for cc:ing me at work
instead of my upstream email :)]

2014-05-05 7:43 GMT-07:00 Alexander Graf ag...@suse.de:

On 05/05/2014 04:26 PM, Aneesh Kumar K.V wrote:

Alexander Graf ag...@suse.de writes:


On 05/04/2014 07:21 PM, Aneesh Kumar K.V wrote:

Although it's optional IBM POWER cpus always had DAR value set on
alignment interrupt. So don't try to compute these values.

Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
---
Changes from V3:
* Use make_dsisr instead of checking feature flag to decide whether to use
 saved dsisr or not





ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned int inst)
{
+#ifdef CONFIG_PPC_BOOK3S_64
+   return vcpu-arch.fault_dar;

How about PA6T and G5s?



Paul mentioned that BOOK3S always had DAR value set on alignment
interrupt. And the patch is to enable/collect correct DAR value when
running with Little Endian PR guest. Now to limit the impact and to
enable Little Endian PR guest, I ended up doing the conditional code
only for book3s 64 for which we know for sure that we set DAR value.


Yes, and I'm asking whether we know that this statement holds true for PA6T and 
G5 chips which I wouldn't consider IBM POWER. Since the G5 is at least 
developed by IBM, I'd assume its semantics here are similar to POWER4, but for 
PA6T I wouldn't be so sure.


Thanks for looking out for us, obviously IBM doesn't (based on the
reply a minute ago).

In the end, since there's been no work to enable KVM on PA6T, I'm not
too worried. I guess it's one more thing to sort out (and check for)
whenever someone does that.

I definitely don't have cycles to deal with that myself at this time.
I can help find hardware for someone who wants to, but even then I'm
guessing the interest is pretty limited.


-Olof
--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Just for info: PR KVM works great on my PA6T machine. I booted the 
Lubuntu 14.04 PowerPC live DVD on a QEMU virtual machine with PR KVM 
successfully. But Mac OS X Jaguar, Panther, and Tiger don't boot with 
KVM on Mac-on-Linux and QEMU. See 
http://forum.hyperion-entertainment.biz/viewtopic.php?f=35t=1747.


-- Christian
--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4] POWERPC: BOOK3S: KVM: Use the saved dar value and generic make_dsisr

2014-05-05 Thread Benjamin Herrenschmidt
On Mon, 2014-05-05 at 19:56 +0530, Aneesh Kumar K.V wrote:
 
 Paul mentioned that BOOK3S always had DAR value set on alignment
 interrupt. And the patch is to enable/collect correct DAR value when
 running with Little Endian PR guest. Now to limit the impact and to
 enable Little Endian PR guest, I ended up doing the conditional code
 only for book3s 64 for which we know for sure that we set DAR value.

Only BookS ? Afaik, the kernel align.c unconditionally uses DAR on
every processor type. It's DSISR that may or may not be populated
but afaik DAR always is.

Cheers,
Ben.


--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4] POWERPC: BOOK3S: KVM: Use the saved dar value and generic make_dsisr

2014-05-05 Thread Benjamin Herrenschmidt
On Mon, 2014-05-05 at 16:43 +0200, Alexander Graf wrote:
  Paul mentioned that BOOK3S always had DAR value set on alignment
  interrupt. And the patch is to enable/collect correct DAR value when
  running with Little Endian PR guest. Now to limit the impact and to
  enable Little Endian PR guest, I ended up doing the conditional code
  only for book3s 64 for which we know for sure that we set DAR value.
 
 Yes, and I'm asking whether we know that this statement holds true for 
 PA6T and G5 chips which I wouldn't consider IBM POWER. Since the G5 is 
 at least developed by IBM, I'd assume its semantics here are similar to 
 POWER4, but for PA6T I wouldn't be so sure.

I am not aware of any PowerPC processor that does not set DAR on
alignment interrupts. Paul, are you ?

Cheers,
Ben.


--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4] POWERPC: BOOK3S: KVM: Use the saved dar value and generic make_dsisr

2014-05-05 Thread Paul Mackerras
On Mon, May 05, 2014 at 01:19:30PM +0200, Alexander Graf wrote:
 On 05/04/2014 07:21 PM, Aneesh Kumar K.V wrote:
 +#ifdef CONFIG_PPC_BOOK3S_64
 +return vcpu-arch.fault_dar;
 
 How about PA6T and G5s?

G5 sets DAR on an alignment interrupt.

As for PA6T, I don't know for sure, but if it doesn't, ordinary
alignment interrupts wouldn't be handled properly, since the code in
arch/powerpc/kernel/align.c assumes DAR contains the address being
accessed on all PowerPC CPUs.

Did PA Semi ever publish a user manual for the PA6T, I wonder?

Paul.
--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html