All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: "<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>,
	KVM list <kvm@vger.kernel.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks
Date: Wed, 4 Jul 2012 17:45:01 +0200	[thread overview]
Message-ID: <2526CB9E-4B5A-40EA-9CFC-DFCA4B09F375@suse.de> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF15A6C6@039-SN2MPN1-013.039d.mgd.msft.net>


On 04.07.2012, at 17:27, Caraman Mihai Claudiu-B02008 wrote:

>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Wednesday, July 04, 2012 5:30 PM
>> To: Caraman Mihai Claudiu-B02008
>> Cc: <kvm-ppc@vger.kernel.org>; KVM list; linuxppc-dev; qemu-
>> ppc@nongnu.org List; Benjamin Herrenschmidt
>> Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM
>> kernel hooks
>> 
>> 
>> On 25.06.2012, at 14:26, Mihai Caraman wrote:
>> 
>>> Hook DO_KVM macro to 64-bit booke in a optimal way similar to 32-bit
>> booke
>>> see head_fsl_booke.S file. Extend interrupt handlers' parameter list
>> with
>>> interrupt vector numbers to accomodate the macro. Rework Guest Doorbell
>>> handler to use the proper GSRRx save/restore registers.
>>> Only the bolted version of tlb miss handers is addressed now.
>>> 
>>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>>> ---
>>> arch/powerpc/kernel/exceptions-64e.S |  114 ++++++++++++++++++++++++---
>> -------
>>> arch/powerpc/mm/tlb_low_64e.S        |   14 +++-
>>> 2 files changed, 92 insertions(+), 36 deletions(-)
>>> 
>>> diff --git a/arch/powerpc/kernel/exceptions-64e.S
>> b/arch/powerpc/kernel/exceptions-64e.S
>>> index 06f7aec..a60f81f 100644
>>> --- a/arch/powerpc/kernel/exceptions-64e.S
>>> +++ b/arch/powerpc/kernel/exceptions-64e.S
>>> @@ -25,6 +25,8 @@
>>> #include <asm/ppc-opcode.h>
>>> #include <asm/mmu.h>
>>> #include <asm/hw_irq.h>
>>> +#include <asm/kvm_asm.h>
>>> +#include <asm/kvm_booke_hv_asm.h>
>>> 
>>> /* XXX This will ultimately add space for a special exception save
>>> *     structure used to save things like SRR0/SRR1, SPRGs, MAS, etc...
>>> @@ -34,13 +36,24 @@
>>> */
>>> #define	SPECIAL_EXC_FRAME_SIZE	INT_FRAME_SIZE
>>> 
>>> +#ifdef CONFIG_KVM_BOOKE_HV
>>> +#define KVM_BOOKE_HV_MFSPR(reg, spr)				\
>>> +	BEGIN_FTR_SECTION					\
>>> +		mfspr	reg, spr;			  	\
>>> +	END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
>>> +#else
>>> +#define KVM_BOOKE_HV_MFSPR(reg, spr)
>>> +#endif
>> 
>> Bleks - this is ugly.
> 
> I agree :) But I opted to keep the optimizations done for 32-bit.
> 
>> Do we really need to open-code the #ifdef here?
> 
> 32-bit implementation fortunately use asm macros, we can't nest defines.
> 
>> Can't the feature section code determine that the feature is disabled and
>> just always not include the code?
> 
> CPU_FTR_EMB_HV is set even if KVM is not configured.

I don't get the point then. Why not have the whole DO_KVM masked under FTR_SECTION_IFSET(CPU_FTR_EMB_HV)? Are there book3s_64 implementations without HV? Can't we just mfspr unconditionally in DO_KVM?

> 
>> 
>>> +
>>> /* Exception prolog code for all exceptions */
>>> -#define EXCEPTION_PROLOG(n, type, srr0, srr1, addition)
>> \
>>> +#define EXCEPTION_PROLOG(n, intnum, type, srr0, srr1, addition)
>> 	    \
>>> 	mtspr	SPRN_SPRG_##type##_SCRATCH,r13;	/* get spare registers */
>> \
>>> 	mfspr	r13,SPRN_SPRG_PACA;	/* get PACA */			    \
>>> 	std	r10,PACA_EX##type+EX_R10(r13);				    \
>>> 	std	r11,PACA_EX##type+EX_R11(r13);				    \
>>> 	mfcr	r10;			/* save CR */			    \
>>> +	KVM_BOOKE_HV_MFSPR(r11,srr1);			    		    \
>>> +	DO_KVM	intnum,srr1;				    		    \
>> 
>> So if DO_KVM already knows srr1, why explicitly do something with it the
>> line above, and not in DO_KVM itself?
> 
> srr1 is used to expand the interrupt handler symbol name while r11 is used
> for the actual MSR[GS] optimal check:
> 	mtocrf	0x80, r11

Right, so basically we want

#ifdef CONFIG_KVM
mfspr r11, spr
mtocrf 0x80, r11
beq ...
#endif

right?

> 
>>> -/* Guest Doorbell */
>>> -	MASKABLE_EXCEPTION(0x2c0, guest_doorbell, .unknown_exception,
>> ACK_NONE)
>>> +/*
>>> + *	Guest doorbell interrupt
>>> + *	This general exception use GSRRx save/restore registers
>>> + */
>>> +	START_EXCEPTION(guest_doorbell);
>>> +	EXCEPTION_PROLOG(0x2c0, BOOKE_INTERRUPT_GUEST_DBELL, GEN,
>>> +			 SPRN_GSRR0, SPRN_GSRR1, PROLOG_ADDITION_NONE)
>>> +	EXCEPTION_COMMON(0x2c0, PACA_EXGEN, INTS_KEEP)
>>> +	addi	r3,r1,STACK_FRAME_OVERHEAD
>>> +	bl	.save_nvgprs
>>> +	INTS_RESTORE_HARD
>>> +	bl	.unknown_exception
>>> +	b	.ret_from_except
>> 
>> This is independent of DO_KVM, right?
> 
> Yes, just kvm_handler definitions in bookehv_interrupts.S depends on this.

Then please split it out into a separate patch.

> 
>> 
>>> 
>>> /* Guest Doorbell critical Interrupt */
>>> 	START_EXCEPTION(guest_doorbell_crit);
>>> -	CRIT_EXCEPTION_PROLOG(0x2e0, PROLOG_ADDITION_NONE)
>>> +	CRIT_EXCEPTION_PROLOG(0x2e0, BOOKE_INTERRUPT_GUEST_DBELL_CRIT,
>>> +			      PROLOG_ADDITION_NONE)
>> 
>> Shouldn't this one also use GSRR?
> 
> No, this is a critical exception.

Ah, right. Looked at the wrong bit, sorry :).

> 
>>> 
>>> -.macro tlb_prolog_bolted addr
>>> +.macro tlb_prolog_bolted intnum addr
>>> 	mtspr	SPRN_SPRG_TLB_SCRATCH,r13
>>> 	mfspr	r13,SPRN_SPRG_PACA
>>> 	std	r10,PACA_EXTLB+EX_TLB_R10(r13)
>>> 	mfcr	r10
>>> 	std	r11,PACA_EXTLB+EX_TLB_R11(r13)
>>> +#ifdef CONFIG_KVM_BOOKE_HV
>>> +BEGIN_FTR_SECTION
>>> +	mfspr	r11, SPRN_SRR1
>>> +END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
>>> +#endif
>> 
>> This thing really should vanish behind DO_KVM :)
> 
> Then let's do it first for 32-bit ;)

You could #ifdef it in DO_KVM for 64-bit for now. IIRC it's not done on 32-bit because the register value is used even beyond DO_KVM there.


Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: "qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	KVM list <kvm@vger.kernel.org>,
	"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>
Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks
Date: Wed, 4 Jul 2012 17:45:01 +0200	[thread overview]
Message-ID: <2526CB9E-4B5A-40EA-9CFC-DFCA4B09F375@suse.de> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF15A6C6@039-SN2MPN1-013.039d.mgd.msft.net>


On 04.07.2012, at 17:27, Caraman Mihai Claudiu-B02008 wrote:

>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Wednesday, July 04, 2012 5:30 PM
>> To: Caraman Mihai Claudiu-B02008
>> Cc: <kvm-ppc@vger.kernel.org>; KVM list; linuxppc-dev; qemu-
>> ppc@nongnu.org List; Benjamin Herrenschmidt
>> Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add =
DO_KVM
>> kernel hooks
>>=20
>>=20
>> On 25.06.2012, at 14:26, Mihai Caraman wrote:
>>=20
>>> Hook DO_KVM macro to 64-bit booke in a optimal way similar to 32-bit
>> booke
>>> see head_fsl_booke.S file. Extend interrupt handlers' parameter list
>> with
>>> interrupt vector numbers to accomodate the macro. Rework Guest =
Doorbell
>>> handler to use the proper GSRRx save/restore registers.
>>> Only the bolted version of tlb miss handers is addressed now.
>>>=20
>>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>>> ---
>>> arch/powerpc/kernel/exceptions-64e.S |  114 =
++++++++++++++++++++++++---
>> -------
>>> arch/powerpc/mm/tlb_low_64e.S        |   14 +++-
>>> 2 files changed, 92 insertions(+), 36 deletions(-)
>>>=20
>>> diff --git a/arch/powerpc/kernel/exceptions-64e.S
>> b/arch/powerpc/kernel/exceptions-64e.S
>>> index 06f7aec..a60f81f 100644
>>> --- a/arch/powerpc/kernel/exceptions-64e.S
>>> +++ b/arch/powerpc/kernel/exceptions-64e.S
>>> @@ -25,6 +25,8 @@
>>> #include <asm/ppc-opcode.h>
>>> #include <asm/mmu.h>
>>> #include <asm/hw_irq.h>
>>> +#include <asm/kvm_asm.h>
>>> +#include <asm/kvm_booke_hv_asm.h>
>>>=20
>>> /* XXX This will ultimately add space for a special exception save
>>> *     structure used to save things like SRR0/SRR1, SPRGs, MAS, =
etc...
>>> @@ -34,13 +36,24 @@
>>> */
>>> #define	SPECIAL_EXC_FRAME_SIZE	INT_FRAME_SIZE
>>>=20
>>> +#ifdef CONFIG_KVM_BOOKE_HV
>>> +#define KVM_BOOKE_HV_MFSPR(reg, spr)				=
\
>>> +	BEGIN_FTR_SECTION					\
>>> +		mfspr	reg, spr;			  	\
>>> +	END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
>>> +#else
>>> +#define KVM_BOOKE_HV_MFSPR(reg, spr)
>>> +#endif
>>=20
>> Bleks - this is ugly.
>=20
> I agree :) But I opted to keep the optimizations done for 32-bit.
>=20
>> Do we really need to open-code the #ifdef here?
>=20
> 32-bit implementation fortunately use asm macros, we can't nest =
defines.
>=20
>> Can't the feature section code determine that the feature is disabled =
and
>> just always not include the code?
>=20
> CPU_FTR_EMB_HV is set even if KVM is not configured.

I don't get the point then. Why not have the whole DO_KVM masked under =
FTR_SECTION_IFSET(CPU_FTR_EMB_HV)? Are there book3s_64 implementations =
without HV? Can't we just mfspr unconditionally in DO_KVM?

>=20
>>=20
>>> +
>>> /* Exception prolog code for all exceptions */
>>> -#define EXCEPTION_PROLOG(n, type, srr0, srr1, addition)
>> \
>>> +#define EXCEPTION_PROLOG(n, intnum, type, srr0, srr1, addition)
>> 	    \
>>> 	mtspr	SPRN_SPRG_##type##_SCRATCH,r13;	/* get spare registers =
*/
>> \
>>> 	mfspr	r13,SPRN_SPRG_PACA;	/* get PACA */			 =
   \
>>> 	std	r10,PACA_EX##type+EX_R10(r13);				 =
   \
>>> 	std	r11,PACA_EX##type+EX_R11(r13);				 =
   \
>>> 	mfcr	r10;			/* save CR */			 =
   \
>>> +	KVM_BOOKE_HV_MFSPR(r11,srr1);			    		 =
   \
>>> +	DO_KVM	intnum,srr1;				    		 =
   \
>>=20
>> So if DO_KVM already knows srr1, why explicitly do something with it =
the
>> line above, and not in DO_KVM itself?
>=20
> srr1 is used to expand the interrupt handler symbol name while r11 is =
used
> for the actual MSR[GS] optimal check:
> 	mtocrf	0x80, r11

Right, so basically we want

#ifdef CONFIG_KVM
mfspr r11, spr
mtocrf 0x80, r11
beq ...
#endif

right?

>=20
>>> -/* Guest Doorbell */
>>> -	MASKABLE_EXCEPTION(0x2c0, guest_doorbell, .unknown_exception,
>> ACK_NONE)
>>> +/*
>>> + *	Guest doorbell interrupt
>>> + *	This general exception use GSRRx save/restore registers
>>> + */
>>> +	START_EXCEPTION(guest_doorbell);
>>> +	EXCEPTION_PROLOG(0x2c0, BOOKE_INTERRUPT_GUEST_DBELL, GEN,
>>> +			 SPRN_GSRR0, SPRN_GSRR1, PROLOG_ADDITION_NONE)
>>> +	EXCEPTION_COMMON(0x2c0, PACA_EXGEN, INTS_KEEP)
>>> +	addi	r3,r1,STACK_FRAME_OVERHEAD
>>> +	bl	.save_nvgprs
>>> +	INTS_RESTORE_HARD
>>> +	bl	.unknown_exception
>>> +	b	.ret_from_except
>>=20
>> This is independent of DO_KVM, right?
>=20
> Yes, just kvm_handler definitions in bookehv_interrupts.S depends on =
this.

Then please split it out into a separate patch.

>=20
>>=20
>>>=20
>>> /* Guest Doorbell critical Interrupt */
>>> 	START_EXCEPTION(guest_doorbell_crit);
>>> -	CRIT_EXCEPTION_PROLOG(0x2e0, PROLOG_ADDITION_NONE)
>>> +	CRIT_EXCEPTION_PROLOG(0x2e0, BOOKE_INTERRUPT_GUEST_DBELL_CRIT,
>>> +			      PROLOG_ADDITION_NONE)
>>=20
>> Shouldn't this one also use GSRR?
>=20
> No, this is a critical exception.

Ah, right. Looked at the wrong bit, sorry :).

>=20
>>>=20
>>> -.macro tlb_prolog_bolted addr
>>> +.macro tlb_prolog_bolted intnum addr
>>> 	mtspr	SPRN_SPRG_TLB_SCRATCH,r13
>>> 	mfspr	r13,SPRN_SPRG_PACA
>>> 	std	r10,PACA_EXTLB+EX_TLB_R10(r13)
>>> 	mfcr	r10
>>> 	std	r11,PACA_EXTLB+EX_TLB_R11(r13)
>>> +#ifdef CONFIG_KVM_BOOKE_HV
>>> +BEGIN_FTR_SECTION
>>> +	mfspr	r11, SPRN_SRR1
>>> +END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
>>> +#endif
>>=20
>> This thing really should vanish behind DO_KVM :)
>=20
> Then let's do it first for 32-bit ;)

You could #ifdef it in DO_KVM for 64-bit for now. IIRC it's not done on =
32-bit because the register value is used even beyond DO_KVM there.


Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Caraman Mihai Claudiu-B02008 <B02008@freescale.com>
Cc: "<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>,
	KVM list <kvm@vger.kernel.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks
Date: Wed, 04 Jul 2012 15:45:01 +0000	[thread overview]
Message-ID: <2526CB9E-4B5A-40EA-9CFC-DFCA4B09F375@suse.de> (raw)
In-Reply-To: <300B73AA675FCE4A93EB4FC1D42459FF15A6C6@039-SN2MPN1-013.039d.mgd.msft.net>


On 04.07.2012, at 17:27, Caraman Mihai Claudiu-B02008 wrote:

>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Wednesday, July 04, 2012 5:30 PM
>> To: Caraman Mihai Claudiu-B02008
>> Cc: <kvm-ppc@vger.kernel.org>; KVM list; linuxppc-dev; qemu-
>> ppc@nongnu.org List; Benjamin Herrenschmidt
>> Subject: Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM
>> kernel hooks
>> 
>> 
>> On 25.06.2012, at 14:26, Mihai Caraman wrote:
>> 
>>> Hook DO_KVM macro to 64-bit booke in a optimal way similar to 32-bit
>> booke
>>> see head_fsl_booke.S file. Extend interrupt handlers' parameter list
>> with
>>> interrupt vector numbers to accomodate the macro. Rework Guest Doorbell
>>> handler to use the proper GSRRx save/restore registers.
>>> Only the bolted version of tlb miss handers is addressed now.
>>> 
>>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>>> ---
>>> arch/powerpc/kernel/exceptions-64e.S |  114 ++++++++++++++++++++++++---
>> -------
>>> arch/powerpc/mm/tlb_low_64e.S        |   14 +++-
>>> 2 files changed, 92 insertions(+), 36 deletions(-)
>>> 
>>> diff --git a/arch/powerpc/kernel/exceptions-64e.S
>> b/arch/powerpc/kernel/exceptions-64e.S
>>> index 06f7aec..a60f81f 100644
>>> --- a/arch/powerpc/kernel/exceptions-64e.S
>>> +++ b/arch/powerpc/kernel/exceptions-64e.S
>>> @@ -25,6 +25,8 @@
>>> #include <asm/ppc-opcode.h>
>>> #include <asm/mmu.h>
>>> #include <asm/hw_irq.h>
>>> +#include <asm/kvm_asm.h>
>>> +#include <asm/kvm_booke_hv_asm.h>
>>> 
>>> /* XXX This will ultimately add space for a special exception save
>>> *     structure used to save things like SRR0/SRR1, SPRGs, MAS, etc...
>>> @@ -34,13 +36,24 @@
>>> */
>>> #define	SPECIAL_EXC_FRAME_SIZE	INT_FRAME_SIZE
>>> 
>>> +#ifdef CONFIG_KVM_BOOKE_HV
>>> +#define KVM_BOOKE_HV_MFSPR(reg, spr)				\
>>> +	BEGIN_FTR_SECTION					\
>>> +		mfspr	reg, spr;			  	\
>>> +	END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
>>> +#else
>>> +#define KVM_BOOKE_HV_MFSPR(reg, spr)
>>> +#endif
>> 
>> Bleks - this is ugly.
> 
> I agree :) But I opted to keep the optimizations done for 32-bit.
> 
>> Do we really need to open-code the #ifdef here?
> 
> 32-bit implementation fortunately use asm macros, we can't nest defines.
> 
>> Can't the feature section code determine that the feature is disabled and
>> just always not include the code?
> 
> CPU_FTR_EMB_HV is set even if KVM is not configured.

I don't get the point then. Why not have the whole DO_KVM masked under FTR_SECTION_IFSET(CPU_FTR_EMB_HV)? Are there book3s_64 implementations without HV? Can't we just mfspr unconditionally in DO_KVM?

> 
>> 
>>> +
>>> /* Exception prolog code for all exceptions */
>>> -#define EXCEPTION_PROLOG(n, type, srr0, srr1, addition)
>> \
>>> +#define EXCEPTION_PROLOG(n, intnum, type, srr0, srr1, addition)
>> 	    \
>>> 	mtspr	SPRN_SPRG_##type##_SCRATCH,r13;	/* get spare registers */
>> \
>>> 	mfspr	r13,SPRN_SPRG_PACA;	/* get PACA */			    \
>>> 	std	r10,PACA_EX##type+EX_R10(r13);				    \
>>> 	std	r11,PACA_EX##type+EX_R11(r13);				    \
>>> 	mfcr	r10;			/* save CR */			    \
>>> +	KVM_BOOKE_HV_MFSPR(r11,srr1);			    		    \
>>> +	DO_KVM	intnum,srr1;				    		    \
>> 
>> So if DO_KVM already knows srr1, why explicitly do something with it the
>> line above, and not in DO_KVM itself?
> 
> srr1 is used to expand the interrupt handler symbol name while r11 is used
> for the actual MSR[GS] optimal check:
> 	mtocrf	0x80, r11

Right, so basically we want

#ifdef CONFIG_KVM
mfspr r11, spr
mtocrf 0x80, r11
beq ...
#endif

right?

> 
>>> -/* Guest Doorbell */
>>> -	MASKABLE_EXCEPTION(0x2c0, guest_doorbell, .unknown_exception,
>> ACK_NONE)
>>> +/*
>>> + *	Guest doorbell interrupt
>>> + *	This general exception use GSRRx save/restore registers
>>> + */
>>> +	START_EXCEPTION(guest_doorbell);
>>> +	EXCEPTION_PROLOG(0x2c0, BOOKE_INTERRUPT_GUEST_DBELL, GEN,
>>> +			 SPRN_GSRR0, SPRN_GSRR1, PROLOG_ADDITION_NONE)
>>> +	EXCEPTION_COMMON(0x2c0, PACA_EXGEN, INTS_KEEP)
>>> +	addi	r3,r1,STACK_FRAME_OVERHEAD
>>> +	bl	.save_nvgprs
>>> +	INTS_RESTORE_HARD
>>> +	bl	.unknown_exception
>>> +	b	.ret_from_except
>> 
>> This is independent of DO_KVM, right?
> 
> Yes, just kvm_handler definitions in bookehv_interrupts.S depends on this.

Then please split it out into a separate patch.

> 
>> 
>>> 
>>> /* Guest Doorbell critical Interrupt */
>>> 	START_EXCEPTION(guest_doorbell_crit);
>>> -	CRIT_EXCEPTION_PROLOG(0x2e0, PROLOG_ADDITION_NONE)
>>> +	CRIT_EXCEPTION_PROLOG(0x2e0, BOOKE_INTERRUPT_GUEST_DBELL_CRIT,
>>> +			      PROLOG_ADDITION_NONE)
>> 
>> Shouldn't this one also use GSRR?
> 
> No, this is a critical exception.

Ah, right. Looked at the wrong bit, sorry :).

> 
>>> 
>>> -.macro tlb_prolog_bolted addr
>>> +.macro tlb_prolog_bolted intnum addr
>>> 	mtspr	SPRN_SPRG_TLB_SCRATCH,r13
>>> 	mfspr	r13,SPRN_SPRG_PACA
>>> 	std	r10,PACA_EXTLB+EX_TLB_R10(r13)
>>> 	mfcr	r10
>>> 	std	r11,PACA_EXTLB+EX_TLB_R11(r13)
>>> +#ifdef CONFIG_KVM_BOOKE_HV
>>> +BEGIN_FTR_SECTION
>>> +	mfspr	r11, SPRN_SRR1
>>> +END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
>>> +#endif
>> 
>> This thing really should vanish behind DO_KVM :)
> 
> Then let's do it first for 32-bit ;)

You could #ifdef it in DO_KVM for 64-bit for now. IIRC it's not done on 32-bit because the register value is used even beyond DO_KVM there.


Alex


  reply	other threads:[~2012-07-04 15:45 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
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 [this message]
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=2526CB9E-4B5A-40EA-9CFC-DFCA4B09F375@suse.de \
    --to=agraf@suse.de \
    --cc=B02008@freescale.com \
    --cc=benh@kernel.crashing.org \
    --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.