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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 4ABF9C43331 for ; Thu, 5 Sep 2019 17:33:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2547B206A5 for ; Thu, 5 Sep 2019 17:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390993AbfIERdM (ORCPT ); Thu, 5 Sep 2019 13:33:12 -0400 Received: from mga03.intel.com ([134.134.136.65]:17592 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726600AbfIERdM (ORCPT ); Thu, 5 Sep 2019 13:33:12 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2019 10:33:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,470,1559545200"; d="scan'208";a="383936241" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by fmsmga006.fm.intel.com with ESMTP; 05 Sep 2019 10:33:10 -0700 Date: Thu, 5 Sep 2019 10:33:10 -0700 From: Sean Christopherson To: Alexander Graf Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , Thomas Gleixner , Joerg Roedel , Jim Mattson , Wanpeng Li , Vitaly Kuznetsov , Radim =?utf-8?B?S3LEjW3DocWZ?= , Paolo Bonzini , Liran Alon Subject: Re: [PATCH v3] KVM: x86: Disable posted interrupts for odd IRQs Message-ID: <20190905173310.GA16071@linux.intel.com> References: <20190905125818.22395-1-graf@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190905125818.22395-1-graf@amazon.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 05, 2019 at 02:58:18PM +0200, Alexander Graf wrote: > We can easily route hardware interrupts directly into VM context when > they target the "Fixed" or "LowPriority" delivery modes. > > However, on modes such as "SMI" or "Init", we need to go via KVM code > to actually put the vCPU into a different mode of operation, so we can > not post the interrupt > > Add code in the VMX and SVM PI logic to explicitly refuse to establish > posted mappings for advanced IRQ deliver modes. This reflects the logic > in __apic_accept_irq() which also only ever passes Fixed and LowPriority > interrupts as posted interrupts into the guest. > > This fixes a bug I have with code which configures real hardware to > inject virtual SMIs into my guest. > > Signed-off-by: Alexander Graf > > --- Reviewed-by: Sean Christopherson