to handle, we branch to the
relocation-on version of the interrupt vector.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv_builtin.c| 38 ++---
arch/powerpc/kvm/book3s_hv_rm_xics.c| 8 +++
arch/power
ush, this moves the clearing of the bit from before the
actual flush to after it. This way, two threads might both do the
flush, but we prevent the situation where one thread can enter the
guest before the flush is finished.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/in
If the guest is in radix mode, then it doesn't have a hashed page
table (HPT), so all of the hypercalls that manipulate the HPT can't
work and should return an error. This adds checks to make them
return H_FUNCTION ("function not supported").
Signed-off-by: Paul Mackerras <pau.
e.g., when the page was paged out). This bitmap
is stored in the first half of the memslot->dirty_bitmap area, and
kvm_vm_ioctl_get_dirty_log_hv() now uses the second half for the
bitmap that gets returned to userspace.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc
need to traverse
rmap chains.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_book3s.h | 6
arch/powerpc/kvm/book3s_64_mmu_hv.c| 64 +++---
arch/powerpc/kvm/book3s_64_mmu_radix.c | 54
3
This adds the code to construct the second-level ("partition-scoped" in
architecturese) page tables for guests using the radix MMU. Apart from
the PGD level, which is allocated when the guest is created, the rest
of the tree is all constructed in response to hypervisor page faults.
As well as
register.
On hypervisor data/instruction storage interrupts, we don't do the
guest HPT lookup on radix, but just save the guest physical address
for the fault (from the ASDR register) in the vcpu struct.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_
-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_book3s.h| 3 +
arch/powerpc/include/asm/kvm_book3s_64.h | 6 ++
arch/powerpc/include/asm/kvm_host.h | 2 +
arch/powerpc/kvm/Makefile| 3 +-
arch/powerpc/kvm/book3s_64_mmu_hv.c | 10 ++-
address of the
access.)
Thus, for HPT guests on POWER9, we can use this register rather
than looking up the SLB with the slbfee. instruction.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 8
1 file changed, 8 insertions(+)
diff --git
This adds the implementation of the KVM_PPC_CONFIGURE_V3_MMU ioctl
for HPT guests on POWER9. With this, we can return 1 for the
KVM_CAP_PPC_MMU_HASH_V3 capability.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_host.h | 1 +
arch/powerpc/kvm/book3
for the TLB invalidate entry instruction.
Initially, both capabilities return 0 and the ioctls return -EINVAL,
until the necessary infrastructure for them to operate correctly
is added.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
Documentation/virtual/kvm/api.txt
occur with relocation on in radix guests.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/exception-64s.h | 10 +++---
arch/powerpc/kernel/exceptions-64s.S | 53 +---
2 files changed, 34 insertions(+), 29 deletions(-)
diff --git
if the partition was previously a radix
partition and 0 if it was a HPT partition. This implements that
logic.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/mm/pgtable_64.c | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/mm/pgta
This exports the pgtable_cache array and the pgtable_cache_add
function so that HV KVM can use them for allocating radix page
tables for guests.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/mm/init-common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff
This adds definitions for bits in the DSISR register which are used
by POWER9 for various translation-related exception conditions, and
for some more bits in the partition table entry that will be needed
by KVM.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/inclu
table, which points to the
radix tree for each process, we need to install that using the
H_REGISTER_PROC_TBL hcall.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/book3s/64/mmu.h | 2 ++
arch/powerpc/include/asm/hvcall.h| 11 +++
arch/p
tion
is in byte 21 not byte 15.
Note none of these options are actually looked up in
"ibm,architecture-vec-5" at this time, so there is no bug.
When checking whether option bits are set, we should check that
the offset of the byte being checked is less than the vector
length that we got f
the hypervisor agreed to
us using radix.
Cc: sta...@vger.kernel.org # v4.8+
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/mm/init_64.c | 33 +
1 file changed, 33 insertions(+)
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
The primary purpose of this patch series is to make it possible to run
a guest on POWER9 using the radix MMU under a KVM host that also uses
the radix MMU. To do this, the guest needs to say that it supports
radix in the ibm,client-architecture-support vector, and if the host
agrees, the guest
On Wed, Jan 25, 2017 at 01:27:22PM +0100, Thomas Huth wrote:
> The function kvmppc_handle_exit_pr() is quite huge and thus hard to read,
> and even contains a "spaghetti-code"-like goto between the different case
> labels of the big switch statement. This can be made much more readable
> by moving
On Wed, Jan 18, 2017 at 11:19:26AM +0530, Mahesh Jagannath Salgaonkar wrote:
> On 01/16/2017 10:05 AM, Paul Mackerras wrote:
> > On Fri, Jan 13, 2017 at 04:51:45PM +0530, Aravinda Prasad wrote:
[snip]
> >>case BOOK3S_INTERRUPT_MACHINE_CHECK:
> >> + /* Exit
> Signed-off-by: Nicholas Piggin <npig...@gmail.com>
Looks OK to me.
I have a slight quibble about the naming of the "BRANCH_LINK_TO_KVM"
macro because neither its definition nor the place where it's used
have anything to do with KVM as far as I can see. That needn't stop
t
rea
> (name is arbitrary) in order to be closer to .text and avoid the dreaded
> "relocation truncated to fit" error.
>
> Signed-off-by: Nicholas Piggin <npig...@gmail.com>
Acked-by: Paul Mackerras <pau...@ozlabs.org>
back
> to match the previous call convention (i.e., shared with 32-bit), for
> simplicity.
>
> Signed-off-by: Nicholas Piggin <npig...@gmail.com>
Acked-by: Paul Mackerras <pau...@ozlabs.org>
I notice that I forgot to add the code to save CFAR to the
__KVM_HANDLER_SKIP macro. We should fix that.
Paul.
On Mon, Jan 23, 2017 at 02:17:20PM +1100, Suraj Jitindar Singh wrote:
> On Thu, 2017-01-12 at 20:07 +1100, Paul Mackerras wrote:
> > This adds the code to construct the second-level ("partition-scoped"
> > in
> > architecturese) page tables for guests using
On Mon, Jan 23, 2017 at 01:39:27PM +1100, Suraj Jitindar Singh wrote:
> On Thu, 2017-01-12 at 20:07 +1100, Paul Mackerras wrote:
> > This adds the implementation of the KVM_PPC_CONFIGURE_V3_MMU ioctl
> > for HPT guests on POWER9. With this, we can return 1 for the
> > KV
On Fri, Jan 13, 2017 at 04:51:45PM +0530, Aravinda Prasad wrote:
> Enhance KVM to cause a guest exit with KVM_EXIT_NMI
> exit reason upon a machine check exception (MCE) in
> the guest address space if the KVM_CAP_PPC_FWNMI
> capability is enabled (instead of delivering a 0x200
> interrupt to
On Mon, Jan 09, 2017 at 05:10:35PM +0530, Aravinda Prasad wrote:
> This patch introduces a new KVM capability to control
> how KVM behaves on machine check exception (MCE).
> Without this capability, KVM redirects machine check
> exceptions to guest's 0x200 vector, if the address in
> error
address of the
access.)
Thus, for HPT guests on POWER9, we can use this register rather
than looking up the SLB with the slbfee. instruction.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 8
1 file changed, 8 insertions(+)
diff --git
one mode to the other,
which enables some simplifications.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_book3s.h | 2 +
arch/powerpc/kvm/book3s_64_mmu_hv.c| 1 -
arch/powerpc/kvm/book3s_64_mmu_radix.c | 45
arch/powerpc/kvm/book3
If the guest is in radix mode, then it doesn't have a hashed page
table (HPT), so all of the hypercalls that manipulate the HPT can't
work and should return an error. This adds checks to make them
return H_FUNCTION ("function not supported").
Signed-off-by: Paul Mackerras <pau.
e.g., when the page was paged out). This bitmap
is stored in the first half of the memslot->dirty_bitmap area, and
kvm_vm_ioctl_get_dirty_log_hv() now uses the second half for the
bitmap that gets returned to userspace.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc
need to traverse
rmap chains.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_book3s.h | 6
arch/powerpc/kvm/book3s_64_mmu_hv.c| 64 +++---
arch/powerpc/kvm/book3s_64_mmu_radix.c | 54
3
This adds the code to construct the second-level ("partition-scoped" in
architecturese) page tables for guests using the radix MMU. Apart from
the PGD level, which is allocated when the guest is created, the rest
of the tree is all constructed in response to hypervisor page faults.
As well as
the
host value for the PID register.
On hypervisor data/instruction storage interrupts, we don't do the
guest HPT lookup on radix, but just save the guest physical address
for the fault (from the ASDR register) in the vcpu struct.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/p
-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_book3s.h| 3 +
arch/powerpc/include/asm/kvm_book3s_64.h | 6 ++
arch/powerpc/include/asm/kvm_host.h | 2 +
arch/powerpc/kvm/Makefile| 3 +-
arch/powerpc/kvm/book3s_64_mmu_hv.c | 10 ++-
This adds the implementation of the KVM_PPC_CONFIGURE_V3_MMU ioctl
for HPT guests on POWER9. With this, we can return 1 for the
KVM_CAP_PPC_MMU_HASH_V3 capability.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_host.h | 1 +
arch/powerpc/kvm/book3
for the TLB invalidate entry instruction.
Initially, both capabilities return 0 and the ioctls return -EINVAL,
until the necessary infrastructure for them to operate correctly
is added.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
Documentation/virtual/kvm/api.txt
t to kvmppc_ipi_thread().
Fixes: 1704a81ccebc ("KVM: PPC: Book3S HV: Use msgsnd for IPIs to other cores
on POWER9")
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/book3s_h
if the partition was previously a radix
partition and 0 if it was a HPT partition. This implements that
logic.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/mm/pgtable_64.c | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/mm/pgta
This exports the pgtable_cache array and the pgtable_cache_add
function so that HV KVM can use them for allocating radix page
tables for guests.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/mm/init-common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff
This adds definitions for bits in the DSISR register which are used
by POWER9 for various translation-related exception conditions, and
for some more bits in the partition table entry that will be needed
by KVM.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/inclu
table, which points to the
radix tree for each process, we need to install that using the
H_REGISTER_PROC_TBL hcall.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/book3s/64/mmu.h | 2 ++
arch/powerpc/include/asm/hvcall.h| 11 +++
arch/p
of option combinations that
need to be tested, which is an ongoing burden on developers.
Given that the space savings are small, let's remove the option.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/platforms/Kconfig.cputype | 7 +--
1 file changed, 1 insertion
option is in byte 21 not byte 15.
When checking whether option bits are set, we should check that
the offset of the byte being checked is less than the vector
length that we got from the hypervisor.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/prom.h
the hypervisor agreed to
us using radix.
Cc: sta...@vger.kernel.org # v4.8+
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/mm/init_64.c | 33 +
1 file changed, 33 insertions(+)
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
The primary purpose of this patch series is to make it possible to run
a guest on POWER9 using the radix MMU under a KVM host that also uses
the radix MMU. To do this, the guest needs to say that it supports
radix in the ibm,client-architecture-support vector, and if the host
agrees, the guest
On Tue, Dec 20, 2016 at 08:19:02PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <pau...@ozlabs.org> writes:
>
> > Currently, if the kernel is running on a POWER9 processor under a
> > hypervisor, it will try to use the radix MMU even though it doesn't
> > have t
agreed to
us using radix.
Fixes: 17a3dd2f5fc7 ("powerpc/mm/radix: Use firmware feature to enable Radix
MMU")
Cc: sta...@vger.kernel.org # v4.7+
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/mm/init_64.c | 27 +++
1 file changed, 27 insertion
On Thu, Dec 08, 2016 at 11:29:30AM +0800, Jia He wrote:
> Fixes: a4b349540a ("powerpc/mm: Cleanup LPCR defines")
> Signed-off-by: Jia He <hejia...@gmail.com>
Acked-by: Paul Mackerras <pau...@ozlabs.org>
On Thu, Dec 08, 2016 at 09:12:13AM +0530, Aneesh Kumar K.V wrote:
> In commit a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
> LPCR_VRMASD wrongly as below.
>
> -#define LPCR_VRMASD (0x1ful << (63-16))
> +#define LPCR_VRMASD_SH 47
> +#define LPCR_VRMASD
On Thu, Dec 01, 2016 at 06:18:10PM +1100, Nicholas Piggin wrote:
> Change the calling convention to put the trap number together with
> CR in two halves of r12, which frees up HSTATE_SCRATCH2 in the HV
> handler, and r9 free.
Cute idea! Some comments below...
> The 64-bit PR handler entry
table, which points to the
radix tree for each process, we need to install that using the
H_REGISTER_PROC_TBL hcall.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/book3s/64/mmu.h | 2 ++
arch/powerpc/include/asm/hvcall.h| 11 +++
arch/p
On Mon, Dec 05, 2016 at 07:55:32PM +1100, Benjamin Herrenschmidt wrote:
> On Mon, 2016-12-05 at 19:04 +1100, Paul Mackerras wrote:
> > + vec5 = of_get_flat_dt_prop(chosen, "ibm,architecture-vec-5", );
> > + if (!vec5 || size <= OV5_INDX(OV5_MMU_RADIX_300)
table, which points to the
radix tree for each process, we need to install that using the
H_REGISTER_PROC_TBL hcall.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/book3s/64/mmu.h | 2 ++
arch/powerpc/include/asm/hvcall.h| 11 +++
arch/p
of option combinations that
need to be tested, which is an ongoing burden on developers,
as well as increasing the number of #ifdefs in the code.
Given that the space savings are small, let's remove the option.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/pla
option is in byte 21 not byte 15.
When checking whether option bits are set, we should check that
the offset of the byte being checked is less than the vector
length that we got from the hypervisor.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/prom.h
but given that the functions are KVM functions,
having them in a KVM header will be better for long-term
maintenance.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
[For information; I intend to merge this through the KVM tree.]
arch/powerpc/include/asm/asm-prototypes.h | 44 -
On Wed, Nov 23, 2016 at 04:39:57PM +0530, Aneesh Kumar K.V wrote:
> When we are updating pte, we just need to flush the tlb mapping for
> that pte. Right now we do a full mm flush because we don't track page
> size. Update the interface to track the page size and use that to
> do the right tlb
On Wed, Nov 23, 2016 at 04:14:05PM +1100, David Gibson wrote:
> Hi Paul,
>
> I'm still chasing this confusion about the CAS bit to send the real
> HPT resizing patches. However, in the meantime, here are some
> preliminary cleanups.
>
> These cleanups stand on their own, although I wrote them
On Wed, Nov 23, 2016 at 11:31:54AM +1100, Paul Mackerras wrote:
> This series of patches adds support to HV KVM for running KVM guests
> on POWER9 systems. This allows us to run KVM guests that use HPT
> (hashed page table) address translation and know about the POWER9
> processor. W
v3.00 of the ISA which adds an ISA v2.07 compatilibity mode
to the PCR.
We also add a check to ensure the processor we are running on is capable of
emulating the chosen processor (for example a POWER7 cannot emulate a
POWER8, similarly with a POWER8 and a POWER9).
Based on work by: Paul Mackerra
on POWER9 as long as the host
is running with HPT translation. Since userspace currently has no
way to request radix tree translation for the guest, the guest has
no choice but to use HPT translation.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv.
hypervisor virtualization interrupts can occur while
we are in the guest. We then also need to cope with exiting the guest
because of a hypervisor virtualization interrupt.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_asm.h | 1 +
arch/powerpc
ring guest execution with the stop instruction, and adds code to
set PSSCR to a value which will allow an SMT mode switch while the
thread is idle (given that the core as a whole won't be idle in these
cases).
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv_r
turns from kvmppc_read_one_intr().
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_ppc.h | 7 +++--
arch/powerpc/kvm/book3s_hv.c | 28 +++--
arch/powerpc/kvm/book3s_hv_builtin.c | 59 ++--
arch/powerpc/kvm/book3s_h
, we don't need to do the TLB flush on first entry to the
guest on each processor. Therefore we don't set all bits in the
tlb_need_flush bitmap on VM startup on POWER9.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_host.h | 1 +
arch/powerpc/kern
On POWER9, the msgsnd instruction is able to send interrupts to
other cores, as well as other threads on the local core. Since
msgsnd is generally simpler and faster than sending an IPI via the
XICS, we use msgsnd for all IPIs sent by KVM on POWER9.
Signed-off-by: Paul Mackerras <
, but we had to
context-switch them on POWER8 to avoid creating a covert channel.
They are: SPMC1, SPMC2, MMCRS, CSIGR, TACR, TCSCR, and ACOP.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 50 -
1 file chang
contains some fields which are guest-accessible and some
which are only accessible in hypervisor mode. We only allow the
guest-accessible fields to be read or set by userspace.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
Documentation/virtual/kvm/api.txt | 2 ++
arch/p
(logical partition ID register), not the SDR1 register.
There is also no requirement now to transition via a reserved
LPID value.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv.c| 36 +++--
arch/powerpc/kvm/book3s_hv_rmhand
) and ARPN (abbreviated real page number)
fields. As far as possible, the conversion is done when reading or
writing the HPT entries, and the rest of the code continues to use
the old format.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_64_mmu_hv.c
This series of patches adds support to HV KVM for running KVM guests
on POWER9 systems. This allows us to run KVM guests that use HPT
(hashed page table) address translation and know about the POWER9
processor. With suitable changes to the user-mode driver, this can
also run guests on POWER9 in
On Tue, Nov 22, 2016 at 11:06:32PM +0530, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy"
>
> The existing code doesn't handle the case when CPU which was in a
> hardware-idle state (nap,sleep,winkle on POWER8 and various stop
> states on POWER9) gets woken up due
a note to
> > help improve the system]
> >
> > url:
> > https://github.com/0day-ci/linux/commits/Paul-Mackerras/powerpc-64-Preparation-for-KVM-support-on-POWER9/20161121-133431
> > base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
>
On Mon, Oct 10, 2016 at 11:31:19AM +1100, Daniel Axtens wrote:
> Squash a couple of sparse warnings by making things static.
>
> Build tested.
>
> Signed-off-by: Daniel Axtens
Thanks, applied to kvm-ppc-next.
Paul.
On Mon, Oct 17, 2016 at 03:15:50PM +, Wei Yongjun wrote:
> From: Wei Yongjun
>
> Using list_move_tail() instead of list_del() + list_add_tail().
>
> Signed-off-by: Wei Yongjun
Thanks, applied to kvm-ppc-next.
Paul.
On Mon, Oct 10, 2016 at 11:31:20AM +1100, Daniel Axtens wrote:
> A bunch of KVM functions are only called from assembler.
> Give them prototypes in asm-prototypes.h
> This reduces sparse warnings.
>
> Signed-off-by: Daniel Axtens
Thanks, applied to kvm-ppc-next.
Paul.
value into next patch]
Signed-off-by: Suraj Jitindar Singh <sjitindarsi...@gmail.com>
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/reg.h | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/r
, the
call gets moved to near the end of radix__early_init_mmu(). It
now gets called when running as a guest, whereas previously it
would only be called if the kernel is running as the host.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/mmu.h | 5 +
arch/p
These definitions will be needed by KVM.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/reg.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index c491cfe..d2f868a 100644
--- a/arch/p
This defines real-mode versions of opal_int_get_xirr(), opal_int_eoi()
and opal_int_set_mfrr(), for use by KVM real-mode code.
It also exports opal_int_set_mfrr() so that the modular part of KVM
can use it to send IPIs.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/i
This patch series, based on the current powerpc next branch, adds
various things we need in arch/powerpc in order to support KVM on
POWER9.
Michael, could you put these in a topic branch that I can pull?
Paul.
---
arch/powerpc/include/asm/mmu.h | 5
On Sat, Nov 19, 2016 at 12:05:21PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <pau...@ozlabs.org> writes:
>
> > On Fri, Nov 18, 2016 at 07:57:30PM +0530, Aneesh Kumar K.V wrote:
> >> Paul Mackerras <pau...@ozlabs.org> writes:
> >> +
> >&g
On Sat, Nov 19, 2016 at 11:38:40AM +1100, Balbir Singh wrote:
>
>
> On 18/11/16 18:28, Paul Mackerras wrote:
> > This adapts the KVM-HV hashed page table (HPT) code to read and write
> > HPT entries in the new format defined in Power ISA v3.00 on POWER9
> > machines.
On Sat, Nov 19, 2016 at 11:45:52AM +1100, Balbir Singh wrote:
> > +#ifdef CONFIG_PPC_BOOK3S_64
> > +void mmu_partition_table_init(void)
> > +{
> > + unsigned long patb_size = 1UL << PATB_SIZE_SHIFT;
> > +
> > + BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 24), "Partition table size too
> > large.");
>
On Sat, Nov 19, 2016 at 08:57:28AM +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2016-11-18 at 20:11 +0530, Aneesh Kumar K.V wrote:
> > > + * Work out how many sets the TLB has, for the use of
> > > + * the TLB invalidation loop in book3s_hv_rmhandlers.S.
> > > + */
> > > + if
On Fri, Nov 18, 2016 at 08:11:34PM +0530, Aneesh Kumar K.V wrote:
> > @@ -3287,6 +3290,17 @@ static int kvmppc_core_init_vm_hv(struct kvm *kvm)
> > kvm->arch.lpcr = lpcr;
> >
> > /*
> > +* Work out how many sets the TLB has, for the use of
> > +* the TLB invalidation loop in
On Fri, Nov 18, 2016 at 08:17:25PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <pau...@ozlabs.org> writes:
>
> > On POWER9, the msgsnd instruction is able to send interrupts to
> > other cores, as well as other threads on the local core. Since
> > msgsnd is gen
On Fri, Nov 18, 2016 at 07:57:30PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <pau...@ozlabs.org> writes:
> +
> > + /* Global flush of TLBs and partition table caches for this lpid */
> > + asm volatile("ptesync");
> > + asm volatile(PPC_TLBIE_
On Fri, Nov 18, 2016 at 08:05:47PM +0530, Aneesh Kumar K.V wrote:
> Paul Mackerras <pau...@ozlabs.org> writes:
>
> > Some special-purpose registers that were present and accessible
> > by guests on POWER8 no longer exist on POWER9, so this adds
> > feature sectio
on POWER9 as long as the host
is running with HPT translation. Since userspace currently has no
way to request radix tree translation for the guest, the guest has
no choice but to use HPT translation.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv.
ring guest execution with the stop instruction, and adds code to
set PSSCR to a value which will allow an SMT mode switch while the
thread is idle (given that the core as a whole won't be idle in these
cases).
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv_r
turns from kvmppc_read_one_intr().
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_ppc.h | 7 +++--
arch/powerpc/kvm/book3s_hv.c | 28 +++--
arch/powerpc/kvm/book3s_hv_builtin.c | 59 ++--
arch/powerpc/kvm/book3s_h
On POWER9, the msgsnd instruction is able to send interrupts to
other cores, as well as other threads on the local core. Since
msgsnd is generally simpler and faster than sending an IPI via the
XICS, we use msgsnd for all IPIs sent by KVM on POWER9.
Signed-off-by: Paul Mackerras <
, we don't need to do the TLB flush on first entry to the
guest on each processor. Therefore we don't set all bits in the
tlb_need_flush bitmap on VM startup on POWER9.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/include/asm/kvm_host.h | 1 +
arch/powerpc/kern
contains some fields which are guest-accessible and some
which are only accessible in hypervisor mode. We only allow the
guest-accessible fields to be read or set by userspace.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
Documentation/virtual/kvm/api.txt | 2 ++
arch/p
, but we had to
context-switch them on POWER8 to avoid creating a covert channel.
They are: SPMC1, SPMC2, MMCRS, CSIGR, TACR, TCSCR, and ACOP.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 50 -
1 file chang
(logical partition ID register), not the SDR1 register.
There is also no requirement now to transition via a reserved
LPID value.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_hv.c| 36 +++--
arch/powerpc/kvm/book3s_hv_rmhand
) and ARPN (abbreviated real page number)
fields. As far as possible, the conversion is done when reading or
writing the HPT entries, and the rest of the code continues to use
the old format.
Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
---
arch/powerpc/kvm/book3s_64_mmu_hv.c
701 - 800 of 2196 matches
Mail list logo