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

Commit 03604b31 authored by Marcelo Tosatti's avatar Marcelo Tosatti
Browse files

Merge branch 'for-upstream' of http://github.com/agraf/linux-2.6 into queue

* 'for-upstream' of http://github.com/agraf/linux-2.6: (56 commits)
  arch/powerpc/kvm/e500_tlb.c: fix error return code
  KVM: PPC: Book3S HV: Provide a way for userspace to get/set per-vCPU areas
  KVM: PPC: Book3S: Get/set guest FP regs using the GET/SET_ONE_REG interface
  KVM: PPC: Book3S: Get/set guest SPRs using the GET/SET_ONE_REG interface
  KVM: PPC: set IN_GUEST_MODE before checking requests
  KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages
  KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  KVM: PPC: Book3S HV: Fix calculation of guest phys address for MMIO emulation
  KVM: PPC: Book3S HV: Remove bogus update of physical thread IDs
  KVM: PPC: Book3S HV: Fix updates of vcpu->cpu
  KVM: Move some PPC ioctl definitions to the correct place
  KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly
  KVM: PPC: Move kvm->arch.slot_phys into memslot.arch
  KVM: PPC: Book3S HV: Take the SRCU read lock before looking up memslots
  KVM: PPC: bookehv: Allow duplicate calls of DO_KVM macro
  KVM: PPC: BookE: Support FPU on non-hv systems
  KVM: PPC: 440: Implement mfdcrx
  KVM: PPC: 440: Implement mtdcrx
  Document IACx/DACx registers access using ONE_REG API
  KVM: PPC: E500: Remove E500_TLB_DIRTY flag
  ...
parents 87cac8f8 12ecd957
Loading
Loading
Loading
Loading
+45 −4
Original line number Original line Diff line number Diff line
@@ -1194,12 +1194,15 @@ struct kvm_ppc_pvinfo {
This ioctl fetches PV specific information that need to be passed to the guest
This ioctl fetches PV specific information that need to be passed to the guest
using the device tree or other means from vm context.
using the device tree or other means from vm context.


For now the only implemented piece of information distributed here is an array
The hcall array defines 4 instructions that make up a hypercall.
of 4 instructions that make up a hypercall.


If any additional field gets added to this structure later on, a bit for that
If any additional field gets added to this structure later on, a bit for that
additional piece of information will be set in the flags bitmap.
additional piece of information will be set in the flags bitmap.


The flags bitmap is defined as:

   /* the host supports the ePAPR idle hcall
   #define KVM_PPC_PVINFO_FLAGS_EV_IDLE   (1<<0)


4.48 KVM_ASSIGN_PCI_DEVICE
4.48 KVM_ASSIGN_PCI_DEVICE


@@ -1731,7 +1734,45 @@ registers, find a list below:
  Arch  |       Register        | Width (bits)
  Arch  |       Register        | Width (bits)
        |                       |
        |                       |
  PPC   | KVM_REG_PPC_HIOR      | 64
  PPC   | KVM_REG_PPC_HIOR      | 64

  PPC   | KVM_REG_PPC_IAC1      | 64
  PPC   | KVM_REG_PPC_IAC2      | 64
  PPC   | KVM_REG_PPC_IAC3      | 64
  PPC   | KVM_REG_PPC_IAC4      | 64
  PPC   | KVM_REG_PPC_DAC1      | 64
  PPC   | KVM_REG_PPC_DAC2      | 64
  PPC   | KVM_REG_PPC_DABR      | 64
  PPC   | KVM_REG_PPC_DSCR      | 64
  PPC   | KVM_REG_PPC_PURR      | 64
  PPC   | KVM_REG_PPC_SPURR     | 64
  PPC   | KVM_REG_PPC_DAR       | 64
  PPC   | KVM_REG_PPC_DSISR     | 32
  PPC   | KVM_REG_PPC_AMR       | 64
  PPC   | KVM_REG_PPC_UAMOR     | 64
  PPC   | KVM_REG_PPC_MMCR0     | 64
  PPC   | KVM_REG_PPC_MMCR1     | 64
  PPC   | KVM_REG_PPC_MMCRA     | 64
  PPC   | KVM_REG_PPC_PMC1      | 32
  PPC   | KVM_REG_PPC_PMC2      | 32
  PPC   | KVM_REG_PPC_PMC3      | 32
  PPC   | KVM_REG_PPC_PMC4      | 32
  PPC   | KVM_REG_PPC_PMC5      | 32
  PPC   | KVM_REG_PPC_PMC6      | 32
  PPC   | KVM_REG_PPC_PMC7      | 32
  PPC   | KVM_REG_PPC_PMC8      | 32
  PPC   | KVM_REG_PPC_FPR0      | 64
          ...
  PPC   | KVM_REG_PPC_FPR31     | 64
  PPC   | KVM_REG_PPC_VR0       | 128
          ...
  PPC   | KVM_REG_PPC_VR31      | 128
  PPC   | KVM_REG_PPC_VSR0      | 128
          ...
  PPC   | KVM_REG_PPC_VSR31     | 128
  PPC   | KVM_REG_PPC_FPSCR     | 64
  PPC   | KVM_REG_PPC_VSCR      | 32
  PPC   | KVM_REG_PPC_VPA_ADDR  | 64
  PPC   | KVM_REG_PPC_VPA_SLB   | 128
  PPC   | KVM_REG_PPC_VPA_DTL   | 128


4.69 KVM_GET_ONE_REG
4.69 KVM_GET_ONE_REG


@@ -1747,7 +1788,7 @@ kvm_one_reg struct passed in. On success, the register value can be found
at the memory location pointed to by "addr".
at the memory location pointed to by "addr".


The list of registers accessible using this interface is identical to the
The list of registers accessible using this interface is identical to the
list in 4.64.
list in 4.68.




4.70 KVM_KVMCLOCK_CTRL
4.70 KVM_KVMCLOCK_CTRL
+1 −0
Original line number Original line Diff line number Diff line
@@ -34,5 +34,6 @@ header-y += termios.h
header-y += types.h
header-y += types.h
header-y += ucontext.h
header-y += ucontext.h
header-y += unistd.h
header-y += unistd.h
header-y += epapr_hcalls.h


generic-y += rwsem.h
generic-y += rwsem.h
+19 −17
Original line number Original line Diff line number Diff line
@@ -50,10 +50,6 @@
#ifndef _EPAPR_HCALLS_H
#ifndef _EPAPR_HCALLS_H
#define _EPAPR_HCALLS_H
#define _EPAPR_HCALLS_H


#include <linux/types.h>
#include <linux/errno.h>
#include <asm/byteorder.h>

#define EV_BYTE_CHANNEL_SEND		1
#define EV_BYTE_CHANNEL_SEND		1
#define EV_BYTE_CHANNEL_RECEIVE		2
#define EV_BYTE_CHANNEL_RECEIVE		2
#define EV_BYTE_CHANNEL_POLL		3
#define EV_BYTE_CHANNEL_POLL		3
@@ -88,7 +84,8 @@
#define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num))
#define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num))
#define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num)
#define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num)


/* epapr error codes */
/* epapr return codes */
#define EV_SUCCESS		0
#define EV_EPERM		1	/* Operation not permitted */
#define EV_EPERM		1	/* Operation not permitted */
#define EV_ENOENT		2	/*  Entry Not Found */
#define EV_ENOENT		2	/*  Entry Not Found */
#define EV_EIO			3	/* I/O error occured */
#define EV_EIO			3	/* I/O error occured */
@@ -108,6 +105,11 @@
#define EV_UNIMPLEMENTED	12	/* Unimplemented hypercall */
#define EV_UNIMPLEMENTED	12	/* Unimplemented hypercall */
#define EV_BUFFER_OVERFLOW	13	/* Caller-supplied buffer too small */
#define EV_BUFFER_OVERFLOW	13	/* Caller-supplied buffer too small */


#ifndef __ASSEMBLY__
#include <linux/types.h>
#include <linux/errno.h>
#include <asm/byteorder.h>

/*
/*
 * Hypercall register clobber list
 * Hypercall register clobber list
 *
 *
@@ -193,7 +195,7 @@ static inline unsigned int ev_int_set_config(unsigned int interrupt,
	r5  = priority;
	r5  = priority;
	r6  = destination;
	r6  = destination;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6)
		: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6)
		: : EV_HCALL_CLOBBERS4
		: : EV_HCALL_CLOBBERS4
	);
	);
@@ -222,7 +224,7 @@ static inline unsigned int ev_int_get_config(unsigned int interrupt,
	r11 = EV_HCALL_TOKEN(EV_INT_GET_CONFIG);
	r11 = EV_HCALL_TOKEN(EV_INT_GET_CONFIG);
	r3 = interrupt;
	r3 = interrupt;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5), "=r" (r6)
		: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5), "=r" (r6)
		: : EV_HCALL_CLOBBERS4
		: : EV_HCALL_CLOBBERS4
	);
	);
@@ -252,7 +254,7 @@ static inline unsigned int ev_int_set_mask(unsigned int interrupt,
	r3 = interrupt;
	r3 = interrupt;
	r4 = mask;
	r4 = mask;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -277,7 +279,7 @@ static inline unsigned int ev_int_get_mask(unsigned int interrupt,
	r11 = EV_HCALL_TOKEN(EV_INT_GET_MASK);
	r11 = EV_HCALL_TOKEN(EV_INT_GET_MASK);
	r3 = interrupt;
	r3 = interrupt;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -305,7 +307,7 @@ static inline unsigned int ev_int_eoi(unsigned int interrupt)
	r11 = EV_HCALL_TOKEN(EV_INT_EOI);
	r11 = EV_HCALL_TOKEN(EV_INT_EOI);
	r3 = interrupt;
	r3 = interrupt;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -344,7 +346,7 @@ static inline unsigned int ev_byte_channel_send(unsigned int handle,
	r7 = be32_to_cpu(p[2]);
	r7 = be32_to_cpu(p[2]);
	r8 = be32_to_cpu(p[3]);
	r8 = be32_to_cpu(p[3]);


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3),
		: "+r" (r11), "+r" (r3),
		  "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r8)
		  "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r8)
		: : EV_HCALL_CLOBBERS6
		: : EV_HCALL_CLOBBERS6
@@ -383,7 +385,7 @@ static inline unsigned int ev_byte_channel_receive(unsigned int handle,
	r3 = handle;
	r3 = handle;
	r4 = *count;
	r4 = *count;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4),
		: "+r" (r11), "+r" (r3), "+r" (r4),
		  "=r" (r5), "=r" (r6), "=r" (r7), "=r" (r8)
		  "=r" (r5), "=r" (r6), "=r" (r7), "=r" (r8)
		: : EV_HCALL_CLOBBERS6
		: : EV_HCALL_CLOBBERS6
@@ -421,7 +423,7 @@ static inline unsigned int ev_byte_channel_poll(unsigned int handle,
	r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_POLL);
	r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_POLL);
	r3 = handle;
	r3 = handle;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5)
		: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5)
		: : EV_HCALL_CLOBBERS3
		: : EV_HCALL_CLOBBERS3
	);
	);
@@ -454,7 +456,7 @@ static inline unsigned int ev_int_iack(unsigned int handle,
	r11 = EV_HCALL_TOKEN(EV_INT_IACK);
	r11 = EV_HCALL_TOKEN(EV_INT_IACK);
	r3 = handle;
	r3 = handle;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -478,7 +480,7 @@ static inline unsigned int ev_doorbell_send(unsigned int handle)
	r11 = EV_HCALL_TOKEN(EV_DOORBELL_SEND);
	r11 = EV_HCALL_TOKEN(EV_DOORBELL_SEND);
	r3 = handle;
	r3 = handle;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -498,12 +500,12 @@ static inline unsigned int ev_idle(void)


	r11 = EV_HCALL_TOKEN(EV_IDLE);
	r11 = EV_HCALL_TOKEN(EV_IDLE);


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "=r" (r3)
		: "+r" (r11), "=r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);


	return r3;
	return r3;
}
}

#endif /* !__ASSEMBLY__ */
#endif
#endif
+18 −18
Original line number Original line Diff line number Diff line
@@ -96,7 +96,7 @@ static inline unsigned int fh_send_nmi(unsigned int vcpu_mask)
	r11 = FH_HCALL_TOKEN(FH_SEND_NMI);
	r11 = FH_HCALL_TOKEN(FH_SEND_NMI);
	r3 = vcpu_mask;
	r3 = vcpu_mask;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -151,7 +151,7 @@ static inline unsigned int fh_partition_get_dtprop(int handle,
	r9 = (uint32_t)propvalue_addr;
	r9 = (uint32_t)propvalue_addr;
	r10 = *propvalue_len;
	r10 = *propvalue_len;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11),
		: "+r" (r11),
		  "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
		  "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
		  "+r" (r8), "+r" (r9), "+r" (r10)
		  "+r" (r8), "+r" (r9), "+r" (r10)
@@ -205,7 +205,7 @@ static inline unsigned int fh_partition_set_dtprop(int handle,
	r9 = (uint32_t)propvalue_addr;
	r9 = (uint32_t)propvalue_addr;
	r10 = propvalue_len;
	r10 = propvalue_len;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11),
		: "+r" (r11),
		  "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
		  "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
		  "+r" (r8), "+r" (r9), "+r" (r10)
		  "+r" (r8), "+r" (r9), "+r" (r10)
@@ -229,7 +229,7 @@ static inline unsigned int fh_partition_restart(unsigned int partition)
	r11 = FH_HCALL_TOKEN(FH_PARTITION_RESTART);
	r11 = FH_HCALL_TOKEN(FH_PARTITION_RESTART);
	r3 = partition;
	r3 = partition;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -262,7 +262,7 @@ static inline unsigned int fh_partition_get_status(unsigned int partition,
	r11 = FH_HCALL_TOKEN(FH_PARTITION_GET_STATUS);
	r11 = FH_HCALL_TOKEN(FH_PARTITION_GET_STATUS);
	r3 = partition;
	r3 = partition;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -295,7 +295,7 @@ static inline unsigned int fh_partition_start(unsigned int partition,
	r4 = entry_point;
	r4 = entry_point;
	r5 = load;
	r5 = load;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5)
		: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5)
		: : EV_HCALL_CLOBBERS3
		: : EV_HCALL_CLOBBERS3
	);
	);
@@ -317,7 +317,7 @@ static inline unsigned int fh_partition_stop(unsigned int partition)
	r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP);
	r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP);
	r3 = partition;
	r3 = partition;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -376,7 +376,7 @@ static inline unsigned int fh_partition_memcpy(unsigned int source,
#endif
#endif
	r7 = count;
	r7 = count;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11),
		: "+r" (r11),
		  "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7)
		  "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7)
		: : EV_HCALL_CLOBBERS5
		: : EV_HCALL_CLOBBERS5
@@ -399,7 +399,7 @@ static inline unsigned int fh_dma_enable(unsigned int liodn)
	r11 = FH_HCALL_TOKEN(FH_DMA_ENABLE);
	r11 = FH_HCALL_TOKEN(FH_DMA_ENABLE);
	r3 = liodn;
	r3 = liodn;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -421,7 +421,7 @@ static inline unsigned int fh_dma_disable(unsigned int liodn)
	r11 = FH_HCALL_TOKEN(FH_DMA_DISABLE);
	r11 = FH_HCALL_TOKEN(FH_DMA_DISABLE);
	r3 = liodn;
	r3 = liodn;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -447,7 +447,7 @@ static inline unsigned int fh_vmpic_get_msir(unsigned int interrupt,
	r11 = FH_HCALL_TOKEN(FH_VMPIC_GET_MSIR);
	r11 = FH_HCALL_TOKEN(FH_VMPIC_GET_MSIR);
	r3 = interrupt;
	r3 = interrupt;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: "+r" (r11), "+r" (r3), "=r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -469,7 +469,7 @@ static inline unsigned int fh_system_reset(void)


	r11 = FH_HCALL_TOKEN(FH_SYSTEM_RESET);
	r11 = FH_HCALL_TOKEN(FH_SYSTEM_RESET);


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "=r" (r3)
		: "+r" (r11), "=r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -506,7 +506,7 @@ static inline unsigned int fh_err_get_info(int queue, uint32_t *bufsize,
	r6 = addr_lo;
	r6 = addr_lo;
	r7 = peek;
	r7 = peek;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6),
		: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6),
		  "+r" (r7)
		  "+r" (r7)
		: : EV_HCALL_CLOBBERS5
		: : EV_HCALL_CLOBBERS5
@@ -542,7 +542,7 @@ static inline unsigned int fh_get_core_state(unsigned int handle,
	r3 = handle;
	r3 = handle;
	r4 = vcpu;
	r4 = vcpu;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -572,7 +572,7 @@ static inline unsigned int fh_enter_nap(unsigned int handle, unsigned int vcpu)
	r3 = handle;
	r3 = handle;
	r4 = vcpu;
	r4 = vcpu;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -597,7 +597,7 @@ static inline unsigned int fh_exit_nap(unsigned int handle, unsigned int vcpu)
	r3 = handle;
	r3 = handle;
	r4 = vcpu;
	r4 = vcpu;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: "+r" (r11), "+r" (r3), "+r" (r4)
		: : EV_HCALL_CLOBBERS2
		: : EV_HCALL_CLOBBERS2
	);
	);
@@ -618,7 +618,7 @@ static inline unsigned int fh_claim_device(unsigned int handle)
	r11 = FH_HCALL_TOKEN(FH_CLAIM_DEVICE);
	r11 = FH_HCALL_TOKEN(FH_CLAIM_DEVICE);
	r3 = handle;
	r3 = handle;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
@@ -645,7 +645,7 @@ static inline unsigned int fh_partition_stop_dma(unsigned int handle)
	r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP_DMA);
	r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP_DMA);
	r3 = handle;
	r3 = handle;


	__asm__ __volatile__ ("sc 1"
	asm volatile("bl	epapr_hypercall_start"
		: "+r" (r11), "+r" (r3)
		: "+r" (r11), "+r" (r3)
		: : EV_HCALL_CLOBBERS1
		: : EV_HCALL_CLOBBERS1
	);
	);
+59 −0
Original line number Original line Diff line number Diff line
@@ -221,6 +221,12 @@ struct kvm_sregs {


			__u32 dbsr;	/* KVM_SREGS_E_UPDATE_DBSR */
			__u32 dbsr;	/* KVM_SREGS_E_UPDATE_DBSR */
			__u32 dbcr[3];
			__u32 dbcr[3];
			/*
			 * iac/dac registers are 64bit wide, while this API
			 * interface provides only lower 32 bits on 64 bit
			 * processors. ONE_REG interface is added for 64bit
			 * iac/dac registers.
			 */
			__u32 iac[4];
			__u32 iac[4];
			__u32 dac[2];
			__u32 dac[2];
			__u32 dvc[2];
			__u32 dvc[2];
@@ -326,5 +332,58 @@ struct kvm_book3e_206_tlb_params {
};
};


#define KVM_REG_PPC_HIOR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1)
#define KVM_REG_PPC_HIOR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1)
#define KVM_REG_PPC_IAC1	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x2)
#define KVM_REG_PPC_IAC2	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3)
#define KVM_REG_PPC_IAC3	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x4)
#define KVM_REG_PPC_IAC4	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x5)
#define KVM_REG_PPC_DAC1	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x6)
#define KVM_REG_PPC_DAC2	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x7)
#define KVM_REG_PPC_DABR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8)
#define KVM_REG_PPC_DSCR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x9)
#define KVM_REG_PPC_PURR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xa)
#define KVM_REG_PPC_SPURR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb)
#define KVM_REG_PPC_DAR		(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc)
#define KVM_REG_PPC_DSISR	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xd)
#define KVM_REG_PPC_AMR		(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xe)
#define KVM_REG_PPC_UAMOR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xf)

#define KVM_REG_PPC_MMCR0	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x10)
#define KVM_REG_PPC_MMCR1	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x11)
#define KVM_REG_PPC_MMCRA	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12)

#define KVM_REG_PPC_PMC1	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x18)
#define KVM_REG_PPC_PMC2	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x19)
#define KVM_REG_PPC_PMC3	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1a)
#define KVM_REG_PPC_PMC4	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1b)
#define KVM_REG_PPC_PMC5	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1c)
#define KVM_REG_PPC_PMC6	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1d)
#define KVM_REG_PPC_PMC7	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1e)
#define KVM_REG_PPC_PMC8	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x1f)

/* 32 floating-point registers */
#define KVM_REG_PPC_FPR0	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x20)
#define KVM_REG_PPC_FPR(n)	(KVM_REG_PPC_FPR0 + (n))
#define KVM_REG_PPC_FPR31	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3f)

/* 32 VMX/Altivec vector registers */
#define KVM_REG_PPC_VR0		(KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x40)
#define KVM_REG_PPC_VR(n)	(KVM_REG_PPC_VR0 + (n))
#define KVM_REG_PPC_VR31	(KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x5f)

/* 32 double-width FP registers for VSX */
/* High-order halves overlap with FP regs */
#define KVM_REG_PPC_VSR0	(KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x60)
#define KVM_REG_PPC_VSR(n)	(KVM_REG_PPC_VSR0 + (n))
#define KVM_REG_PPC_VSR31	(KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x7f)

/* FP and vector status/control registers */
#define KVM_REG_PPC_FPSCR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x80)
#define KVM_REG_PPC_VSCR	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x81)

/* Virtual processor areas */
/* For SLB & DTL, address in high (first) half, length in low half */
#define KVM_REG_PPC_VPA_ADDR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x82)
#define KVM_REG_PPC_VPA_SLB	(KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x83)
#define KVM_REG_PPC_VPA_DTL	(KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x84)


#endif /* __LINUX_KVM_POWERPC_H */
#endif /* __LINUX_KVM_POWERPC_H */
Loading