From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FA1FCCA47B for ; Tue, 14 Jun 2022 23:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357745AbiFNXFy (ORCPT ); Tue, 14 Jun 2022 19:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237615AbiFNXFw (ORCPT ); Tue, 14 Jun 2022 19:05:52 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83F3E4FC5A for ; Tue, 14 Jun 2022 16:05:51 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id ob5-20020a17090b390500b001e2f03294a7so228291pjb.8 for ; Tue, 14 Jun 2022 16:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:message-id:mime-version:subject:from:to:cc; bh=A9rUXvdVK65qUUpsbFmN+bngaxum3AL+F3dm7wAVHWY=; b=Umptkd+8NKLxaEKI4cNl2ZYx3SCrphu2j/zUusXMdXqbdBYvUEArY/0NMWP0kdza0h LP9dCvPGMMd7QKpNr/5lRShkHYOQq6F/dkZUgmsBulpD86vfye9wDj7nQvdUqGyvEVcO CmWXNbbukqV5APzsTaVJK1/+ObQYKj/CiaEK4NFdPeiJ7mMap+5V+kdCXl8YsNb1LQnD KVdviBv1MQY0L39MoHtJjQKe4yAjlVw9y6kRUtoENnKi4NZ8Jru+Sc5rbNq7DYisMS/G ZIJtai4Mtb18MT4DJ1KowTAX2CKu3l5/Xf0PuW9CTI/6Wo5QvICSnOuiXGxnB+1hcYGx NCEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:message-id:mime-version:subject :from:to:cc; bh=A9rUXvdVK65qUUpsbFmN+bngaxum3AL+F3dm7wAVHWY=; b=Jf7siwVSIsgErNjZo7l36M9e9/PdDiK/HTjk12z2uca5VAMqwgPSlyAhk9dVRGaRNR nEbVvvCLNk4GOtpylMpUZy4kCRAmvS8K/l6yHDQR1pxTarJ+w06kdhqeE1c8rlyV7WaC u4qc0uyvrrbHmiD0znzeiJmiFmC811gbKSh8+uqDZldendNKl1obE2gUd/VOBk7M4EEp Jy/Gedv/KJOwqQ7W7vsZ/8skWq0YHMWT/LCA80S+PNqKLS49RiRWOnh1UsetfWgoFEOu aQFuosuJ9pZx4AfuokKU+08Wf6ONOQ3OL1BIvXZTizbzIWMNDaaiijVuQCc758a/igvU QGhg== X-Gm-Message-State: AJIora8Ye/fZhSrjLXATSzXN9dbiAQJ0NB5gighyncWbfYkZPY3O6Yu4 zygs1F7m2zcLFZjzi3dvUFz3MfVBPZg= X-Google-Smtp-Source: AGRyM1uXOIC51AJADaKJ+5YB7+WUpl3cweTvMN7oZYuXo9Q8RhX6gXBSHPORq9zbag4Z8a5av8va5iKaLLs= X-Received: from seanjc.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:3e5]) (user=seanjc job=sendgmr) by 2002:a17:903:2341:b0:167:4b11:a8e with SMTP id c1-20020a170903234100b001674b110a8emr6361773plh.10.1655247950995; Tue, 14 Jun 2022 16:05:50 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 14 Jun 2022 23:05:43 +0000 Message-Id: <20220614230548.3852141-1-seanjc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog Subject: [PATCH 0/5] KVM: x86: Move apicv_active into kvm_lapic From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move apicv_active into struct kvm_lapic; KVM enables APICv if and only if a VM/vCPU has an in-kernel APIC. This was posted a while back as a one-off patch in an APICv cleanup[*]. The idea and most of the changes remain the same, though I eked out a few more cleanups. [*] https://lore.kernel.org/all/20211022004927.1448382-4-seanjc@google.com/ Sean Christopherson (5): KVM: SVM: Drop unused AVIC / kvm_x86_ops declarations KVM: x86: Drop @vcpu parameter from kvm_x86_ops.hwapic_isr_update() KVM: x86: Check for in-kernel xAPIC when querying APICv for directed yield KVM: x86: Move "apicv_active" into "struct kvm_lapic" KVM: x86: Use lapic_in_kernel() to query in-kernel APIC in APICv helper arch/x86/include/asm/kvm_host.h | 3 +-- arch/x86/kvm/lapic.c | 38 ++++++++++++--------------------- arch/x86/kvm/lapic.h | 3 ++- arch/x86/kvm/svm/svm.c | 5 +++-- arch/x86/kvm/svm/svm.h | 4 ---- arch/x86/kvm/vmx/vmx.c | 5 +++-- arch/x86/kvm/x86.c | 14 ++++++------ 7 files changed, 31 insertions(+), 41 deletions(-) base-commit: 8baacf67c76c560fed954ac972b63e6e59a6fba0 -- 2.36.1.476.g0c4daa206d-goog