Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2461811pxk; Mon, 14 Sep 2020 14:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaDQAMPQYuBeTWCIxLql5RykU/huMzT+9fvQwDt1udvRvKPYui0mZGWPIqfSJVqn+R6t36 X-Received: by 2002:a17:906:1909:: with SMTP id a9mr16274794eje.127.1600117762208; Mon, 14 Sep 2020 14:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600117762; cv=none; d=google.com; s=arc-20160816; b=0Wo3EzI1CPpbJ/+YEBFbV+KQaHCbQ0j93r3/AKkNRlkjhXAqFUf2yoLVViO9zjnsVH +dKcXC2jnknP4ZdvDltGf1/ljQTSjjrpm3nJaIjD916pjsV8ECQqcKcAyr4rQMWXOq3F hIpQ85N5h1iYJOfFGaYvuYmUk+JvqBqJHG+xZh0fbXSj9cVKtX6rHiAG7YQiIpA/Aeqt PC62YWbID/2cuoAE1ZvfAmwXVhc1x+yKeRZJRBJDwsbuWr5fApyf1Z879SX45BdsDFCC iZJe3WlJbiRPhYi6WpXdKEqgEKfLJwDkYOYJRhAgYzBDzhsmu8QMzEGnKCtTWJDXxBE2 vOvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=Ii0mhoPrHDPqta0UapdgJrA+6XUNdpkuNQad3aaDcms=; b=Z7WTry1/w+AGFbaMeHx6khwyF+PlicBXUWnZzH5pOurFJJemT7UN/PPSJy2o+a3mi9 reQ5jXBCPqqtjVrSzkWhfDw9gPJI3tGl4yL+G875VprY/Z7HcortItu2QKcUjizWg/aY +8ZiV+VatcVv3WY/UMpjb3fspDWjlUlfOmDbSfjRKG5nzM+N5/6sJ3AzSfTt6Cz8Jy64 4dlKWoeLcmInff248U7H1p/vUfZxWZtuPty4EAIPHxd/GR8kwrLuwR5K2PPQchbwPW6h 5mvWE1oecLGAJcNCW97zgbdQarln+VdNxxMLoekpEwOk6YEBPlQOObbblRDyowrFpeEN pcxA== 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 q12si7643923ejs.146.2020.09.14.14.09.00; Mon, 14 Sep 2020 14:09:22 -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 S1726043AbgINVIM (ORCPT + 99 others); Mon, 14 Sep 2020 17:08:12 -0400 Received: from mga05.intel.com ([192.55.52.43]:32504 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbgINVIL (ORCPT ); Mon, 14 Sep 2020 17:08:11 -0400 IronPort-SDR: aZwxG13IRNdWtKCjMm97HUq6Tw014BYFyH3uZs9nrCCU1TnNG48CTOmNPQ20K3qzxOPRo38yLI jWylPzA2DLKw== X-IronPort-AV: E=McAfee;i="6000,8403,9744"; a="243992776" X-IronPort-AV: E=Sophos;i="5.76,427,1592895600"; d="scan'208";a="243992776" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 14:08:10 -0700 IronPort-SDR: U9N+DKLdMu+ewb++IVuN349jio0EA0DdYQq4BLqyw4wSagQO+4hwxOqBqHnyxlKQT0UkUrqb6L fF1EIgHcCQ5A== X-IronPort-AV: E=Sophos;i="5.76,427,1592895600"; d="scan'208";a="482495517" Received: from sjchrist-ice.jf.intel.com (HELO sjchrist-ice) ([10.54.31.34]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 14:08:09 -0700 Date: Mon, 14 Sep 2020 14:08:08 -0700 From: Sean Christopherson To: Uros Bizjak Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, LKML , Josh Poimboeuf , Andi Kleen Subject: Re: [PATCH 1/2] KVM: VMX: Move IRQ invocation to assembly subroutine Message-ID: <20200914210808.GC7084@sjchrist-ice> References: <20200914195634.12881-1-sean.j.christopherson@intel.com> <20200914195634.12881-2-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 10:37:25PM +0200, Uros Bizjak wrote: > On Mon, Sep 14, 2020 at 9:56 PM Sean Christopherson > wrote: > > > > Move the asm blob that invokes the appropriate IRQ handler after VM-Exit > > into a proper subroutine. Slightly rework the blob so that it plays > > nice with objtool without any additional hints (existing hints aren't > > able to handle returning with a seemingly modified stack size). > > > > Suggested-by: Josh Poimboeuf > > Cc: Uros Bizjak > > Signed-off-by: Sean Christopherson > > --- > > arch/x86/kvm/vmx/vmenter.S | 28 ++++++++++++++++++++++++++++ > > arch/x86/kvm/vmx/vmx.c | 33 +++------------------------------ > > 2 files changed, 31 insertions(+), 30 deletions(-) > > > > diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S > > index 799db084a336..baec1e0fefc5 100644 > > --- a/arch/x86/kvm/vmx/vmenter.S > > +++ b/arch/x86/kvm/vmx/vmenter.S > > @@ -4,6 +4,7 @@ > > #include > > #include > > #include > > +#include > > > > #define WORD_SIZE (BITS_PER_LONG / 8) > > > > @@ -294,3 +295,30 @@ SYM_FUNC_START(vmread_error_trampoline) > > > > ret > > SYM_FUNC_END(vmread_error_trampoline) > > + > > +SYM_FUNC_START(vmx_do_interrupt_nmi_irqoff) > > + /* > > + * Unconditionally create a stack frame. RSP needs to be aligned for > > + * x86-64, getting the correct RSP on the stack (for x86-64) would take > > + * two instructions anyways, and it helps make objtool happy (see below). > > + */ > > + push %_ASM_BP > > + mov %rsp, %_ASM_BP > > _ASM_SP instead of %rsp to avoid assembly failure for 32bit targets. *sigh* Thanks! I'll build i386 this time...