kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] Early batch of KVM changes for 4.3 merge window
@ 2015-08-14 23:57 Paolo Bonzini
  2015-09-01  0:47 ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2015-08-14 23:57 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, gleb, kvm

Linus,

the merge window will likely coincide with my two-week vacation
across August and September.

Rather than hoping for an -rc8, I'm sending now what I have.  The
PPC and ARM parts might come a few days after the official end
of the merge window.

The uncommon name for the tag (you said you look at things like
that) is due to the other pull request that is in flight for 4.2.
You can see on kernel.org that I and the other maintainers before
me have always used this format to archive what is sent during the
merge window.  The pull request also matches the next branch of
the repository.

The following changes since commit 0da029ed7ee5fdf49a2a0e14160c3e9999be9292:

  KVM: x86: rename quirk constants to KVM_X86_QUIRK_* (2015-07-23 08:24:42 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/kvm-4.3-1

for you to fetch changes up to 4d283ec908e617fa28bcb06bce310206f0655d67:

  x86/kvm: Rename VMX's segment access rights defines (2015-08-15 00:47:13 +0200)

----------------------------------------------------------------
A very small release for x86 and s390 KVM.

s390: timekeeping changes, cleanups and fixes

x86: support for Hyper-V MSRs to report crashes, and a bunch of cleanups.

One interesting feature that was planned for 4.3 (emulating the local
APIC in kernel while keeping the IOAPIC and 8254 in userspace) had to
be delayed because Intel complained about my reading of the manual.

----------------------------------------------------------------
Alex Williamson (1):
      KVM: MTRR: Use default type for non-MTRR-covered gfn before WARN_ON

Andrey Smetanin (4):
      kvm/x86: move Hyper-V MSR's/hypercall code into hyperv.c file
      kvm: introduce vcpu_debug = kvm_debug + vcpu context
      kvm/x86: added hyper-v crash msrs into kvm hyperv context
      kvm/x86: add sending hyper-v crash notification to user space

Andy Lutomirski (1):
      x86/kvm: Rename VMX's segment access rights defines

Christian Borntraeger (10):
      KVM: s390: add kvm stat counter for all diagnoses
      KVM: s390: Improve vcpu event debugging for diagnoses
      KVM: s390: VCPU_EVENT cleanup for prefix changes
      KVM: s390: add more debug data for the pfault diagnoses
      KVM: s390: Fixup interrupt vcpu event messages and levels
      KVM: s390: remove outdated documentation
      KVM: s390: improve debug feature usage
      KVM: s390: adapt debug entries for instruction handling
      KVM: s390: Provide global debug log
      KVM: s390: log capability enablement and vm attribute changes

David Hildenbrand (3):
      KVM: s390: filter space-switch events when PER is enforced
      KVM: s390: remove "from (user|kernel)" from irq injection messages
      KVM: s390: more irq names for trace events

Dominik Dingel (3):
      KVM: s390: propagate error from enable storage key
      KVM: s390: clean up cmma_enable check
      KVM: s390: only reset CMMA state if it was enabled before

Eugene Korenevsky (1):
      KVM: nVMX: VMX instructions: add checks for #GP/#SS exceptions

Fan Zhang (1):
      KVM: s390: host STP toleration for VMs

Mihai Donțu (1):
      kvm/x86: add support for MONITOR_TRAP_FLAG

Nicholas Krause (2):
      KVM: s390: Fix assumption that kvm_set_irq_routing is always run successfully
      kvm: x86: Fix error handling in the function kvm_lapic_sync_from_vapic

Paolo Bonzini (7):
      KVM: svm: handle KVM_X86_QUIRK_CD_NW_CLEARED in svm_get_mt_mask
      Merge tag 'kvm-s390-next-20150728' of git://git.kernel.org/.../kvms390/linux into kvm-next
      KVM: move code related to KVM_SET_BOOT_CPU_ID to x86
      KVM: x86: remove unnecessary memory barriers for shared MSRs
      KVM: document memory barriers for kvm->vcpus/kvm->online_vcpus
      KVM: x86: clean/fix memory barriers in irqchip_in_kernel
      Merge tag 'kvm-s390-next-20150812' of git://git.kernel.org/.../kvms390/linux into HEAD

Wei Huang (1):
      KVM: x86/vPMU: Fix unnecessary signed extension for AMD PERFCTRn

Xiao Guangrong (9):
      KVM: MMU: fix validation of mmio page fault
      KVM: MMU: move FNAME(is_rsvd_bits_set) to mmu.c
      KVM: MMU: introduce rsvd_bits_validate
      KVM: MMU: split reset_rsvds_bits_mask
      KVM: MMU: split reset_rsvds_bits_mask_ept
      KVM: MMU: introduce the framework to check zero bits on sptes
      KVM: MMU: introduce is_shadow_zero_bits_set()
      KVM: MMU: fully check zero bits for sptes
      KVM: VMX: drop ept misconfig check

 Documentation/s390/00-INDEX       |   2 -
 Documentation/s390/kvm.txt        | 125 -------------
 Documentation/virtual/kvm/api.txt |   5 +
 arch/s390/include/asm/etr.h       |   3 +
 arch/s390/include/asm/kvm_host.h  |   4 +-
 arch/s390/kernel/time.c           |  16 +-
 arch/s390/kvm/diag.c              |  13 +-
 arch/s390/kvm/guestdbg.c          |  35 ++++
 arch/s390/kvm/interrupt.c         |  98 +++++-----
 arch/s390/kvm/kvm-s390.c          | 114 ++++++++++--
 arch/s390/kvm/kvm-s390.h          |  11 +-
 arch/s390/kvm/priv.c              |  28 +--
 arch/s390/kvm/sigp.c              |  13 +-
 arch/s390/kvm/trace-s390.h        |  33 ++--
 arch/x86/include/asm/kvm_host.h   |  43 ++++-
 arch/x86/include/asm/vmx.h        |  47 ++---
 arch/x86/include/uapi/asm/vmx.h   |   2 +
 arch/x86/kvm/Makefile             |   4 +-
 arch/x86/kvm/hyperv.c             | 377 ++++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/hyperv.h             |  32 ++++
 arch/x86/kvm/i8259.c              |  15 +-
 arch/x86/kvm/irq.h                |   8 +-
 arch/x86/kvm/lapic.c              |   5 +-
 arch/x86/kvm/lapic.h              |   2 +-
 arch/x86/kvm/mmu.c                | 285 ++++++++++++++++------------
 arch/x86/kvm/mmu.h                |   4 +-
 arch/x86/kvm/mtrr.c               |   8 +-
 arch/x86/kvm/paging_tmpl.h        |  13 +-
 arch/x86/kvm/pmu_amd.c            |   2 -
 arch/x86/kvm/svm.c                |  16 +-
 arch/x86/kvm/vmx.c                | 181 +++++++++---------
 arch/x86/kvm/x86.c                | 323 +++++---------------------------
 arch/x86/kvm/x86.h                |   5 +
 include/linux/kvm_host.h          |  24 +--
 include/uapi/linux/kvm.h          |   2 +
 virt/kvm/kvm_main.c               |  19 +-
 36 files changed, 1088 insertions(+), 829 deletions(-)
 delete mode 100644 Documentation/s390/kvm.txt
 create mode 100644 arch/x86/kvm/hyperv.c
 create mode 100644 arch/x86/kvm/hyperv.h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Early batch of KVM changes for 4.3 merge window
  2015-08-14 23:57 [GIT PULL] Early batch of KVM changes for 4.3 merge window Paolo Bonzini
@ 2015-09-01  0:47 ` Linus Torvalds
  2015-09-01  5:45   ` Xiao Guangrong
  2015-09-01 17:03   ` Paolo Bonzini
  0 siblings, 2 replies; 6+ messages in thread
From: Linus Torvalds @ 2015-09-01  0:47 UTC (permalink / raw)
  To: Paolo Bonzini, Xiao Guangrong
  Cc: Linux Kernel Mailing List, Gleb Natapov, KVM list

Hmm:

On Fri, Aug 14, 2015 at 4:57 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Xiao Guangrong (9):
>       KVM: MMU: fully check zero bits for sptes

The above commit causes an annoying new compiler warning.

The warning is bogus ("variable 'leaf' possibly uninitialized"),
because the use of the variable is protected by the 'bool reserved'
flag, but gcc is apparently not smart enough to understand that.

Since bogus warnings cause people to possibly ignore the *real*
warnings, this should be fixed. Maybe the code should get rid of that
'reserved' flag, and instead initialize "leaf" to zero, and use that
as the flag instead (since zero isn't a valid level)? That would
actually avoid an extra variable, and would get rid of the warning.

Hmm?

                 Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Early batch of KVM changes for 4.3 merge window
  2015-09-01  0:47 ` Linus Torvalds
@ 2015-09-01  5:45   ` Xiao Guangrong
  2015-09-01 17:05     ` Paolo Bonzini
  2015-09-01 17:03   ` Paolo Bonzini
  1 sibling, 1 reply; 6+ messages in thread
From: Xiao Guangrong @ 2015-09-01  5:45 UTC (permalink / raw)
  To: Linus Torvalds, Paolo Bonzini
  Cc: Linux Kernel Mailing List, Gleb Natapov, KVM list


Linus, I am sorry for the annoyance.

On 09/01/2015 08:47 AM, Linus Torvalds wrote:
> Hmm:
>
> On Fri, Aug 14, 2015 at 4:57 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> Xiao Guangrong (9):
>>        KVM: MMU: fully check zero bits for sptes
>
> The above commit causes an annoying new compiler warning.
>
> The warning is bogus ("variable 'leaf' possibly uninitialized"),
> because the use of the variable is protected by the 'bool reserved'
> flag, but gcc is apparently not smart enough to understand that.
>
> Since bogus warnings cause people to possibly ignore the *real*
> warnings, this should be fixed. Maybe the code should get rid of that
> 'reserved' flag, and instead initialize "leaf" to zero, and use that
> as the flag instead (since zero isn't a valid level)? That would
> actually avoid an extra variable, and would get rid of the warning.
>

The logic in that code is: if 'reserved' is true, print out the info in
spte[root - leaf]. I am afraid it's not good to use 'leaf' both for the
array index and reserved indicator. Or if i missed something please let
me know.

Actually i triggered this warning in my another box and posted a patch
to fix it which can be found at:
http://lkml.iu.edu/hypermail/linux/kernel/1508.2/02771.html
I guess Paolo is currently busy with KVM forum so the patch has not been
reviewed yet.

The patch simply initialized 'leaf' to the highest value to stop printing
the info, but as you noticed this is no real problem in the code just
stop GCC's complaint.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Early batch of KVM changes for 4.3 merge window
  2015-09-01  0:47 ` Linus Torvalds
  2015-09-01  5:45   ` Xiao Guangrong
@ 2015-09-01 17:03   ` Paolo Bonzini
  2015-09-01 22:34     ` Xiao Guangrong
  1 sibling, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2015-09-01 17:03 UTC (permalink / raw)
  To: Linus Torvalds, Xiao Guangrong
  Cc: Linux Kernel Mailing List, Gleb Natapov, KVM list



On 01/09/2015 02:47, Linus Torvalds wrote:
> Hmm:
> 
> On Fri, Aug 14, 2015 at 4:57 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> Xiao Guangrong (9):
>>       KVM: MMU: fully check zero bits for sptes
> 
> The above commit causes an annoying new compiler warning.
> 
> The warning is bogus ("variable 'leaf' possibly uninitialized"),
> because the use of the variable is protected by the 'bool reserved'
> flag, but gcc is apparently not smart enough to understand that.

Unfortunately it doesn't reproduce on all compiler versions.

Something like this should do it:

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index fb16a8ea3dee..3c745f3abde8 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3309,13 +3309,13 @@ walk_shadow_page_get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep)
 
 	walk_shadow_page_lockless_begin(vcpu);
 
-	for (shadow_walk_init(&iterator, vcpu, addr), root = iterator.level;
+	for (shadow_walk_init(&iterator, vcpu, addr),
+		 leaf = root = iterator.level;
 	     shadow_walk_okay(&iterator);
 	     __shadow_walk_next(&iterator, spte)) {
-		leaf = iterator.level;
 		spte = mmu_spte_get_lockless(iterator.sptep);
 
-		sptes[leaf - 1] = spte;
+		sptes[--leaf] = spte;
 
 		if (!is_shadow_present_pte(spte))
 			break;
@@ -3329,7 +3329,7 @@ walk_shadow_page_get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep)
 	if (reserved) {
 		pr_err("%s: detect reserved bits on spte, addr 0x%llx, dump hierarchy:\n",
 		       __func__, addr);
-		while (root >= leaf) {
+		while (root > leaf) {
 			pr_err("------ spte 0x%llx level %d.\n",
 			       sptes[root - 1], root);
 			root--;


But honestly I haven't even compiled it yet.  Xiao, what do you think?

Paolo

> Since bogus warnings cause people to possibly ignore the *real*
> warnings, this should be fixed. Maybe the code should get rid of that
> 'reserved' flag, and instead initialize "leaf" to zero, and use that
> as the flag instead (since zero isn't a valid level)? That would
> actually avoid an extra variable, and would get rid of the warning.
> 
> Hmm?
> 
>                  Linus
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Early batch of KVM changes for 4.3 merge window
  2015-09-01  5:45   ` Xiao Guangrong
@ 2015-09-01 17:05     ` Paolo Bonzini
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2015-09-01 17:05 UTC (permalink / raw)
  To: Xiao Guangrong, Linus Torvalds
  Cc: Linux Kernel Mailing List, Gleb Natapov, KVM list



On 01/09/2015 07:45, Xiao Guangrong wrote:
> 
> 
> Actually i triggered this warning in my another box and posted a patch
> to fix it which can be found at:
> http://lkml.iu.edu/hypermail/linux/kernel/1508.2/02771.html
> I guess Paolo is currently busy with KVM forum so the patch has not been
> reviewed yet.

Currently I'm busy with the Dolomites, actually.  I'll send a fix
together with the PPC+ARM pull request.

Paolo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Early batch of KVM changes for 4.3 merge window
  2015-09-01 17:03   ` Paolo Bonzini
@ 2015-09-01 22:34     ` Xiao Guangrong
  0 siblings, 0 replies; 6+ messages in thread
From: Xiao Guangrong @ 2015-09-01 22:34 UTC (permalink / raw)
  To: Paolo Bonzini, Linus Torvalds
  Cc: Linux Kernel Mailing List, Gleb Natapov, KVM list



On 09/02/2015 01:03 AM, Paolo Bonzini wrote:

>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index fb16a8ea3dee..3c745f3abde8 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -3309,13 +3309,13 @@ walk_shadow_page_get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep)
>
>   	walk_shadow_page_lockless_begin(vcpu);
>
> -	for (shadow_walk_init(&iterator, vcpu, addr), root = iterator.level;
> +	for (shadow_walk_init(&iterator, vcpu, addr),
> +		 leaf = root = iterator.level;
>   	     shadow_walk_okay(&iterator);
>   	     __shadow_walk_next(&iterator, spte)) {
> -		leaf = iterator.level;
>   		spte = mmu_spte_get_lockless(iterator.sptep);
>
> -		sptes[leaf - 1] = spte;
> +		sptes[--leaf] = spte;
>
>   		if (!is_shadow_present_pte(spte))
>   			break;
> @@ -3329,7 +3329,7 @@ walk_shadow_page_get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep)
>   	if (reserved) {
>   		pr_err("%s: detect reserved bits on spte, addr 0x%llx, dump hierarchy:\n",
>   		       __func__, addr);
> -		while (root >= leaf) {
> +		while (root > leaf) {
>   			pr_err("------ spte 0x%llx level %d.\n",
>   			       sptes[root - 1], root);
>   			root--;
>
>
> But honestly I haven't even compiled it yet.  Xiao, what do you think?
>

It looks good to me!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-01 22:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-14 23:57 [GIT PULL] Early batch of KVM changes for 4.3 merge window Paolo Bonzini
2015-09-01  0:47 ` Linus Torvalds
2015-09-01  5:45   ` Xiao Guangrong
2015-09-01 17:05     ` Paolo Bonzini
2015-09-01 17:03   ` Paolo Bonzini
2015-09-01 22:34     ` Xiao Guangrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).