2008-04-17 08:28:09 +04:00
|
|
|
#
|
|
|
|
# Makefile for Kernel-based Virtual Machine module
|
|
|
|
#
|
|
|
|
|
2009-06-10 00:48:51 +04:00
|
|
|
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
|
|
|
|
|
2010-09-23 00:51:09 +04:00
|
|
|
ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
|
2013-05-14 17:31:02 +04:00
|
|
|
KVM := ../../../virt/kvm
|
2008-04-17 08:28:09 +04:00
|
|
|
|
2013-05-14 17:31:02 +04:00
|
|
|
common-objs-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
|
|
|
|
$(KVM)/eventfd.o
|
2008-04-17 08:28:09 +04:00
|
|
|
|
2013-01-11 18:22:45 +04:00
|
|
|
CFLAGS_e500_mmu.o := -I.
|
|
|
|
CFLAGS_e500_mmu_host.o := -I.
|
2009-06-18 18:47:27 +04:00
|
|
|
CFLAGS_emulate.o := -I.
|
2014-06-18 16:53:49 +04:00
|
|
|
CFLAGS_emulate_loadstore.o := -I.
|
2009-06-18 18:47:27 +04:00
|
|
|
|
2014-06-18 16:53:49 +04:00
|
|
|
common-objs-y += powerpc.o emulate.o emulate_loadstore.o
|
2008-12-03 00:51:57 +03:00
|
|
|
obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
|
2010-04-16 02:11:41 +04:00
|
|
|
obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
|
2008-04-17 08:28:09 +04:00
|
|
|
|
|
|
|
AFLAGS_booke_interrupts.o := -I$(obj)
|
|
|
|
|
2009-01-04 01:23:10 +03:00
|
|
|
kvm-e500-objs := \
|
2009-10-30 08:47:24 +03:00
|
|
|
$(common-objs-y) \
|
2009-01-04 01:23:10 +03:00
|
|
|
booke.o \
|
|
|
|
booke_emulate.o \
|
|
|
|
booke_interrupts.o \
|
|
|
|
e500.o \
|
2013-01-11 18:22:45 +04:00
|
|
|
e500_mmu.o \
|
|
|
|
e500_mmu_host.o \
|
2009-01-04 01:23:10 +03:00
|
|
|
e500_emulate.o
|
2012-02-16 03:40:00 +04:00
|
|
|
kvm-objs-$(CONFIG_KVM_E500V2) := $(kvm-e500-objs)
|
2009-10-30 08:47:24 +03:00
|
|
|
|
2011-12-20 19:34:47 +04:00
|
|
|
kvm-e500mc-objs := \
|
|
|
|
$(common-objs-y) \
|
|
|
|
booke.o \
|
|
|
|
booke_emulate.o \
|
|
|
|
bookehv_interrupts.o \
|
|
|
|
e500mc.o \
|
2013-01-11 18:22:45 +04:00
|
|
|
e500_mmu.o \
|
|
|
|
e500_mmu_host.o \
|
2011-12-20 19:34:47 +04:00
|
|
|
e500_emulate.o
|
|
|
|
kvm-objs-$(CONFIG_KVM_E500MC) := $(kvm-e500mc-objs)
|
|
|
|
|
2013-10-07 20:47:50 +04:00
|
|
|
kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) := \
|
|
|
|
book3s_64_vio_hv.o
|
|
|
|
|
2013-10-07 20:47:59 +04:00
|
|
|
kvm-pr-y := \
|
2010-02-19 13:00:40 +03:00
|
|
|
fpu.o \
|
2014-07-30 17:25:48 +04:00
|
|
|
emulate.o \
|
2010-02-19 13:00:44 +03:00
|
|
|
book3s_paired_singles.o \
|
2011-06-29 04:17:58 +04:00
|
|
|
book3s_pr.o \
|
2011-08-08 19:21:15 +04:00
|
|
|
book3s_pr_papr.o \
|
2010-04-16 02:11:32 +04:00
|
|
|
book3s_emulate.o \
|
|
|
|
book3s_interrupts.o \
|
2010-06-30 17:18:46 +04:00
|
|
|
book3s_mmu_hpte.o \
|
2009-10-30 08:47:24 +03:00
|
|
|
book3s_64_mmu_host.o \
|
|
|
|
book3s_64_mmu.o \
|
|
|
|
book3s_32_mmu.o
|
2013-10-07 20:47:50 +04:00
|
|
|
|
2013-10-07 20:47:52 +04:00
|
|
|
ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
|
|
|
|
kvm-book3s_64-module-objs := \
|
|
|
|
$(KVM)/coalesced_mmio.o
|
|
|
|
|
|
|
|
kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
|
2011-07-23 11:41:11 +04:00
|
|
|
book3s_rmhandlers.o
|
2013-10-07 20:47:52 +04:00
|
|
|
endif
|
KVM: PPC: Add support for Book3S processors in hypervisor mode
This adds support for KVM running on 64-bit Book 3S processors,
specifically POWER7, in hypervisor mode. Using hypervisor mode means
that the guest can use the processor's supervisor mode. That means
that the guest can execute privileged instructions and access privileged
registers itself without trapping to the host. This gives excellent
performance, but does mean that KVM cannot emulate a processor
architecture other than the one that the hardware implements.
This code assumes that the guest is running paravirtualized using the
PAPR (Power Architecture Platform Requirements) interface, which is the
interface that IBM's PowerVM hypervisor uses. That means that existing
Linux distributions that run on IBM pSeries machines will also run
under KVM without modification. In order to communicate the PAPR
hypercalls to qemu, this adds a new KVM_EXIT_PAPR_HCALL exit code
to include/linux/kvm.h.
Currently the choice between book3s_hv support and book3s_pr support
(i.e. the existing code, which runs the guest in user mode) has to be
made at kernel configuration time, so a given kernel binary can only
do one or the other.
This new book3s_hv code doesn't support MMIO emulation at present.
Since we are running paravirtualized guests, this isn't a serious
restriction.
With the guest running in supervisor mode, most exceptions go straight
to the guest. We will never get data or instruction storage or segment
interrupts, alignment interrupts, decrementer interrupts, program
interrupts, single-step interrupts, etc., coming to the hypervisor from
the guest. Therefore this introduces a new KVMTEST_NONHV macro for the
exception entry path so that we don't have to do the KVM test on entry
to those exception handlers.
We do however get hypervisor decrementer, hypervisor data storage,
hypervisor instruction storage, and hypervisor emulation assist
interrupts, so we have to handle those.
In hypervisor mode, real-mode accesses can access all of RAM, not just
a limited amount. Therefore we put all the guest state in the vcpu.arch
and use the shadow_vcpu in the PACA only for temporary scratch space.
We allocate the vcpu with kzalloc rather than vzalloc, and we don't use
anything in the kvmppc_vcpu_book3s struct, so we don't allocate it.
We don't have a shared page with the guest, but we still need a
kvm_vcpu_arch_shared struct to store the values of various registers,
so we include one in the vcpu_arch struct.
The POWER7 processor has a restriction that all threads in a core have
to be in the same partition. MMU-on kernel code counts as a partition
(partition 0), so we have to do a partition switch on every entry to and
exit from the guest. At present we require the host and guest to run
in single-thread mode because of this hardware restriction.
This code allocates a hashed page table for the guest and initializes
it with HPTEs for the guest's Virtual Real Memory Area (VRMA). We
require that the guest memory is allocated using 16MB huge pages, in
order to simplify the low-level memory management. This also means that
we can get away without tracking paging activity in the host for now,
since huge pages can't be paged or swapped.
This also adds a few new exports needed by the book3s_hv code.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-29 04:21:34 +04:00
|
|
|
|
2013-10-07 20:47:59 +04:00
|
|
|
kvm-hv-y += \
|
KVM: PPC: Add support for Book3S processors in hypervisor mode
This adds support for KVM running on 64-bit Book 3S processors,
specifically POWER7, in hypervisor mode. Using hypervisor mode means
that the guest can use the processor's supervisor mode. That means
that the guest can execute privileged instructions and access privileged
registers itself without trapping to the host. This gives excellent
performance, but does mean that KVM cannot emulate a processor
architecture other than the one that the hardware implements.
This code assumes that the guest is running paravirtualized using the
PAPR (Power Architecture Platform Requirements) interface, which is the
interface that IBM's PowerVM hypervisor uses. That means that existing
Linux distributions that run on IBM pSeries machines will also run
under KVM without modification. In order to communicate the PAPR
hypercalls to qemu, this adds a new KVM_EXIT_PAPR_HCALL exit code
to include/linux/kvm.h.
Currently the choice between book3s_hv support and book3s_pr support
(i.e. the existing code, which runs the guest in user mode) has to be
made at kernel configuration time, so a given kernel binary can only
do one or the other.
This new book3s_hv code doesn't support MMIO emulation at present.
Since we are running paravirtualized guests, this isn't a serious
restriction.
With the guest running in supervisor mode, most exceptions go straight
to the guest. We will never get data or instruction storage or segment
interrupts, alignment interrupts, decrementer interrupts, program
interrupts, single-step interrupts, etc., coming to the hypervisor from
the guest. Therefore this introduces a new KVMTEST_NONHV macro for the
exception entry path so that we don't have to do the KVM test on entry
to those exception handlers.
We do however get hypervisor decrementer, hypervisor data storage,
hypervisor instruction storage, and hypervisor emulation assist
interrupts, so we have to handle those.
In hypervisor mode, real-mode accesses can access all of RAM, not just
a limited amount. Therefore we put all the guest state in the vcpu.arch
and use the shadow_vcpu in the PACA only for temporary scratch space.
We allocate the vcpu with kzalloc rather than vzalloc, and we don't use
anything in the kvmppc_vcpu_book3s struct, so we don't allocate it.
We don't have a shared page with the guest, but we still need a
kvm_vcpu_arch_shared struct to store the values of various registers,
so we include one in the vcpu_arch struct.
The POWER7 processor has a restriction that all threads in a core have
to be in the same partition. MMU-on kernel code counts as a partition
(partition 0), so we have to do a partition switch on every entry to and
exit from the guest. At present we require the host and guest to run
in single-thread mode because of this hardware restriction.
This code allocates a hashed page table for the guest and initializes
it with HPTEs for the guest's Virtual Real Memory Area (VRMA). We
require that the guest memory is allocated using 16MB huge pages, in
order to simplify the low-level memory management. This also means that
we can get away without tracking paging activity in the host for now,
since huge pages can't be paged or swapped.
This also adds a few new exports needed by the book3s_hv code.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-29 04:21:34 +04:00
|
|
|
book3s_hv.o \
|
|
|
|
book3s_hv_interrupts.o \
|
|
|
|
book3s_64_mmu_hv.o
|
2013-10-07 20:47:50 +04:00
|
|
|
|
2013-04-18 00:31:15 +04:00
|
|
|
kvm-book3s_64-builtin-xics-objs-$(CONFIG_KVM_XICS) := \
|
|
|
|
book3s_hv_rm_xics.o
|
2013-10-07 20:47:50 +04:00
|
|
|
|
2013-10-07 20:47:59 +04:00
|
|
|
ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
|
|
|
|
kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
|
2011-07-23 11:41:11 +04:00
|
|
|
book3s_hv_rmhandlers.o \
|
2011-06-29 04:22:41 +04:00
|
|
|
book3s_hv_rm_mmu.o \
|
KVM: PPC: Book3S HV: Handle guest-caused machine checks on POWER7 without panicking
Currently, if a machine check interrupt happens while we are in the
guest, we exit the guest and call the host's machine check handler,
which tends to cause the host to panic. Some machine checks can be
triggered by the guest; for example, if the guest creates two entries
in the SLB that map the same effective address, and then accesses that
effective address, the CPU will take a machine check interrupt.
To handle this better, when a machine check happens inside the guest,
we call a new function, kvmppc_realmode_machine_check(), while still in
real mode before exiting the guest. On POWER7, it handles the cases
that the guest can trigger, either by flushing and reloading the SLB,
or by flushing the TLB, and then it delivers the machine check interrupt
directly to the guest without going back to the host. On POWER7, the
OPAL firmware patches the machine check interrupt vector so that it
gets control first, and it leaves behind its analysis of the situation
in a structure pointed to by the opal_mc_evt field of the paca. The
kvmppc_realmode_machine_check() function looks at this, and if OPAL
reports that there was no error, or that it has handled the error, we
also go straight back to the guest with a machine check. We have to
deliver a machine check to the guest since the machine check interrupt
might have trashed valid values in SRR0/1.
If the machine check is one we can't handle in real mode, and one that
OPAL hasn't already handled, or on PPC970, we exit the guest and call
the host's machine check handler. We do this by jumping to the
machine_check_fwnmi label, rather than absolute address 0x200, because
we don't want to re-execute OPAL's handler on POWER7. On PPC970, the
two are equivalent because address 0x200 just contains a branch.
Then, if the host machine check handler decides that the system can
continue executing, kvmppc_handle_exit() delivers a machine check
interrupt to the guest -- once again to let the guest know that SRR0/1
have been modified.
Signed-off-by: Paul Mackerras <paulus@samba.org>
[agraf: fix checkpatch warnings]
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-11-24 02:37:50 +04:00
|
|
|
book3s_hv_ras.o \
|
2013-04-18 00:31:15 +04:00
|
|
|
book3s_hv_builtin.o \
|
|
|
|
$(kvm-book3s_64-builtin-xics-objs-y)
|
2013-10-07 20:47:59 +04:00
|
|
|
endif
|
KVM: PPC: Add support for Book3S processors in hypervisor mode
This adds support for KVM running on 64-bit Book 3S processors,
specifically POWER7, in hypervisor mode. Using hypervisor mode means
that the guest can use the processor's supervisor mode. That means
that the guest can execute privileged instructions and access privileged
registers itself without trapping to the host. This gives excellent
performance, but does mean that KVM cannot emulate a processor
architecture other than the one that the hardware implements.
This code assumes that the guest is running paravirtualized using the
PAPR (Power Architecture Platform Requirements) interface, which is the
interface that IBM's PowerVM hypervisor uses. That means that existing
Linux distributions that run on IBM pSeries machines will also run
under KVM without modification. In order to communicate the PAPR
hypercalls to qemu, this adds a new KVM_EXIT_PAPR_HCALL exit code
to include/linux/kvm.h.
Currently the choice between book3s_hv support and book3s_pr support
(i.e. the existing code, which runs the guest in user mode) has to be
made at kernel configuration time, so a given kernel binary can only
do one or the other.
This new book3s_hv code doesn't support MMIO emulation at present.
Since we are running paravirtualized guests, this isn't a serious
restriction.
With the guest running in supervisor mode, most exceptions go straight
to the guest. We will never get data or instruction storage or segment
interrupts, alignment interrupts, decrementer interrupts, program
interrupts, single-step interrupts, etc., coming to the hypervisor from
the guest. Therefore this introduces a new KVMTEST_NONHV macro for the
exception entry path so that we don't have to do the KVM test on entry
to those exception handlers.
We do however get hypervisor decrementer, hypervisor data storage,
hypervisor instruction storage, and hypervisor emulation assist
interrupts, so we have to handle those.
In hypervisor mode, real-mode accesses can access all of RAM, not just
a limited amount. Therefore we put all the guest state in the vcpu.arch
and use the shadow_vcpu in the PACA only for temporary scratch space.
We allocate the vcpu with kzalloc rather than vzalloc, and we don't use
anything in the kvmppc_vcpu_book3s struct, so we don't allocate it.
We don't have a shared page with the guest, but we still need a
kvm_vcpu_arch_shared struct to store the values of various registers,
so we include one in the vcpu_arch struct.
The POWER7 processor has a restriction that all threads in a core have
to be in the same partition. MMU-on kernel code counts as a partition
(partition 0), so we have to do a partition switch on every entry to and
exit from the guest. At present we require the host and guest to run
in single-thread mode because of this hardware restriction.
This code allocates a hashed page table for the guest and initializes
it with HPTEs for the guest's Virtual Real Memory Area (VRMA). We
require that the guest memory is allocated using 16MB huge pages, in
order to simplify the low-level memory management. This also means that
we can get away without tracking paging activity in the host for now,
since huge pages can't be paged or swapped.
This also adds a few new exports needed by the book3s_hv code.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-29 04:21:34 +04:00
|
|
|
|
2013-04-18 00:30:26 +04:00
|
|
|
kvm-book3s_64-objs-$(CONFIG_KVM_XICS) += \
|
|
|
|
book3s_xics.o
|
|
|
|
|
2013-10-07 20:47:52 +04:00
|
|
|
kvm-book3s_64-module-objs += \
|
2013-05-14 17:31:02 +04:00
|
|
|
$(KVM)/kvm_main.o \
|
|
|
|
$(KVM)/eventfd.o \
|
KVM: PPC: Add support for Book3S processors in hypervisor mode
This adds support for KVM running on 64-bit Book 3S processors,
specifically POWER7, in hypervisor mode. Using hypervisor mode means
that the guest can use the processor's supervisor mode. That means
that the guest can execute privileged instructions and access privileged
registers itself without trapping to the host. This gives excellent
performance, but does mean that KVM cannot emulate a processor
architecture other than the one that the hardware implements.
This code assumes that the guest is running paravirtualized using the
PAPR (Power Architecture Platform Requirements) interface, which is the
interface that IBM's PowerVM hypervisor uses. That means that existing
Linux distributions that run on IBM pSeries machines will also run
under KVM without modification. In order to communicate the PAPR
hypercalls to qemu, this adds a new KVM_EXIT_PAPR_HCALL exit code
to include/linux/kvm.h.
Currently the choice between book3s_hv support and book3s_pr support
(i.e. the existing code, which runs the guest in user mode) has to be
made at kernel configuration time, so a given kernel binary can only
do one or the other.
This new book3s_hv code doesn't support MMIO emulation at present.
Since we are running paravirtualized guests, this isn't a serious
restriction.
With the guest running in supervisor mode, most exceptions go straight
to the guest. We will never get data or instruction storage or segment
interrupts, alignment interrupts, decrementer interrupts, program
interrupts, single-step interrupts, etc., coming to the hypervisor from
the guest. Therefore this introduces a new KVMTEST_NONHV macro for the
exception entry path so that we don't have to do the KVM test on entry
to those exception handlers.
We do however get hypervisor decrementer, hypervisor data storage,
hypervisor instruction storage, and hypervisor emulation assist
interrupts, so we have to handle those.
In hypervisor mode, real-mode accesses can access all of RAM, not just
a limited amount. Therefore we put all the guest state in the vcpu.arch
and use the shadow_vcpu in the PACA only for temporary scratch space.
We allocate the vcpu with kzalloc rather than vzalloc, and we don't use
anything in the kvmppc_vcpu_book3s struct, so we don't allocate it.
We don't have a shared page with the guest, but we still need a
kvm_vcpu_arch_shared struct to store the values of various registers,
so we include one in the vcpu_arch struct.
The POWER7 processor has a restriction that all threads in a core have
to be in the same partition. MMU-on kernel code counts as a partition
(partition 0), so we have to do a partition switch on every entry to and
exit from the guest. At present we require the host and guest to run
in single-thread mode because of this hardware restriction.
This code allocates a hashed page table for the guest and initializes
it with HPTEs for the guest's Virtual Real Memory Area (VRMA). We
require that the guest memory is allocated using 16MB huge pages, in
order to simplify the low-level memory management. This also means that
we can get away without tracking paging activity in the host for now,
since huge pages can't be paged or swapped.
This also adds a few new exports needed by the book3s_hv code.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-29 04:21:34 +04:00
|
|
|
powerpc.o \
|
2014-06-18 16:53:49 +04:00
|
|
|
emulate_loadstore.o \
|
KVM: PPC: Add support for Book3S processors in hypervisor mode
This adds support for KVM running on 64-bit Book 3S processors,
specifically POWER7, in hypervisor mode. Using hypervisor mode means
that the guest can use the processor's supervisor mode. That means
that the guest can execute privileged instructions and access privileged
registers itself without trapping to the host. This gives excellent
performance, but does mean that KVM cannot emulate a processor
architecture other than the one that the hardware implements.
This code assumes that the guest is running paravirtualized using the
PAPR (Power Architecture Platform Requirements) interface, which is the
interface that IBM's PowerVM hypervisor uses. That means that existing
Linux distributions that run on IBM pSeries machines will also run
under KVM without modification. In order to communicate the PAPR
hypercalls to qemu, this adds a new KVM_EXIT_PAPR_HCALL exit code
to include/linux/kvm.h.
Currently the choice between book3s_hv support and book3s_pr support
(i.e. the existing code, which runs the guest in user mode) has to be
made at kernel configuration time, so a given kernel binary can only
do one or the other.
This new book3s_hv code doesn't support MMIO emulation at present.
Since we are running paravirtualized guests, this isn't a serious
restriction.
With the guest running in supervisor mode, most exceptions go straight
to the guest. We will never get data or instruction storage or segment
interrupts, alignment interrupts, decrementer interrupts, program
interrupts, single-step interrupts, etc., coming to the hypervisor from
the guest. Therefore this introduces a new KVMTEST_NONHV macro for the
exception entry path so that we don't have to do the KVM test on entry
to those exception handlers.
We do however get hypervisor decrementer, hypervisor data storage,
hypervisor instruction storage, and hypervisor emulation assist
interrupts, so we have to handle those.
In hypervisor mode, real-mode accesses can access all of RAM, not just
a limited amount. Therefore we put all the guest state in the vcpu.arch
and use the shadow_vcpu in the PACA only for temporary scratch space.
We allocate the vcpu with kzalloc rather than vzalloc, and we don't use
anything in the kvmppc_vcpu_book3s struct, so we don't allocate it.
We don't have a shared page with the guest, but we still need a
kvm_vcpu_arch_shared struct to store the values of various registers,
so we include one in the vcpu_arch struct.
The POWER7 processor has a restriction that all threads in a core have
to be in the same partition. MMU-on kernel code counts as a partition
(partition 0), so we have to do a partition switch on every entry to and
exit from the guest. At present we require the host and guest to run
in single-thread mode because of this hardware restriction.
This code allocates a hashed page table for the guest and initializes
it with HPTEs for the guest's Virtual Real Memory Area (VRMA). We
require that the guest memory is allocated using 16MB huge pages, in
order to simplify the low-level memory management. This also means that
we can get away without tracking paging activity in the host for now,
since huge pages can't be paged or swapped.
This also adds a few new exports needed by the book3s_hv code.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-29 04:21:34 +04:00
|
|
|
book3s.o \
|
2012-03-16 01:58:34 +04:00
|
|
|
book3s_64_vio.o \
|
2013-04-18 00:30:00 +04:00
|
|
|
book3s_rtas.o \
|
KVM: PPC: Add support for Book3S processors in hypervisor mode
This adds support for KVM running on 64-bit Book 3S processors,
specifically POWER7, in hypervisor mode. Using hypervisor mode means
that the guest can use the processor's supervisor mode. That means
that the guest can execute privileged instructions and access privileged
registers itself without trapping to the host. This gives excellent
performance, but does mean that KVM cannot emulate a processor
architecture other than the one that the hardware implements.
This code assumes that the guest is running paravirtualized using the
PAPR (Power Architecture Platform Requirements) interface, which is the
interface that IBM's PowerVM hypervisor uses. That means that existing
Linux distributions that run on IBM pSeries machines will also run
under KVM without modification. In order to communicate the PAPR
hypercalls to qemu, this adds a new KVM_EXIT_PAPR_HCALL exit code
to include/linux/kvm.h.
Currently the choice between book3s_hv support and book3s_pr support
(i.e. the existing code, which runs the guest in user mode) has to be
made at kernel configuration time, so a given kernel binary can only
do one or the other.
This new book3s_hv code doesn't support MMIO emulation at present.
Since we are running paravirtualized guests, this isn't a serious
restriction.
With the guest running in supervisor mode, most exceptions go straight
to the guest. We will never get data or instruction storage or segment
interrupts, alignment interrupts, decrementer interrupts, program
interrupts, single-step interrupts, etc., coming to the hypervisor from
the guest. Therefore this introduces a new KVMTEST_NONHV macro for the
exception entry path so that we don't have to do the KVM test on entry
to those exception handlers.
We do however get hypervisor decrementer, hypervisor data storage,
hypervisor instruction storage, and hypervisor emulation assist
interrupts, so we have to handle those.
In hypervisor mode, real-mode accesses can access all of RAM, not just
a limited amount. Therefore we put all the guest state in the vcpu.arch
and use the shadow_vcpu in the PACA only for temporary scratch space.
We allocate the vcpu with kzalloc rather than vzalloc, and we don't use
anything in the kvmppc_vcpu_book3s struct, so we don't allocate it.
We don't have a shared page with the guest, but we still need a
kvm_vcpu_arch_shared struct to store the values of various registers,
so we include one in the vcpu_arch struct.
The POWER7 processor has a restriction that all threads in a core have
to be in the same partition. MMU-on kernel code counts as a partition
(partition 0), so we have to do a partition switch on every entry to and
exit from the guest. At present we require the host and guest to run
in single-thread mode because of this hardware restriction.
This code allocates a hashed page table for the guest and initializes
it with HPTEs for the guest's Virtual Real Memory Area (VRMA). We
require that the guest memory is allocated using 16MB huge pages, in
order to simplify the low-level memory management. This also means that
we can get away without tracking paging activity in the host for now,
since huge pages can't be paged or swapped.
This also adds a few new exports needed by the book3s_hv code.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-29 04:21:34 +04:00
|
|
|
$(kvm-book3s_64-objs-y)
|
2011-06-29 04:22:05 +04:00
|
|
|
|
|
|
|
kvm-objs-$(CONFIG_KVM_BOOK3S_64) := $(kvm-book3s_64-module-objs)
|
2009-10-30 08:47:24 +03:00
|
|
|
|
2010-04-16 02:11:58 +04:00
|
|
|
kvm-book3s_32-objs := \
|
|
|
|
$(common-objs-y) \
|
|
|
|
fpu.o \
|
|
|
|
book3s_paired_singles.o \
|
|
|
|
book3s.o \
|
2011-06-29 04:17:58 +04:00
|
|
|
book3s_pr.o \
|
2010-04-16 02:11:58 +04:00
|
|
|
book3s_emulate.o \
|
|
|
|
book3s_interrupts.o \
|
2010-06-30 17:18:46 +04:00
|
|
|
book3s_mmu_hpte.o \
|
2010-04-16 02:11:58 +04:00
|
|
|
book3s_32_mmu_host.o \
|
|
|
|
book3s_32_mmu.o
|
|
|
|
kvm-objs-$(CONFIG_KVM_BOOK3S_32) := $(kvm-book3s_32-objs)
|
|
|
|
|
2013-04-12 18:08:46 +04:00
|
|
|
kvm-objs-$(CONFIG_KVM_MPIC) += mpic.o
|
2013-05-14 17:31:02 +04:00
|
|
|
kvm-objs-$(CONFIG_HAVE_KVM_IRQ_ROUTING) += $(KVM)/irqchip.o
|
2013-04-12 18:08:46 +04:00
|
|
|
|
2009-10-30 08:47:24 +03:00
|
|
|
kvm-objs := $(kvm-objs-m) $(kvm-objs-y)
|
|
|
|
|
2012-02-16 03:40:00 +04:00
|
|
|
obj-$(CONFIG_KVM_E500V2) += kvm.o
|
2011-12-20 19:34:47 +04:00
|
|
|
obj-$(CONFIG_KVM_E500MC) += kvm.o
|
2009-10-30 08:47:24 +03:00
|
|
|
obj-$(CONFIG_KVM_BOOK3S_64) += kvm.o
|
2010-04-16 02:11:58 +04:00
|
|
|
obj-$(CONFIG_KVM_BOOK3S_32) += kvm.o
|
2009-10-30 08:47:24 +03:00
|
|
|
|
2013-10-07 20:47:59 +04:00
|
|
|
obj-$(CONFIG_KVM_BOOK3S_64_PR) += kvm-pr.o
|
|
|
|
obj-$(CONFIG_KVM_BOOK3S_64_HV) += kvm-hv.o
|
|
|
|
|
2011-06-29 04:22:05 +04:00
|
|
|
obj-y += $(kvm-book3s_64-builtin-objs-y)
|