On Fri, Jan 04, 2019 at 07:50:36AM -0800, Sean Christopherson wrote:
> On Fri, Jan 04, 2019 at 04:54:01PM +0800, lantianyu1...@gmail.com wrote:
> > From: Lan Tianyu
> >
> > The dirty bits have already been checked in the previous check of
> > "dirty_bitmap&
On Fri, Jan 04, 2019 at 04:54:01PM +0800, lantianyu1...@gmail.com wrote:
> From: Lan Tianyu
>
> The dirty bits have already been checked in the previous check of
> "dirty_bitmap" and mask must be non-zero value at this point.
>
> Signed-off-by: Lan Tianyu
> ---
> virt/kvm/kvm_main.c | 8
On Fri, Jan 04, 2019 at 04:54:00PM +0800, lantianyu1...@gmail.com wrote:
> From: Lan Tianyu
>
> This patch is to flush tlb via flush list function.
More explanation of why this is beneficial would be nice. Without the
context of the overall series it's not immediately obvious what
l sptes or all MMIO sptes [Paolo]
- Add patches to clean up the memslots/MMIO generation code and fix
a variety of theoretically corner case bugs
Sean Christopherson (27):
KVM: Call kvm_arch_memslots_updated() before updating memslots
KVM: x86/mmu: Detect MMIO generation wrap in any addre
dereference
the new memslots generation, e.g. 0, and incorrectly reuse an old MMIO
spte that was created with (pre-wrap) generation==0.
Fixes: e59dbe09f8e6 ("KVM: Introduce kvm_arch_memslots_updated()")
Cc:
Signed-off-by: Sean Christopherson
---
arch/mips/include/asm/kvm_host.h|
On Mon, Jan 28, 2019 at 03:48:41PM +0100, Christoffer Dall wrote:
> We are currently duplicating the mmu memory cache functionality quite
> heavily between the architectures that support KVM. As a first step,
> move the x86 implementation (which seems to have the most recently
> maintained
On Mon, Apr 08, 2019 at 04:11:25PM +0100, Alexandru Elisei wrote:
> The prototype for the halt() function is incorrect, because halt() doesn't
> take any arguments. Fix it by using the prototype from smp.h.
>
> Signed-off-by: Alexandru Elisei
> ---
Reviewed-by: Sean
where the out-param was not pre-initialized by the
caller.
Opportunistically annotate svm_check_processor_compat() with __init.
Signed-off-by: Sean Christopherson
---
Tested on VMX only.
arch/mips/kvm/mips.c | 4 ++--
arch/powerpc/kvm/powerpc.c | 4 ++--
arch/s390/include/asm
On Wed, Aug 21, 2019 at 04:36:50PM +0100, Steven Price wrote:
> kvm_put_guest() is analogous to put_user() - it writes a single value to
> the guest physical address. The implementation is built upon put_user()
> and so it has the same single copy atomic properties.
What you mean by "single copy
On Thu, Aug 22, 2019 at 04:46:10PM +0100, Steven Price wrote:
> On 22/08/2019 16:28, Sean Christopherson wrote:
> > On Wed, Aug 21, 2019 at 04:36:50PM +0100, Steven Price wrote:
> >> kvm_put_guest() is analogous to put_user() - it writes a single value to
> >>
, but that's it. In
theory, the vast majority of the functional changes are arch agnostic, in
theory...
Sean Christopherson (13):
KVM: Reinstall old memslots if arch preparation fails
KVM: PPC: Move memslot memory allocation into prepare_memory_region()
KVM: x86: Allocate memslot resources
on kvm_free_memslot() paves the
way for simplify kvm_free_memslot(), i.e. dropping its @dont param.
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 6 --
arch/powerpc/kvm/powerpc.c | 6 --
arch/s390/kvm/kvm-s390.c | 6 --
arch/x86/kvm/x86.c | 6 --
include
eed to add validity checks in the arch code that are
technically unnecessary.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_pr.c | 6 +-
arch/s390/kvm/kvm-s390.c | 12 ++--
include/linux/kvm_host.h | 2 +-
virt/kvm/kvm_main.c
Now that all callers of kvm_free_memslot() pass NULL for @dont, remove
the param from the top-level routine and all arch's implementations.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/mips/include/asm/kvm_host.h | 2 +-
arch/powerpc/include/asm/kvm_ppc.h
: bc6678a33d9b9 ("KVM: introduce kvm->srcu and convert
kvm_set_memory_region to SRCU update")
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 23 ---
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm
by the dirty log, i.e. to make it obvious in the
code that the validity of the memslot is guaranteed, as a future patch
will rework memslot handling such that id_to_memslot() can return NULL.
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 62 ++---
arch
a memslot or changing its flags, i.e. implement
logic similar to the dirty bitmap handling, if such functionality is
needed in the future.
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 73 +++--
1 file changed, 44 insertions(+), 29 deletions
Split out the core functionality of setting a memslot into a separate
helper in preparation for moving memslot deletion into its own routine.
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 106 ++--
1 file changed, 63 insertions(+), 43
reduced when deleting a memslot.
However, consecutive deletions will realize the memory savings, i.e.
a second deletion will trim the entry.
Signed-off-by: Sean Christopherson
---
include/linux/kvm_host.h | 5 -
virt/kvm/kvm_main.c | 31 ---
2 files changed, 32
code.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/x86.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b4cfd786d0b6..72ec6272d7cb 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9484,6
-by: Sean Christopherson
---
arch/powerpc/include/asm/kvm_ppc.h | 8 ++--
arch/powerpc/kvm/book3s.c | 12
arch/powerpc/kvm/book3s_hv.c | 25 -
arch/powerpc/kvm/book3s_pr.c | 11 ++-
arch/powerpc/kvm/booke.c | 9
Replace a big pile o' gotos with returns to make it more obvious what
error code is being returned, and to prepare for refactoring the
functional, i.e. post-checks, portion of __kvm_set_memory_region().
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 40
be susceptible to casting shenanigans.
Add function comments to update_memslots() and search_memslots() to
explicitly (and loudly) state how memslots are sorted.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_hv.c | 2 +-
arch/x86/kvm/x86.c
the initial memslot is not strictly necessary
at this juncture, e.g. 'old' could be directly copied from
id_to_memslot(), but keep the pointer usage as id_to_memslot() will be
able to return a NULL pointer once memslots are dynamically sized.
Signed-off-by: Sean Christopherson
---
virt/kvm
On Thu, Sep 19, 2019 at 10:22:42AM +1000, Paul Mackerras wrote:
> On Wed, Sep 11, 2019 at 11:50:35AM -0700, Sean Christopherson wrote:
> > Move the implementations of KVM_GET_DIRTY_LOG and KVM_CLEAR_DIRTY_LOG
> > for CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT into common KVM cod
On Tue, Dec 03, 2019 at 02:14:33PM -0800, Sean Christopherson wrote:
> On Thu, Oct 24, 2019 at 04:07:29PM -0700, Sean Christopherson wrote:
> > The end goal of this series is to dynamically size the memslot array so
> > that KVM allocates memory based on the number of
On Mon, Dec 16, 2019 at 09:25:24AM +0100, Christian Borntraeger wrote:
>
> On 13.12.19 21:01, Sean Christopherson wrote:
> > Applies cleanly on the current kvm/queue and nothing caught fire in
> > testing (though I only re-tested the series as a whole).
>
> Do you
, Dec 17, 2019 at 12:40:23PM -0800, Sean Christopherson wrote:
> Reallocate a rmap array and recalcuate large page compatibility when
> moving an existing memslot to correctly handle the alignment properties
> of the new memslot. The number of rmap entries required at each level
>
the initial memslot is not strictly necessary
at this juncture, e.g. 'old' could be directly copied from
id_to_memslot(), but keep the pointer usage as id_to_memslot() will be
able to return a NULL pointer once memslots are dynamically sized.
Signed-off-by: Sean Christopherson
---
virt/kvm
Acked-by: Christian Borntraeger
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 6 --
arch/powerpc/kvm/powerpc.c | 6 --
arch/s390/kvm/kvm-s390.c | 6 --
arch/x86/kvm/x86.c | 6 --
include/linux/kvm_host.h | 2 --
virt/kvm/arm/mmu.c
x86: fix ...")
- Collect an Acked-by and a Reviewed-by
Sean Christopherson (19):
KVM: x86: Allocate new rmap and large page tracking when moving
memslot
KVM: Reinstall old memslots if arch preparation fails
KVM: Don't free new memslot if allocation of said memslot fails
ode
in kvm_free_memslot() that conditionally frees structures based on its
@dont param.
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/x86.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0911b2f634c5..5f890812fac3 100644
--- a/arch/x86/kvm/x86.c
++
in
this case as there are no resources to be freed.
No functional change intended.
Acked-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index f14bde936c09
reduced when deleting a memslot.
However, consecutive deletions will realize the memory savings, i.e.
a second deletion will trim the entry.
Tested-by: Christoffer Dall
Tested-by: Marc Zyngier
Signed-off-by: Sean Christopherson
---
include/linux/kvm_host.h | 2 +-
virt/kvm/kvm_main.c | 31
: bc6678a33d9b9 ("KVM: introduce kvm->srcu and convert
kvm_set_memory_region to SRCU update")
Reviewed-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 23 ---
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/virt/kvm/kvm_
Replace a big pile o' gotos with returns to make it more obvious what
error code is being returned, and to prepare for refactoring the
functional, i.e. post-checks, portion of __kvm_set_memory_region().
Reviewed-by: Janosch Frank
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Sean
ee_memslot() by eliminating the last usage of its @dont param.
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 2 +-
arch/powerpc/kvm/powerpc.c | 2 +-
arch/s390/kvm/kvm-s390.c | 2 +-
arch/x86/kvm/x86.c | 2 +-
include/linux/kvm_host.h | 2 +-
virt/kvm/arm/mmu.c
Now that all callers of kvm_free_memslot() pass NULL for @dont, remove
the param from the top-level routine and all arch's implementations.
No functional change intended.
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
arch/mips/include/asm/kvm_host.h | 2 +-
arch
s, which
can lead to memory corruption and/or leaking data to guest/userspace.
Note, the arrays for the old memslot are freed by the unconditional call
to kvm_free_memslot() in __kvm_set_memory_region().
Fixes: 05da45583de9b ("KVM: MMU: large page support")
Cc: sta...@vger.kernel.o
eed to add validity checks in the arch code that are
technically unnecessary.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_pr.c | 6 +-
arch/s390/kvm/kvm-s390.c | 12 ++--
include/linux/kvm_host.h | 2 +-
virt/kvm/kvm_main.c
by the dirty log, i.e. to make it obvious in the
code that the validity of the memslot is guaranteed, as a future patch
will rework memslot handling such that id_to_memslot() can return NULL.
Acked-by: Christoffer Dall
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
arch/mips
Add a KVM selftest to test moving the base gfn of a userspace memory
region. The test is primarily targeted at x86 to verify its memslot
metadata is correctly updated, but also provides basic functionality
coverage on other architectures.
Signed-off-by: Sean Christopherson
---
tools/testing
Split out the core functionality of setting a memslot into a separate
helper in preparation for moving memslot deletion into its own routine.
Tested-by: Christoffer Dall
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 106
be susceptible to casting shenanigans.
Add function comments to update_memslots() and search_memslots() to
explicitly (and loudly) state how memslots are sorted.
No functional change intended.
Tested-by: Christoffer Dall
Tested-by: Marc Zyngier
Signed-off-by: Sean Christopherson
---
arch/powerpc
a memslot or changing its flags, e.g. x86 frees
its arch specific memslot metadata during commit_memory_region().
Acked-by: Christoffer Dall
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 73 +++--
1 file changed, 44
Mackerras
Signed-off-by: Sean Christopherson
---
arch/powerpc/include/asm/kvm_ppc.h | 11 ---
arch/powerpc/kvm/book3s.c | 12
arch/powerpc/kvm/book3s_hv.c | 25 -
arch/powerpc/kvm/book3s_pr.c | 11 ++-
arch/powerpc/kvm
.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/x86.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 04d1bf89da0e..8c815b3587b4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm
is guaranteed to succeed. Arch code can still fail, but
it's responsible for its own cleanup in that case.
Eliminating the error path's abuse of kvm_free_memslot() paves the way
for simplifying kvm_free_memslot(), i.e. dropping its @dont param.
Signed-off-by: Sean Christopherson
---
virt/kvm
On Tue, Dec 17, 2019 at 04:56:40PM -0500, Peter Xu wrote:
> On Tue, Dec 17, 2019 at 12:40:23PM -0800, Sean Christopherson wrote:
> > Reallocate a rmap array and recalcuate large page compatibility when
> > moving an existing memslot to correctly handle the alignment properties
On Tue, Dec 17, 2019 at 05:24:46PM -0500, Peter Xu wrote:
> On Tue, Dec 17, 2019 at 12:40:29PM -0800, Sean Christopherson wrote:
> > Explicitly free an allocated-but-unused dirty bitmap instead of relying
> > on kvm_free_memslot() if an error occurs in __kvm_se
On Thu, Oct 24, 2019 at 04:07:29PM -0700, Sean Christopherson wrote:
> The end goal of this series is to dynamically size the memslot array so
> that KVM allocates memory based on the number of memslots in use, as
> opposed to unconditionally allocating memory for the maximum number of
&
Now that all callers of kvm_free_memslot() pass NULL for @dont, remove
the param from the top-level routine and all arch's implementations.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/mips/include/asm/kvm_host.h | 2 +-
arch/powerpc/include/asm/kvm_ppc.h
is guaranteed to succeed. Arch code can still fail, but
it's responsible for its own cleanup in that case.
Eliminating the error path's abuse of kvm_free_memslot() paves the way
for simplifying kvm_free_memslot(), i.e. dropping its @dont param.
Signed-off-by: Sean Christopherson
---
virt/kvm
by the dirty log, i.e. to make it obvious in the
code that the validity of the memslot is guaranteed, as a future patch
will rework memslot handling such that id_to_memslot() can return NULL.
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 62 ++---
arch
Split out the core functionality of setting a memslot into a separate
helper in preparation for moving memslot deletion into its own routine.
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 106 ++--
1 file changed, 63 insertions(+), 43
reduced when deleting a memslot.
However, consecutive deletions will realize the memory savings, i.e.
a second deletion will trim the entry.
Signed-off-by: Sean Christopherson
---
include/linux/kvm_host.h | 5 -
virt/kvm/kvm_main.c | 31 ---
2 files changed, 32
Mackerras
Signed-off-by: Sean Christopherson
---
arch/powerpc/include/asm/kvm_ppc.h | 8 ++--
arch/powerpc/kvm/book3s.c | 12
arch/powerpc/kvm/book3s_hv.c | 25 -
arch/powerpc/kvm/book3s_pr.c | 11 ++-
arch/powerpc/kvm/booke.c
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 6 --
arch/powerpc/kvm/powerpc.c | 6 --
arch/s390/kvm/kvm-s390.c | 6 --
arch/x86/kvm/x86.c | 6 --
include/linux/kvm_host.h | 2 --
virt/kvm/arm/mmu.c | 6 --
virt/kvm/kvm_main.c
: bc6678a33d9b9 ("KVM: introduce kvm->srcu and convert
kvm_set_memory_region to SRCU update")
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 23 ---
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm
are arch agnostic, in
theory...
v2:
- Split "Drop kvm_arch_create_memslot()" into three patches to move
minor functional changes to standalone patches [Janosch].
- Rebase to latest kvm/queue (f0574a1cea5b, "KVM: x86: fix ...")
- Collect an Acked-by and a Reviewed-by
Sea
code.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/x86.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f26f8be4e621..fa80f07ba501 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9601,6
a memslot or changing its flags, i.e. implement
logic similar to the dirty bitmap is handling, if such functionality is
needed in the future.
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 73 +++--
1 file changed, 44 insertions(+), 29 deletions
Replace a big pile o' gotos with returns to make it more obvious what
error code is being returned, and to prepare for refactoring the
functional, i.e. post-checks, portion of __kvm_set_memory_region().
Reviewed-by: Janosch Frank
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 40
in
this case as there are no resources to be freed.
No functional change intended.
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 9afd706dc038..2cb38b2148cb 100644
eed to add validity checks in the arch code that are
technically unnecessary.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_pr.c | 6 +-
arch/s390/kvm/kvm-s390.c | 12 ++--
include/linux/kvm_host.h | 2 +-
virt/kvm/kvm_main.c
the initial memslot is not strictly necessary
at this juncture, e.g. 'old' could be directly copied from
id_to_memslot(), but keep the pointer usage as id_to_memslot() will be
able to return a NULL pointer once memslots are dynamically sized.
Signed-off-by: Sean Christopherson
---
virt/kvm
be susceptible to casting shenanigans.
Add function comments to update_memslots() and search_memslots() to
explicitly (and loudly) state how memslots are sorted.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_hv.c | 2 +-
arch/x86/kvm/x86.c
eed to add validity checks in the arch code that are
technically unnecessary.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_pr.c | 6 +-
arch/s390/kvm/kvm-s390.c | 12 ++--
include/linux/kvm_host.h | 2 +-
virt/kvm/kvm_main.c
by the dirty log, i.e. to make it obvious in the
code that the validity of the memslot is guaranteed, as a future patch
will rework memslot handling such that id_to_memslot() can return NULL.
Acked-by: Christoffer Dall
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
arch/mips
ed-by and a Reviewed-by
Sean Christopherson (15):
KVM: Reinstall old memslots if arch preparation fails
KVM: Don't free new memslot if allocation of said memslot fails
KVM: PPC: Move memslot memory allocation into prepare_memory_region()
KVM: x86: Allocate memslot resources during prepare_m
reduced when deleting a memslot.
However, consecutive deletions will realize the memory savings, i.e.
a second deletion will trim the entry.
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
include/linux/kvm_host.h | 2 +-
virt/kvm/kvm_main.c | 31
be susceptible to casting shenanigans.
Add function comments to update_memslots() and search_memslots() to
explicitly (and loudly) state how memslots are sorted.
No functional change intended.
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_hv.c | 2
Mackerras
Signed-off-by: Sean Christopherson
---
arch/powerpc/include/asm/kvm_ppc.h | 11 ---
arch/powerpc/kvm/book3s.c | 12
arch/powerpc/kvm/book3s_hv.c | 25 -
arch/powerpc/kvm/book3s_pr.c | 11 ++-
arch/powerpc/kvm
: bc6678a33d9b9 ("KVM: introduce kvm->srcu and convert
kvm_set_memory_region to SRCU update")
Reviewed-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 23 ---
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/virt/kvm/kvm_
Split out the core functionality of setting a memslot into a separate
helper in preparation for moving memslot deletion into its own routine.
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 106 ++--
1 file
a memslot or changing its flags, i.e. implement
logic similar to the dirty bitmap handling, if such functionality is
needed in the future.
Acked-by: Christoffer Dall
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 73
is guaranteed to succeed. Arch code can still fail, but
it's responsible for its own cleanup in that case.
Eliminating the error path's abuse of kvm_free_memslot() paves the way
for simplifying kvm_free_memslot(), i.e. dropping its @dont param.
Signed-off-by: Sean Christopherson
---
virt/kvm
code.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/x86.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 19a0dc96beca..fc63b1f07ba9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9628,6
Now that all callers of kvm_free_memslot() pass NULL for @dont, remove
the param from the top-level routine and all arch's implementations.
No functional change intended.
Tested-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
arch/mips/include/asm/kvm_host.h | 2 +-
arch
Replace a big pile o' gotos with returns to make it more obvious what
error code is being returned, and to prepare for refactoring the
functional, i.e. post-checks, portion of __kvm_set_memory_region().
Reviewed-by: Janosch Frank
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 40
the initial memslot is not strictly necessary
at this juncture, e.g. 'old' could be directly copied from
id_to_memslot(), but keep the pointer usage as id_to_memslot() will be
able to return a NULL pointer once memslots are dynamically sized.
Signed-off-by: Sean Christopherson
---
virt/kvm
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 6 --
arch/powerpc/kvm/powerpc.c | 6 --
arch/s390/kvm/kvm-s390.c | 6 --
arch/x86/kvm/x86.c | 6 --
include/linux/kvm_host.h | 2 --
virt/kvm/arm/mmu.c | 6 --
virt/kvm/kvm_main.c
in
this case as there are no resources to be freed.
No functional change intended.
Acked-by: Christoffer Dall
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 52deb5621501
On Thu, Oct 24, 2019 at 10:24:09PM +0200, Paolo Bonzini wrote:
> On 24/10/19 21:38, Sean Christopherson wrote:
> > only
> > * its new index into the array is update.
>
> s/update/tracked/?
Ya, tracked is better. Waffled between updated and tracked, chose poorly :-)
&g
On Tue, Oct 22, 2019 at 05:53:27PM +0200, Paolo Bonzini wrote:
> On 22/10/19 17:52, Sean Christopherson wrote:
> >
> > Anyways, I'm not at all opposed to adding comments, just want to make sure
> > I'm not forgetting something. If it's ok with you, I'll comment the code
On Thu, Oct 24, 2019 at 12:38:56PM -0700, Sean Christopherson wrote:
> On Tue, Oct 22, 2019 at 05:53:27PM +0200, Paolo Bonzini wrote:
> > On 22/10/19 17:52, Sean Christopherson wrote:
> > >
> > > Anyways, I'm not at all opposed to adding comments, just want to make su
On Tue, Oct 22, 2019 at 04:04:21PM +0200, Paolo Bonzini wrote:
> On 22/10/19 02:35, Sean Christopherson wrote:
> > + struct kvm_memory_slot memslots[];
> > + /*
> > +* WARNING: 'memslots' is dynamically-sized. It *MUST* be at the end.
> > +*/
>
> Isn
On Tue, Oct 22, 2019 at 05:30:58PM +0200, Paolo Bonzini wrote:
> On 22/10/19 17:28, Sean Christopherson wrote:
> > On Tue, Oct 22, 2019 at 04:04:18PM +0200, Paolo Bonzini wrote:
> >> On 22/10/19 02:35, Sean Christopherson wrote:
> >>> +static inline int kvm
On Tue, Oct 22, 2019 at 04:04:18PM +0200, Paolo Bonzini wrote:
> On 22/10/19 02:35, Sean Christopherson wrote:
> > +static inline int kvm_shift_memslots_forward(struct kvm_memslots *slots,
> > +struct kvm_memory_slot *new)
> &
On Tue, Oct 22, 2019 at 01:43:42PM +0200, Christoffer Dall wrote:
> On Mon, Oct 21, 2019 at 06:59:22PM -0700, Sean Christopherson wrote:
> > Add an arm specific hook to free the arm64-only sve_state. Doing so
> > eliminates the last functional code from kvm_arch_vcpu_uninit()
off-by: Sean Christopherson
---
arch/x86/kvm/vmx/vmx.c | 42 ++
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 501e88bd6204..70b8d15eb2c5 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/
for adding the extra assert is to provide visual
confirmation of the correctness of moving vcpu allocation to common
code.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/e500mc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
.
Remove the message from the build-time assertion regarding placement of
the struct, as compatibility with the arch usercopy region is no longer
the sole dependent on 'struct kvm_vcpu' being at offset zero.
Signed-off-by: Sean Christopherson
---
arch/powerpc/include/asm/kvm_ppc.h | 7 ---
arch
For reasons unknown, MIPS configures the vCPU allocation cache but
allocates vCPUs via kzalloc(). Allocate from the vCPU cache in
preparation for moving vCPU allocation to common KVM code.
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 6 +++---
1 file changed, 3 insertions
.
Note, the VPID is not consumed until KVM_RUN, slightly delaying its
allocation should have no real function impact. VPID allocation was
arbitrarily placed in the original patch, commit 2384d2b326408 ("KVM:
VMX: Enable Virtual Processor Identification (VPID)").
Signed-off-by: Sean Chri
consumed when KVM_RUN is invoked, i.e. moving
its allocation has no real functional impact.
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/x86.c | 33 +
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index
the allocation has no real functional impact.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_pr.c | 22 +++---
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 1e6b83908668..a933ba60bc7c 100644
off-by: Sean Christopherson
---
arch/x86/kvm/svm.c | 30 --
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index e479ea9bc9da..2f66c52e1b5d 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2140,6 +214
by kvm_arch_destroy_vm().
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/kvm/svm.c | 13 +++--
arch/x86/kvm/vmx/vmx.c | 19 ++-
arch/x86/kvm/x86.c | 20 +++-
4 files
Remove the superfluous kvm_arch_vcpu_free() as it is no longer called
from commmon KVM code. Note, kvm_arch_vcpu_destroy() *is* called from
common code, i.e. choosing which function to whack is not completely
arbitrary.
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/mips.c | 9
1 - 100 of 830 matches
Mail list logo