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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2336FC4363D for ; Tue, 22 Sep 2020 13:38:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDE5520936 for ; Tue, 22 Sep 2020 13:38:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="f3dG14wE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbgIVNiw (ORCPT ); Tue, 22 Sep 2020 09:38:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22258 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbgIVNia (ORCPT ); Tue, 22 Sep 2020 09:38:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600781908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WKA+W9RGb28j92jAhf1JQdc576NbRme2KTggAyn0cGE=; b=f3dG14wEUqDn2aB1m7zPz4zuaqlIv+he18EO60OSdWqgle6n1ppg9aCoI0qKPooWDMn81q AHGfvo5BSDmuQEGMQcq48cfv5xT+Jc7upd39FNon310qhsaXMO/2ChqVg1TlAZTt2fPcxq wj+vg2igqsIUgCj56Z5MwrCpWN1Tytc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-muhq-NKSOr2iqRDtbR53Ng-1; Tue, 22 Sep 2020 09:38:27 -0400 X-MC-Unique: muhq-NKSOr2iqRDtbR53Ng-1 Received: by mail-wr1-f72.google.com with SMTP id y3so7420561wrl.21 for ; Tue, 22 Sep 2020 06:38:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WKA+W9RGb28j92jAhf1JQdc576NbRme2KTggAyn0cGE=; b=qqdDnYun5VynOVSzE5dvqdzVD7ono2RPYLt+l1q8p9Vs5dcKLzuLV2ynuioEt+Xibn Gdzaja6AqlKRfcA+6+Q9mQb+LTGu+jHayQrWltqLZIrLwRQeZnl7n6BpVnIF6o19goNl fc12A0mEtMuks0lpqsisDKTqvvn/mqvae1QxMYua6QBqMkmucG3ILUVxvIR4rMW+m6mM 0FkbUZTgi4t6xPYKdKcuIeTLDD0uXQXGXhOmLD9bgad6bPTwQrUXPbSX6l0C98qf0P9G /ylPZ5iaVfJbLwoTL+jxA/PQGdHd+834xSd10CCOv/WWFOOdP7xo3sVaIZPbj7qofLId WWwA== X-Gm-Message-State: AOAM532QW6O161ltsqY9NQfg7mNi76yr0uI46Nm8obsO3kRnaPiYTQb/ q4Y+LB9JSu5bJlg0JjMHUJz/8aKZMB+AqshpBbnB1EW9SXmQIOo9LnN6jfbhjz0iun1YzMbYH1q iwCUYuefEhrTF9f5J5SrSiDaL X-Received: by 2002:adf:f88b:: with SMTP id u11mr5298173wrp.376.1600781905830; Tue, 22 Sep 2020 06:38:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ94kRCHGua3D6X0Y+ygEUAilwPvcCy+6DPODmbUzKE+wR5gnO6hv3RQDDn54DlvnBP+9nBA== X-Received: by 2002:adf:f88b:: with SMTP id u11mr5298147wrp.376.1600781905609; Tue, 22 Sep 2020 06:38:25 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:ec2c:90a9:1236:ebc6? ([2001:b07:6468:f312:ec2c:90a9:1236:ebc6]) by smtp.gmail.com with ESMTPSA id c14sm27546575wrm.64.2020.09.22.06.38.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Sep 2020 06:38:25 -0700 (PDT) Subject: Re: [PATCH v2 0/2] KVM: VMX: Clean up IRQ/NMI handling To: Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf , Uros Bizjak , Andi Kleen References: <20200915191505.10355-1-sean.j.christopherson@intel.com> From: Paolo Bonzini Message-ID: <4a6aaa8a-c62c-5f7c-da3e-14a68a835487@redhat.com> Date: Tue, 22 Sep 2020 15:38:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200915191505.10355-1-sean.j.christopherson@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/09/20 21:15, Sean Christopherson wrote: > Clean up 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. > > 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 | 34 +++++++++++++++++++++ > arch/x86/kvm/vmx/vmx.c | 61 +++++++++++--------------------------- > 2 files changed, 51 insertions(+), 44 deletions(-) > Queued, thanks. Paolo