public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Maxim Levitsky <mlevitsk@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Joerg Roedel <joro@8bytes.org>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	kvm@vger.kernel.org, iommu@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul
Date: Wed, 8 Dec 2021 23:43:46 +0000	[thread overview]
Message-ID: <YbFDMjUdVltTSeHr@google.com> (raw)
In-Reply-To: <39c885fc6455dd0aa2f8643e725422851430f9ec.camel@redhat.com>

On Thu, Dec 09, 2021, Maxim Levitsky wrote:
> >   KVM: SVM: Remove unnecessary APICv/AVIC update in vCPU unblocking path

...

> Probably just luck (can't reproduce this anymore) but
> while running some kvm unit tests with this patch series (and few my patches
> for AVIC co-existance which shouldn't affect this) I got this
> 
> (warning about is_running already set)

My best guess would be the above commit that dropped the handling in the unblock
path, but I haven't been able to concoct a scenario where avic_physical_id_cache
can get out of sync with respect to kvm_vcpu_apicv_active().

> Dec 08 22:53:26 amdlaptop kernel: ------------[ cut here ]------------
> Dec 08 22:53:26 amdlaptop kernel: WARNING: CPU: 3 PID: 72804 at arch/x86/kvm/svm/avic.c:1045 avic_vcpu_load+0xe3/0x100 [kvm_amd]
> Dec 08 22:53:26 amdlaptop kernel: Modules linked in: kvm_amd(O) ccp rng_core kvm(O) irqbypass xt_conntrack ip6table_filter ip6_tables snd_soc_dmic snd_acp3x_>
> Dec 08 22:53:26 amdlaptop kernel:  r8169 realtek 8250_pci usbmon nbd fuse autofs4 [last unloaded: rng_core]
> Dec 08 22:53:26 amdlaptop kernel: CPU: 3 PID: 72804 Comm: qemu-system-i38 Tainted: G           O      5.16.0-rc4.unstable #6
> Dec 08 22:53:26 amdlaptop kernel: Hardware name: LENOVO 20UF001CUS/20UF001CUS, BIOS R1CET65W(1.34 ) 06/17/2021
> Dec 08 22:53:26 amdlaptop kernel: RIP: 0010:avic_vcpu_load+0xe3/0x100 [kvm_amd]
> Dec 08 22:53:26 amdlaptop kernel: Code: 0d 9f e0 85 c0 74 e8 4c 89 f6 4c 89 ff e8 a5 99 f4 e0 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b 5b 41 5c 41 5d 41 5e 41 >
> Dec 08 22:53:26 amdlaptop kernel: RSP: 0018:ffffc9000b17bba8 EFLAGS: 00010247
> Dec 08 22:53:26 amdlaptop kernel: RAX: 6f63203a756d6571 RBX: ffff888106194740 RCX: ffff88812e7ac000
> Dec 08 22:53:26 amdlaptop kernel: RDX: ffff8883ff6c0000 RSI: 0000000000000003 RDI: 0000000000000003
> Dec 08 22:53:26 amdlaptop kernel: RBP: ffffc9000b17bbd0 R08: ffff888106194740 R09: 0000000000000000
> Dec 08 22:53:26 amdlaptop kernel: R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000003
> Dec 08 22:53:26 amdlaptop kernel: R13: 0000000000000003 R14: ffff88810023b060 R15: dead000000000100
> Dec 08 22:53:26 amdlaptop kernel: FS:  0000000000000000(0000) GS:ffff8883ff6c0000(0000) knlGS:0000000000000000
> Dec 08 22:53:26 amdlaptop kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> Dec 08 22:53:26 amdlaptop kernel: CR2: 00005587e812f958 CR3: 0000000105f31000 CR4: 0000000000350ee0
> Dec 08 22:53:26 amdlaptop kernel: DR0: 00000000004008da DR1: 0000000000000000 DR2: 0000000000000000
> Dec 08 22:53:26 amdlaptop kernel: DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Dec 08 22:53:26 amdlaptop kernel: Call Trace:
> Dec 08 22:53:26 amdlaptop kernel:  <TASK>
> Dec 08 22:53:26 amdlaptop kernel:  svm_vcpu_load+0x56/0x60 [kvm_amd]
> Dec 08 22:53:26 amdlaptop kernel:  kvm_arch_vcpu_load+0x32/0x210 [kvm]
> Dec 08 22:53:26 amdlaptop kernel:  vcpu_load+0x34/0x40 [kvm]
> Dec 08 22:53:26 amdlaptop kernel:  kvm_arch_destroy_vm+0xd4/0x1c0 [kvm]
> Dec 08 22:53:26 amdlaptop kernel:  kvm_destroy_vm+0x163/0x250 [kvm]
> Dec 08 22:53:26 amdlaptop kernel:  kvm_put_kvm+0x26/0x40 [kvm]
> Dec 08 22:53:26 amdlaptop kernel:  kvm_vm_release+0x22/0x30 [kvm]
> Dec 08 22:53:26 amdlaptop kernel:  __fput+0x94/0x250
> Dec 08 22:53:26 amdlaptop kernel:  ____fput+0xe/0x10
> Dec 08 22:53:26 amdlaptop kernel:  task_work_run+0x63/0xa0
> Dec 08 22:53:26 amdlaptop kernel:  do_exit+0x358/0xa30
> Dec 08 22:53:26 amdlaptop kernel:  do_group_exit+0x3b/0xa0
> Dec 08 22:53:26 amdlaptop kernel:  get_signal+0x15b/0x880
> Dec 08 22:53:26 amdlaptop kernel:  ? _copy_to_user+0x20/0x30
> Dec 08 22:53:26 amdlaptop kernel:  ? put_timespec64+0x3d/0x60
> Dec 08 22:53:26 amdlaptop kernel:  arch_do_signal_or_restart+0x106/0x740
> Dec 08 22:53:26 amdlaptop kernel:  ? hrtimer_nanosleep+0x9f/0x120
> Dec 08 22:53:26 amdlaptop kernel:  ? __hrtimer_init+0xd0/0xd0
> Dec 08 22:53:26 amdlaptop kernel:  exit_to_user_mode_prepare+0x112/0x1f0
> Dec 08 22:53:26 amdlaptop kernel:  syscall_exit_to_user_mode+0x17/0x40
> Dec 08 22:53:26 amdlaptop kernel:  do_syscall_64+0x42/0x80
> Dec 08 22:53:26 amdlaptop kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xae
> Dec 08 22:53:26 amdlaptop kernel: RIP: 0033:0x7f537abb13b5
> Dec 08 22:53:26 amdlaptop kernel: Code: Unable to access opcode bytes at RIP 0x7f537abb138b.
> Dec 08 22:53:26 amdlaptop kernel: RSP: 002b:00007f5376a39680 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6
> Dec 08 22:53:26 amdlaptop kernel: RAX: fffffffffffffdfc RBX: 00007f5376a396d0 RCX: 00007f537abb13b5
> Dec 08 22:53:26 amdlaptop kernel: RDX: 00007f5376a396d0 RSI: 0000000000000000 RDI: 0000000000000000
> Dec 08 22:53:26 amdlaptop kernel: RBP: 00007f5376a396c0 R08: 0000000000000000 R09: 0000000000000000
> Dec 08 22:53:26 amdlaptop kernel: R10: 00007f5376a396c0 R11: 0000000000000293 R12: 00007f5376a3b640
> Dec 08 22:53:26 amdlaptop kernel: R13: 0000000000000002 R14: 00007f537ab66880 R15: 0000000000000000
> Dec 08 22:53:26 amdlaptop kernel:  </TASK>
> Dec 08 22:53:26 amdlaptop kernel: ---[ end trace 676058aaf29d0267 ]---
> 
> 
> I'll post my patches tomorrow, after some more testing.
> 
> Best regards,
> 	Maxim Levitsky
> 

  parent reply	other threads:[~2021-12-08 23:43 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08  1:52 [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 01/26] KVM: fix avic_set_running for preemptable kernels Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 02/26] KVM: nVMX: Ensure vCPU honors event request if posting nested IRQ fails Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 03/26] KVM: VMX: Clean up PI pre/post-block WARNs Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 04/26] KVM: VMX: Handle PI wakeup shenanigans during vcpu_put/load Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 05/26] KVM: Drop unused kvm_vcpu.pre_pcpu field Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 06/26] KVM: Move x86 VMX's posted interrupt list_head to vcpu_vmx Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 07/26] KVM: VMX: Move preemption timer <=> hrtimer dance to common x86 Sean Christopherson
2023-03-29 12:34   ` Tudor Ambarus
2023-03-29 13:47     ` Paolo Bonzini
2023-03-29 15:22       ` Tudor Ambarus
2023-03-30  7:12         ` Tudor Ambarus
2021-12-08  1:52 ` [PATCH v3 08/26] KVM: x86: Unexport LAPIC's switch_to_{hv,sw}_timer() helpers Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 09/26] KVM: x86: Remove defunct pre_block/post_block kvm_x86_ops hooks Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 10/26] KVM: SVM: Signal AVIC doorbell iff vCPU is in guest mode Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 11/26] KVM: SVM: Don't bother checking for "running" AVIC when kicking for IPIs Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 12/26] KVM: SVM: Remove unnecessary APICv/AVIC update in vCPU unblocking path Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 13/26] KVM: SVM: Use kvm_vcpu_is_blocking() in AVIC load to handle preemption Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 14/26] KVM: SVM: Skip AVIC and IRTE updates when loading blocking vCPU Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 15/26] iommu/amd: KVM: SVM: Use pCPU to infer IsRun state for IRTE Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 16/26] KVM: VMX: Don't do full kick when triggering posted interrupt "fails" Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 17/26] KVM: VMX: Wake vCPU when delivering posted IRQ even if vCPU == this vCPU Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 18/26] KVM: VMX: Pass desired vector instead of bool for triggering posted IRQ Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 19/26] KVM: VMX: Fold fallback path into triggering posted IRQ helper Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 20/26] KVM: VMX: Don't do full kick when handling posted interrupt wakeup Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 21/26] KVM: SVM: Drop AVIC's intermediate avic_set_running() helper Sean Christopherson
2021-12-08 14:43   ` Paolo Bonzini
2021-12-08 15:03     ` Maxim Levitsky
2021-12-08 15:43     ` Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 22/26] KVM: SVM: Move svm_hardware_setup() and its helpers below svm_x86_ops Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 23/26] KVM: SVM: Nullify vcpu_(un)blocking() hooks if AVIC is disabled Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 24/26] KVM: x86: Skip APICv update if APICv is disable at the module level Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 25/26] KVM: x86: Drop NULL check on kvm_x86_ops.check_apicv_inhibit_reasons Sean Christopherson
2021-12-08  1:52 ` [PATCH v3 26/26] KVM: x86: Unexport __kvm_request_apicv_update() Sean Christopherson
2021-12-08  9:04 ` [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul Paolo Bonzini
2021-12-08 14:51 ` Paolo Bonzini
2021-12-08 23:00 ` Maxim Levitsky
2021-12-08 23:16   ` Maxim Levitsky
2021-12-08 23:34     ` Maxim Levitsky
2021-12-09  0:04       ` Sean Christopherson
2021-12-09  6:36         ` Maxim Levitsky
2021-12-09  0:02     ` Sean Christopherson
2021-12-09 14:29       ` Paolo Bonzini
2021-12-09 14:48         ` Maxim Levitsky
2021-12-09 15:45           ` Sean Christopherson
2021-12-09 16:03             ` Maxim Levitsky
2021-12-09  1:37     ` Sean Christopherson
2021-12-09  6:31       ` Maxim Levitsky
2021-12-08 23:43   ` Sean Christopherson [this message]
2021-12-09  6:34     ` Maxim Levitsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YbFDMjUdVltTSeHr@google.com \
    --to=seanjc@google.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox