Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4783774ooa; Tue, 14 Aug 2018 10:29:50 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyDhP/XVq2b0IRQkaPjo1vLl8+kVXrSlehnr+7UKi3F95vfFVfW0BChcMkKwvFnGUuOt0CN X-Received: by 2002:aa7:86d7:: with SMTP id h23-v6mr24392168pfo.132.1534267790278; Tue, 14 Aug 2018 10:29:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534267790; cv=none; d=google.com; s=arc-20160816; b=OeLBzk06EpqVU3X+LvMGzL3oUoENmda8dJFv19MqBPsM9qlTeekibLeCR3WmkIB5yc vjQ1eT4tcs60YZpOZPjOq46IilkiNCePyUIb5n23vnpKJQ4O9MPk/UNXFbIbZoCgEEOA ZCsa0ZTOmCA8LjAOUZZq7zopnY4iHuCLMz+rM22Cne2Q9ZzIIDkIGCVFzzrKW79BJF9g /63ZUJM4xpDG5N0fl+4lWp4Gv2FP8M3jtQBJEWYpl9Sm97RWy8Xv98EJY76q21F3rcWM d8//1Y30CYsrbL5zD6np5KZbi6q/sJKA5XG215jBpi1qf1gH1GEIXLwNPgZO4QWiofIP EbWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=K15sVtQYVqB4tbhlTYT8cis4g0K2zDtoSG1iWeJd9GA=; b=cQD1ahEPgMVLk74+laaYHbWlXjnQFre2x3JM95S1sr8adGO3KOoBZD275mQyB159Nv uR7w9LL0lgkvLZVMBg0XBfbrQKwD+am+LI9/Cr/GBPdIYTYJe/33DcsuE9LRXFISI9LR 8gz3+/BbppuaowmEKJ5cZ0ehDxPLgzeXw+nRfG9bGuzI4KaSXFJT9mCdsoUXtq2CQDAS IYYav4XVaud6eKem+b9GPdAau2Id/Gj0eMXA1RNw7wxxIeg2fGVqvaka/sIbVccocAOx /GMDweDprv4w/tH/ok01SdTybhaGzm2u/e3w4IFKCqWpKMDA853Qb0pZB0lR6fxtg9L0 i9vw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10-v6si22274027pgm.535.2018.08.14.10.29.35; Tue, 14 Aug 2018 10:29:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388701AbeHNUPZ (ORCPT + 99 others); Tue, 14 Aug 2018 16:15:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52448 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387886AbeHNUPZ (ORCPT ); Tue, 14 Aug 2018 16:15:25 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2232740B; Tue, 14 Aug 2018 17:27:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Bonzini , Nicolai Stange , Thomas Gleixner Subject: [PATCH 4.18 67/79] x86/irq: Let interrupt handlers set kvm_cpu_l1tf_flush_l1d Date: Tue, 14 Aug 2018 19:17:26 +0200 Message-Id: <20180814171340.689097707@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171336.799314117@linuxfoundation.org> References: <20180814171336.799314117@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicolai Stange The last missing piece to having vmx_l1d_flush() take interrupts after VMEXIT into account is to set the kvm_cpu_l1tf_flush_l1d per-cpu flag on irq entry. Issue calls to kvm_set_cpu_l1tf_flush_l1d() from entering_irq(), ipi_entering_ack_irq(), smp_reschedule_interrupt() and uv_bau_message_interrupt(). Suggested-by: Paolo Bonzini Signed-off-by: Nicolai Stange Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/apic.h | 3 +++ arch/x86/kernel/smp.c | 1 + arch/x86/platform/uv/tlb_uv.c | 1 + 3 files changed, 5 insertions(+) --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -10,6 +10,7 @@ #include #include #include +#include #define ARCH_APICTIMER_STOPS_ON_C3 1 @@ -514,6 +515,7 @@ extern void irq_exit(void); static inline void entering_irq(void) { irq_enter(); + kvm_set_cpu_l1tf_flush_l1d(); } static inline void entering_ack_irq(void) @@ -526,6 +528,7 @@ static inline void ipi_entering_ack_irq( { irq_enter(); ack_APIC_irq(); + kvm_set_cpu_l1tf_flush_l1d(); } static inline void exiting_irq(void) --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -261,6 +261,7 @@ __visible void __irq_entry smp_reschedul { ack_APIC_irq(); inc_irq_stat(irq_resched_count); + kvm_set_cpu_l1tf_flush_l1d(); if (trace_resched_ipi_enabled()) { /* --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c @@ -1285,6 +1285,7 @@ void uv_bau_message_interrupt(struct pt_ struct msg_desc msgdesc; ack_APIC_irq(); + kvm_set_cpu_l1tf_flush_l1d(); time_start = get_cycles(); bcp = &per_cpu(bau_control, smp_processor_id());