Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp917622ybi; Fri, 21 Jun 2019 10:19:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqepwEM0ar2b1gh1hrXj6NjR5i3aYgZB9ZLHrxqLJ56a8p0EBYKpaTZqijPgVWNzhEwk9c X-Received: by 2002:a17:902:1486:: with SMTP id k6mr67401461pla.177.1561137584938; Fri, 21 Jun 2019 10:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561137584; cv=none; d=google.com; s=arc-20160816; b=IPLRpVQn98VOOn+pkDNMLGwmCU2o81kuJTyvJS1l6Z4NbJkGMniv7rwHX8QuLrzeAR wzkpV+gX4pMWkDsUwMwsrY0BwY0XIAPmCpj92nLvOOnjmG9Kv8LcTtDt/m/zvWDJXPO2 zYBiRL684rBhBaLu7E84ZQSlL3Zny/BqAScU1gcN1Ku3VoOYqYoyExRMj1phwBsPW+IE 3Msi5lFQ8lKoebOaMiHKfexMjjAgEobc6GZUgIv5kzjqrhTerFnhKU8Rl7mRkuuuvXOr k0Ld343afApF59hrRv1jIyeey2lMmBN+UVWbVj/FUVj3Ya8VJ9mfUmWJ5DWVBNZgFOse SPrg== 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 :message-id:in-reply-to:subject:cc:to:from:date; bh=RPD01ZHWHMRDTmBZJlpfk8RVzQ8+vxGzwXOqcZnOlR4=; b=Bx/Iq6VNySReNUmcwOnw35o3GsIb28+bqV7Ls+I78h5cYRxCBOLrxKWJVOe76LXLPq M4eLnikj09rw5FwKemoWNb4cyP9VFlZffSJsWwMMxcYQ4lULT1NwnKdUMz45/T347lf3 dBrBQzljop1PMt2M5Xt7RqFbg/oOsY9MRs9hja7Gb+gbSbRxsLT6uTTBC4LAJBz9Og7c dw7YuniOzZKThHUOG3yoeW3+WvRMg9b31ItKxGA19zUKrKh472rq5ja3D5RmC7v4mhpO K2rBQmVmXayAlZNNRhCtSWYhmcwZCpuV3hR6/eOSD9Xd3hZJlZ4q/DzdvrLp1oiau2Z9 RTjA== 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 m18si3319328pjv.101.2019.06.21.10.19.28; Fri, 21 Jun 2019 10:19:44 -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 S1726058AbfFURTY (ORCPT + 99 others); Fri, 21 Jun 2019 13:19:24 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:55496 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfFURTY (ORCPT ); Fri, 21 Jun 2019 13:19:24 -0400 Received: from p5b06daab.dip0.t-ipconnect.de ([91.6.218.171] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1heNC4-0002RK-SJ; Fri, 21 Jun 2019 19:19:21 +0200 Date: Fri, 21 Jun 2019 19:19:20 +0200 (CEST) From: Thomas Gleixner To: Zhenzhong Duan cc: linux-kernel@vger.kernel.org, mingo@kernel.org, bp@alien8.de, x86@kernel.org, hpa@zytor.com, jgross@suse.com, ndesaulniers@google.com, gregkh@linuxfoundation.org, srinivas.eeda@oracle.com Subject: Re: [PATCH] x86/speculation/mds: Flush store buffer after wake up from sleep In-Reply-To: <1561011237-12312-1-git-send-email-zhenzhong.duan@oracle.com> Message-ID: References: <1561011237-12312-1-git-send-email-zhenzhong.duan@oracle.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Jun 2019, Zhenzhong Duan wrote: > Intel document says: "When a thread wakes from a sleep state, the store > buffer is repartitioned again. This causes the store buffer to transfer > store buffer entries from the thread that was already active to the one > which just woke up." > > To avoid data leak from sibling thread to the woken thread, flush store > buffer right after wake up. That's a pointless exercise. The buffers are flushed again when returning to user space. Inside the kernel the potential leak is completely uninteresting unless you consider the kernel as a malicious entity. > Move mds_idle_clear_cpu_buffers() after trace_hardirqs_on() to ensure > all store buffer entries are flushed before sleep. I'm fine with that change, albeit trace_hardirqs_on() is hardly leaking somethimg interesting. Thanks, tglx