Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp252768imj; Thu, 7 Feb 2019 03:52:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IbEBoAr3PhF67sK895Vj1vdGj+EDubtcbet4rhX5q/0W0tS+x6jHDCsz5mHLEe2kdozHbrY X-Received: by 2002:a17:902:690c:: with SMTP id j12mr15871361plk.206.1549540369347; Thu, 07 Feb 2019 03:52:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549540369; cv=none; d=google.com; s=arc-20160816; b=rFA16igG/P4KKkLDrZY3qmOQHkmZwtDILGQaI4ChGQVKntdS3JXLaanbWr9gKhvsmj R6EilIF2S5o/tSfC2sH4a7CrQ4Ckswk2bhCRMTQPQTK/610lq91gLGmUdlnT4bCkHRcH 8xYnneMesiHJuG/GKx8K9jxYuJNXVXczLPp+nZQnWd2UECbQRkKWTl2pePD4Sj2nyksH aPYnNwF1Lu3XjOIw0Eqxu4j/EJl5yc63MZpNgT1xKxdCPX9dy8VhXvIPTRr4IHxCgO4f i55/mIyrpMBABGJz2xoeaaDVw4gHMW9omMD2M/MUfthoMs8REesKRIRu353xrOLJqaws BXVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HKxl5AOq2toGrb7lGuGYh0UiKlBbE/oIUUUVrLfwH8Q=; b=fg6VwEsTsDjiWQUp3th5vuINzqC9VYPfDZfEi0h6zS9Fyca2LXR2yUjxtRSPx9UZAE RD0RKEahj0ue37lV+FffHG/8nRBuay2ZEfEqpbSqaCsZ532YKbi0Qv7nG56Lnp21t3tF G8USr/7T6wSGjkBI4qjmfKIOB4FoMQdkRwb1mj0Tm/1gaB8jtYPlC3pITFFqp05vZEcg oPRa3cKt369vKwTBZVqA+SvqYV7tsw0PE/P6yr1aMyMCkkmRLrjOUoEEDMKRZvQsAlC2 lFGPYfrSwlUNrtIthy6nQmEBPvvJ9UIHsZqNoLLBW9xldHfeNTjGtH/KyWuvZPkmrZkc cKyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="dNLd/+cc"; 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 cb2si1390175plb.201.2019.02.07.03.52.33; Thu, 07 Feb 2019 03:52:49 -0800 (PST) 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=@linux-foundation.org header.s=google header.b="dNLd/+cc"; 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 S1726949AbfBGLvN (ORCPT + 99 others); Thu, 7 Feb 2019 06:51:13 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43792 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbfBGLvN (ORCPT ); Thu, 7 Feb 2019 06:51:13 -0500 Received: by mail-lj1-f194.google.com with SMTP id q2-v6so8996058lji.10 for ; Thu, 07 Feb 2019 03:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HKxl5AOq2toGrb7lGuGYh0UiKlBbE/oIUUUVrLfwH8Q=; b=dNLd/+ccUJdzVwIhA6Biw+4S5f5lKTs9YbSp6l45WHTWHcZlVavOKiz+hwKTwSBmvM zY5wdpgRpV9VSXqIdcwl/LoKTkOtqm5rizwv6TGt34M7fdDAhFOr8DvWNayF7CisaX4G JgjeMi3D/HZWfhP0OxpWbicGElvKtXm40SLLs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HKxl5AOq2toGrb7lGuGYh0UiKlBbE/oIUUUVrLfwH8Q=; b=IWYXBlWixV1m11JQIlPfI8I/+UnrBUrB4RQNQDc1bgwQg/Nv5feFmh+gPgU7/x+M8p uh4Gm3kclslR8wTreo2v9p5mbtwzKbSOW6ebgPusDyytUNvNFNK8zW77lTa2SfMOaRi5 zItKHh8FwBgosKAqR4zB5uzzL/6MoB/lggrhjCwes7qnYoEbVsIM2MdBxOdsa70JEeiD 7OMw7Qj3Ae6/SNWBJvOkHMq8LhY5R4+ZsO/bXkwMa1fV8VYlRIyOr+GKwXSauzODxWUG UIAf9Iq6R655L500ET6tE1ZmHvLJpF8mQsQhNm+4keb75aP+kWZLVYujL/xBB7D+9zkt Os9g== X-Gm-Message-State: AHQUAuaqAoDniAgG8Qf01MpvAArntKzggrQ0UFRgdMdgNm6Wd/V58BvO lHl6z7p4aBw3nze9dzVcI04Yg1GzYkXszQ== X-Received: by 2002:a2e:890b:: with SMTP id d11-v6mr10507303lji.113.1549540270638; Thu, 07 Feb 2019 03:51:10 -0800 (PST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id a20-v6sm4247853ljf.28.2019.02.07.03.51.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 03:51:09 -0800 (PST) Received: by mail-lj1-f171.google.com with SMTP id z25-v6so2523104ljk.7 for ; Thu, 07 Feb 2019 03:51:09 -0800 (PST) X-Received: by 2002:a2e:8045:: with SMTP id p5-v6mr9401807ljg.87.1549540269230; Thu, 07 Feb 2019 03:51:09 -0800 (PST) MIME-Version: 1.0 References: <20181224231106.GA27438@gmail.com> <20190207001737.GA32096@agluck-desk> <20190207101846.GB32511@hirez.programming.kicks-ass.net> In-Reply-To: <20190207101846.GB32511@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Thu, 7 Feb 2019 11:50:52 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] x86/mm changes for v4.21 To: Peter Zijlstra , Dan Williams Cc: "Luck, Tony" , Ingo Molnar , Linux List Kernel Mailing , Dave Hansen , Andy Lutomirski , Borislav Petkov , Thomas Gleixner , Rik van Riel 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 On Thu, Feb 7, 2019 at 10:18 AM Peter Zijlstra wrote: > > So now the question is where to put it back in, I'm thinking this might > want to be in __cpa_addr(). Wasn't one of the goals to *not* keep the real virtual address around to avoid speculation, since we don't want some random speculation using that address to then trigger more MCE's? If you re-generate the canonical address in __cpa_addr(), now we'll actually have the real virtual address around for a lot of code-paths (pte lookup etc), which was what people wanted to avoid in the first place. NOTE! I may be *entirely* off on this, and just confused about exactly which speculative accesses people were worried about. But at the same time, looking at all the other cases, it does look like we need to do it in __cpa_addr(), because we also have other tsts for an actual valid virtual address, ie all the vaddr = __cpa_addr(cpa, cpa->curpage); if (!(within(vaddr, PAGE_OFFSET, PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) { kind of checks. What's the exact rule and path from "set_mce_nospec()" (which is what sets that "decoy" address with the high bit clear) to when we can then use the address for tlb flushing?) Adding Dan Williams to the participants, because it's really only set_mce_nospec() that triggers this, and where should try to be careful that that path really doesn't use the actual real virtual address. He touched it last. But I guess the whole decoy_addr thing goes back to Tony Luck and commit ce0fa3e56ad2 ("x86/mm, mm/hwpoison: Clear PRESENT bit for kernel 1:1 mappings of poison pages"). Do we really need it? Linus