Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53ea2e46 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

Merge tag 'signed-kvm-ppc-next' of git://github.com/agraf/linux-2.6 into kvm-next

Patch queue for ppc - 2014-05-30

In this round we have a few nice gems. PR KVM gains initial POWER8 support
as well as LE host awareness, ihe e500 targets can now properly run u-boot,
LE guests now work with PR KVM including KVM hypercalls and HV KVM guests
can now use huge pages.

On top of this there are some bug fixes.

Conflicts:
	include/uapi/linux/kvm.h
parents ee1a725f d8d164a9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1794,6 +1794,11 @@ registers, find a list below:
  PPC   | KVM_REG_PPC_MMCR0     | 64
  PPC   | KVM_REG_PPC_MMCR1     | 64
  PPC   | KVM_REG_PPC_MMCRA     | 64
  PPC   | KVM_REG_PPC_MMCR2     | 64
  PPC   | KVM_REG_PPC_MMCRS     | 64
  PPC   | KVM_REG_PPC_SIAR      | 64
  PPC   | KVM_REG_PPC_SDAR      | 64
  PPC   | KVM_REG_PPC_SIER      | 64
  PPC   | KVM_REG_PPC_PMC1      | 32
  PPC   | KVM_REG_PPC_PMC2      | 32
  PPC   | KVM_REG_PPC_PMC3      | 32
@@ -1868,6 +1873,7 @@ registers, find a list below:
  PPC   | KVM_REG_PPC_PPR	| 64
  PPC   | KVM_REG_PPC_ARCH_COMPAT 32
  PPC   | KVM_REG_PPC_DABRX     | 32
  PPC   | KVM_REG_PPC_WORT      | 64
  PPC   | KVM_REG_PPC_TM_GPR0	| 64
          ...
  PPC   | KVM_REG_PPC_TM_GPR31	| 64
+14 −0
Original line number Diff line number Diff line
@@ -94,10 +94,24 @@ a bitmap of available features inside the magic page.
The following enhancements to the magic page are currently available:

  KVM_MAGIC_FEAT_SR		Maps SR registers r/w in the magic page
  KVM_MAGIC_FEAT_MAS0_TO_SPRG7	Maps MASn, ESR, PIR and high SPRGs

For enhanced features in the magic page, please check for the existence of the
feature before using them!

Magic page flags
================

In addition to features that indicate whether a host is capable of a particular
feature we also have a channel for a guest to tell the guest whether it's capable
of something. This is what we call "flags".

Flags are passed to the host in the low 12 bits of the Effective Address.

The following flags are currently available for a guest to expose:

  MAGIC_PAGE_FLAG_NOT_MAPPED_NX Guest handles NX bits correclty wrt magic page

MSR bits
========

+34 −0
Original line number Diff line number Diff line
@@ -81,4 +81,38 @@ static inline unsigned int get_oc(u32 inst)
{
	return (inst >> 11) & 0x7fff;
}

#define IS_XFORM(inst)	(get_op(inst)  == 31)
#define IS_DSFORM(inst)	(get_op(inst) >= 56)

/*
 * Create a DSISR value from the instruction
 */
static inline unsigned make_dsisr(unsigned instr)
{
	unsigned dsisr;


	/* bits  6:15 --> 22:31 */
	dsisr = (instr & 0x03ff0000) >> 16;

	if (IS_XFORM(instr)) {
		/* bits 29:30 --> 15:16 */
		dsisr |= (instr & 0x00000006) << 14;
		/* bit     25 -->    17 */
		dsisr |= (instr & 0x00000040) << 8;
		/* bits 21:24 --> 18:21 */
		dsisr |= (instr & 0x00000780) << 3;
	} else {
		/* bit      5 -->    17 */
		dsisr |= (instr & 0x04000000) >> 12;
		/* bits  1: 4 --> 18:21 */
		dsisr |= (instr & 0x78000000) >> 17;
		/* bits 30:31 --> 12:13 */
		if (IS_DSFORM(instr))
			dsisr |= (instr & 0x00000003) << 18;
	}

	return dsisr;
}
#endif /* __ASM_PPC_DISASSEMBLE_H__ */
+10 −8
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@
#define BOOK3S_INTERRUPT_PERFMON	0xf00
#define BOOK3S_INTERRUPT_ALTIVEC	0xf20
#define BOOK3S_INTERRUPT_VSX		0xf40
#define BOOK3S_INTERRUPT_FAC_UNAVAIL	0xf60
#define BOOK3S_INTERRUPT_H_FAC_UNAVAIL	0xf80

#define BOOK3S_IRQPRIO_SYSTEM_RESET		0
@@ -114,14 +115,15 @@
#define BOOK3S_IRQPRIO_FP_UNAVAIL		7
#define BOOK3S_IRQPRIO_ALTIVEC			8
#define BOOK3S_IRQPRIO_VSX			9
#define BOOK3S_IRQPRIO_SYSCALL			10
#define BOOK3S_IRQPRIO_MACHINE_CHECK		11
#define BOOK3S_IRQPRIO_DEBUG			12
#define BOOK3S_IRQPRIO_EXTERNAL			13
#define BOOK3S_IRQPRIO_DECREMENTER		14
#define BOOK3S_IRQPRIO_PERFORMANCE_MONITOR	15
#define BOOK3S_IRQPRIO_EXTERNAL_LEVEL		16
#define BOOK3S_IRQPRIO_MAX			17
#define BOOK3S_IRQPRIO_FAC_UNAVAIL		10
#define BOOK3S_IRQPRIO_SYSCALL			11
#define BOOK3S_IRQPRIO_MACHINE_CHECK		12
#define BOOK3S_IRQPRIO_DEBUG			13
#define BOOK3S_IRQPRIO_EXTERNAL			14
#define BOOK3S_IRQPRIO_DECREMENTER		15
#define BOOK3S_IRQPRIO_PERFORMANCE_MONITOR	16
#define BOOK3S_IRQPRIO_EXTERNAL_LEVEL		17
#define BOOK3S_IRQPRIO_MAX			18

#define BOOK3S_HFLAG_DCBZ32			0x1
#define BOOK3S_HFLAG_SLB			0x2
+2 −1
Original line number Diff line number Diff line
@@ -268,9 +268,10 @@ static inline ulong kvmppc_get_pc(struct kvm_vcpu *vcpu)
	return vcpu->arch.pc;
}

static inline u64 kvmppc_get_msr(struct kvm_vcpu *vcpu);
static inline bool kvmppc_need_byteswap(struct kvm_vcpu *vcpu)
{
	return (vcpu->arch.shared->msr & MSR_LE) != (MSR_KERNEL & MSR_LE);
	return (kvmppc_get_msr(vcpu) & MSR_LE) != (MSR_KERNEL & MSR_LE);
}

static inline u32 kvmppc_get_last_inst_internal(struct kvm_vcpu *vcpu, ulong pc)
Loading