Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2066467ybe; Tue, 3 Sep 2019 07:32:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqloZxPFttdsqInIxdeLhaU8aXiHo0BEoG7r8tnI4joUBsKoHNpKAM/ewnSNCNT7fXoTRJ X-Received: by 2002:a17:902:4581:: with SMTP id n1mr36407090pld.310.1567521124460; Tue, 03 Sep 2019 07:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567521124; cv=none; d=google.com; s=arc-20160816; b=QBF9pimG4qUOgyggMZsoUy2+j0U2BYBZK8e4Qm3xpJayfqRScEad0O63b7XOZOko7j I57R42DGWKDNnjLLeRu5rDEiyIPWg3Qz4xRFMxnXI0OnGbbdhH9PnR+h0fb4btUdn68n cyMLjZd6deHggMOmofvvajKHznPjBy7plG170rzB6yN+Hxd4f3v5OA5OlfEiXU6B1cSW NcBuHxn2yFXvIbORl1L9CQyCuC0od/D5vzdXAowzlisrPdEM8+X33eC+PVPJ2OhG475v 3glUHmXKoRsqlaHDbHec78Rl3rBuWtZUP3YChVyZoDm7B5qW+o/mWFes2T7poplnaTps RVig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=i7AwnRT7NByHxBFu3Yt3euqrSCjx8giqctEq9HJ4eH4=; b=OpylUmewS7l6iS2dVyyvghXc6ifHEXCWhzlXIi5fkteCDQRxdmGJq7rhn9H/ZQyvJO d5o4rriiC08pGoerd2arhPGUFuShW0HKWUgM2U+8fJ5+prgJaBSaSOTL2MlSfM54Fujf cVMAgAJYOehHhAu1z2P6KZK2OlR8lbbI0IM7wjivllwkq8gSmccM+VXrfEcJxSmkYWTU wSk4io8IvNJ2FW5UFQT9I78s1r4Z5P04FcEqNqd56MD45SD1jvP1WPlRsMcgjUWWsDwd wBnISdoKNsNi06C9mK1J9ppuzrtfyLqWgf1Hh0BSuZ0VHn1+U7FXByXuqrJsNIgX0lDf NfEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="vqN/bJgq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z27si10528159pfk.81.2019.09.03.07.31.47; Tue, 03 Sep 2019 07:32:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="vqN/bJgq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729795AbfICOaO (ORCPT + 99 others); Tue, 3 Sep 2019 10:30:14 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:18802 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729566AbfICOaO (ORCPT ); Tue, 3 Sep 2019 10:30:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1567521013; x=1599057013; h=from:to:cc:subject:date:message-id:mime-version; bh=i7AwnRT7NByHxBFu3Yt3euqrSCjx8giqctEq9HJ4eH4=; b=vqN/bJgq4L9WJFBj02CMxNcQyUGDI0JuwEtR9PufXzUoBg/taNC95kuT S+Lwgfzh2oF6b46J2lCsQBspTUeDQTX9MLRs/r4RZTGWiMWYDF1j6XI2Y zP1Fcpsdy4N1dbyx+nC31P3youJMEYRy75YIZNkyz1iZJnHy+IAkXrVLX c=; X-IronPort-AV: E=Sophos;i="5.64,463,1559520000"; d="scan'208";a="700284570" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2a-22cc717f.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 03 Sep 2019 14:30:06 +0000 Received: from EX13MTAUWC001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2a-22cc717f.us-west-2.amazon.com (Postfix) with ESMTPS id 9E72FA22D3; Tue, 3 Sep 2019 14:30:05 +0000 (UTC) Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Sep 2019 14:30:05 +0000 Received: from u79c5a0a55de558.ant.amazon.com (10.43.162.242) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Sep 2019 14:30:01 +0000 From: Alexander Graf To: CC: , , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , Thomas Gleixner , Joerg Roedel , Jim Mattson , Wanpeng Li , Vitaly Kuznetsov , "Sean Christopherson" , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Paolo Bonzini Subject: [PATCH 0/2] KVM: Only use posted interrupts for Fixes/LowPrio MSIs Date: Tue, 3 Sep 2019 16:29:52 +0200 Message-ID: <20190903142954.3429-1-graf@amazon.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.242] X-ClientProxiedBy: EX13D27UWA002.ant.amazon.com (10.43.160.30) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MSI-X descriptor has a "delivery mode" field which can be set to various different targets, such as "Fixed" (default), SMI, NMI or INIT. Usually when we pass devices into guests, we only ever see this MSI-X descriptor configured as Fixed, so nobody realized that the other modes were broken when using posted interrupts. With posted interrupts, we end up configuring these special modes just the same as a Fixed interrupt. That means instead of generating an SMI, we inject a normal GSI into the guest. Of course, that if completely broken. These two patches attempt to fix the situation for x86 systems. If anyone has a great idea how to generalize the filtering though, I'm all ears. Alex Alexander Graf (2): KVM: VMX: Disable posted interrupts for odd IRQs KVM: SVM: Disable posted interrupts for odd IRQs arch/x86/kvm/svm.c | 16 ++++++++++++++++ arch/x86/kvm/vmx/vmx.c | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) -- 2.17.1 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879