Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4250644pxb; Tue, 17 Nov 2020 15:53:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjGZ3igT3jGARnFx+WIpJH9IbE9TzpbsklcwUj67r5AUl8mSygGMnEaudeq3W//3SJ9oYu X-Received: by 2002:a17:906:c08f:: with SMTP id f15mr21157252ejz.97.1605657232378; Tue, 17 Nov 2020 15:53:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605657232; cv=none; d=google.com; s=arc-20160816; b=fz+PkmydTLQa6VP4RA6ALKiGlAPw/EC1WKLG//vz9z56iVHHJMpO6U+J1lb4sZ7p7y fNHcLdPBR9CdxkOCfMGoJBP4VRu0WSNwT0dpywex9FQO+grhDupA3169a5tbJnTK28Z0 IzNh/ehiNQBRfPb2vrl6WS/iMzDfACzNlw5KPGm2QnSXiiJkhuaIEUfHotADwvAUyfpd Qp/P/s9DgKQaAg3X4RDQf7dRoOvaLsZ6XLopyWOHuQQjRy3bbVq4BzZTJDrP6YfmwsoY 3aEPagSTo+9bnoeUybMLWPVi6vO6XH7obhnk4znHVB3qZWbe23x5IjpvKjxRGYTSLvK1 HLIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=5JkuS5sMNNqMK7prMFueAtoWBVlDGevEn+fHZUkSofc=; b=ZBlq3ROOzYLwcfQTdcUkMSbjyqur/7whK4w8anCr8lO3yTElfQiPGCDCNXcQy2ofLB 8ndCn7Q1dYByO+FcnIO9juKQEXQG4pquWxhCazZf7AYqycr8lGO7ZZP2LjfVPlSxUPPR Ked95uQ9W1tAUat5mJcHONgO0/NZ0Q2UzzsTsAi2h5BAuQgvoRY7zCdV8BHBZqXi/nVP HCttTcZo/g5VCUUficWrMwvlYMnM+F5Vbj6KLq/VggYJrYmAoNBMoziz8d1l2JwPy2Sa 6B8vxSZJ+19cazwrYZs4z3d62/WK/8R1wPdSZ6Ije+B980XREVDfdy2Mb7ti5RhKwQyE YcAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="W/s7d52k"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si14278970eja.372.2020.11.17.15.53.29; Tue, 17 Nov 2020 15:53:52 -0800 (PST) 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; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="W/s7d52k"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727364AbgKQXty (ORCPT + 99 others); Tue, 17 Nov 2020 18:49:54 -0500 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:53451 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgKQXty (ORCPT ); Tue, 17 Nov 2020 18:49:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1605656993; x=1637192993; h=from:to:cc:subject:date:message-id:mime-version; bh=5JkuS5sMNNqMK7prMFueAtoWBVlDGevEn+fHZUkSofc=; b=W/s7d52kjZpCWzYIXA9MMwmoL6u46jTA/y+uVMCO10cyKez8g62klNEO GscqjPd3N4HWVcLyMhQNBDn23vo+JzJlALUEMApfNA+l+zyVVBpp7gamx 9T0baGmNFox6bPndIRIsu8ZVe28vxBDO1I9vBYhQK7bC7B51L6FZrlRza g=; X-IronPort-AV: E=Sophos;i="5.77,486,1596499200"; d="scan'208";a="64304400" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-2225282c.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 17 Nov 2020 23:49:46 +0000 Received: from EX13MTAUWA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2c-2225282c.us-west-2.amazon.com (Postfix) with ESMTPS id 4B6D1A21B5; Tue, 17 Nov 2020 23:49:45 +0000 (UTC) Received: from EX13D01UWA003.ant.amazon.com (10.43.160.107) by EX13MTAUWA001.ant.amazon.com (10.43.160.118) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 17 Nov 2020 23:49:44 +0000 Received: from EX13MTAUEE002.ant.amazon.com (10.43.62.24) by EX13d01UWA003.ant.amazon.com (10.43.160.107) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 17 Nov 2020 23:49:44 +0000 Received: from localhost (10.143.193.228) by mail-relay.amazon.com (10.43.62.224) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 17 Nov 2020 23:49:43 +0000 From: Balbir Singh To: , CC: , , , Balbir Singh Subject: [PATCH v1 0/3] Fixes to L1D flushing (on top of linux-next and Date: Wed, 18 Nov 2020 10:49:31 +1100 Message-ID: <20201117234934.25985-1-sblbir@amazon.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There were concerns with the current interface (checking for the state of SMT of the core at opt-in time [1]). These patches change the interface to send a SIGBUS to the task if a. It opts into L1D flushing b. Runs on a core with SMT enabled There are also documentation fixes. I've tested the patches at my end, but would appreciate a broad review of the change in functionality and/or any recommended doc updates. [1] http://lkml.iu.edu/hypermail/linux/kernel/2009.3/09310.html [2] http://lkml.iu.edu/hypermail/linux/kernel/2009.3/09613.html NOTE: For testing these patches, specifically the SIGBUS behaviour, there needs to be contention on the CPU where the task that opts into L1D flushing is running to see the SIGBUS being sent to it (the deterministic bit is that if there is scope of data leak the task will get killed) Balbir Singh (3): x86/mm: change l1d flush runtime prctl behaviour Documentation: Update the new SIGBUS behaviour for tasks Documentation/l1d_flush: Fix up warning with labels .../admin-guide/hw-vuln/l1d_flush.rst | 12 +++--- arch/Kconfig | 4 ++ arch/x86/Kconfig | 1 + arch/x86/mm/tlb.c | 37 +++++++++++-------- include/linux/sched.h | 10 +++++ 5 files changed, 42 insertions(+), 22 deletions(-) -- 2.17.1