Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2422825pxk; Mon, 14 Sep 2020 12:58:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPCI0cXmnpk0IP8vOIRTKuAYN7NgV4iF5xRJMbp/318FHOMs63GwiTxA2t8ZF6l+E8o5Rd X-Received: by 2002:a50:9d0a:: with SMTP id v10mr18569824ede.144.1600113486581; Mon, 14 Sep 2020 12:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600113486; cv=none; d=google.com; s=arc-20160816; b=NfqOuUojQUs9HtlAbkAlDEMHrNqkqJpkP37VMZpE/AY0n4oZKtTXbZsxkBw0nXe+2y khw9UqTyl5Dov1qqmKlrXsdtlT21fe/yHxbrPnjEBkNcQ7+EbCaHhKIgRONLbZ7YLHnF IzEHZ7aGQlfrNg3iB3xRIVmEe8RR2jzbLnLEmwSrjJpbaUQixy0//jSEIy9DSCXuhRKC MWYENU7nPcs/YF0w6NMu/nJPO8NdYHsEsLjtyWufF4wZAKJ0FYEIkKK9ZFHt26aeWK9a ILEIA6bPTQ/SLzaR5KMPIfAwsjKYx32z18k3Uc2bG1xQhsMn2otYmRWvf4P1QBo4u9IZ 7ORQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=MFx3xncdql0yheaj3ZVxzpKh+dmlOvzw67GrwXMn4Io=; b=yjt4Xk4HKfWFQuWCkqzQShjwVRjXoEQaRYedo4FB5EjfQbhh3/9kKSKEcBShF0EI7m fhdTwuVukGzZf+cgwG+YhVzEC5l9+rZwGyuYqOcILM8V3tPlt8eFAp+iQ9W+tumf7IXq 0I1x8+b6h1krk4rx+iBlodWhX3VCJ6d7tXUFXI+YenvoXn/J4fMh7IqA5gYGkWTvAk4l rfDqzbiLdMh7lx1mw5VAHNMXcw/G+EykFs8c1cDuSrAgfl/lGrwrtuJnJDZmuc/jNM2D re//Lh+GYoduBW8MaKSR4xbP9WI1uMwlzwC6QLSVMIAZjJGX2/Ezt9mL3JK6BN/phhjv GbDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q24si8784570edb.85.2020.09.14.12.57.44; Mon, 14 Sep 2020 12:58:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726034AbgINT4h (ORCPT + 99 others); Mon, 14 Sep 2020 15:56:37 -0400 Received: from mga01.intel.com ([192.55.52.88]:50094 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbgINT4g (ORCPT ); Mon, 14 Sep 2020 15:56:36 -0400 IronPort-SDR: hk7D+S/eltzBrA8k+iCz6Vn2Jvq5sN5qsds3Dl6VbMyidi36NeEKR9GWCzCnTlfACuRpieBRt4 RmmoKSRRewwg== X-IronPort-AV: E=McAfee;i="6000,8403,9744"; a="177217546" X-IronPort-AV: E=Sophos;i="5.76,427,1592895600"; d="scan'208";a="177217546" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 12:56:35 -0700 IronPort-SDR: MdEN13xKZ0uwTw3Wv173sApK1iJaywuHqbYr3TMFtChpWxcKXl+TFlIX+NRbu8EAlG1FY7yqIC j8hET53nG0uw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,427,1592895600"; d="scan'208";a="287730761" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.160]) by fmsmga008.fm.intel.com with ESMTP; 14 Sep 2020 12:56:35 -0700 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, Josh Poimboeuf , Uros Bizjak , Andi Kleen Subject: [PATCH 0/2] KVM: VMX: Clean up IRQ/NMI handling Date: Mon, 14 Sep 2020 12:56:32 -0700 Message-Id: <20200914195634.12881-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Minor (if there is such a thing for this code) cleanup of KVM's handling of IRQ and NMI exits to move the invocation of the IRQ handler to a standalone assembly routine, and to then consolidate the NMI handling to use the same indirect call approach instead of using INTn. The IRQ cleanup was suggested by Josh Poimboeuf in the context of a false postive objtool warning[*]. I believe Josh intended to use UNWIND hints instead of trickery to avoid objtool complaints. I opted for trickery in the form of a redundant, but explicit, restoration of RSP after the hidden IRET. AFAICT, there are no existing UNWIND hints that would let objtool know that the stack is magically being restored, and adding a new hint to save a single MOV , instruction seemed like overkill. The NMI consolidation was loosely suggested by Andi Kleen. Andi's actual suggestion was to export and directly call the NMI handler, but that's a more involved change (unless I'm misunderstanding the wants of the NMI handler), whereas piggybacking the IRQ code is simple and seems like a worthwhile intermediate step. [*] https://lkml.kernel.org/r/20200908205947.arryy75c5cvldps7@treble Sean Christopherson (2): KVM: VMX: Move IRQ invocation to assembly subroutine KVM: VMX: Invoke NMI handler via indirect call instead of INTn arch/x86/kvm/vmx/vmenter.S | 28 +++++++++++++++++ arch/x86/kvm/vmx/vmx.c | 61 +++++++++++--------------------------- 2 files changed, 45 insertions(+), 44 deletions(-) -- 2.28.0