Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4364976ybi; Mon, 15 Jul 2019 07:53:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqz761gn3Jts7Imo01vOFVI7BUFkh84vEeRelhKc9hbSTtOEPxeBLD/sWSDeQ7pC6NfDEZmw X-Received: by 2002:a17:90a:bf03:: with SMTP id c3mr28204625pjs.112.1563202391076; Mon, 15 Jul 2019 07:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563202391; cv=none; d=google.com; s=arc-20160816; b=Z6yUklPL94BukFThUiFLXEwQKcfJkUBo7cdMR9zmPFgnWJkqNP28xD7c/4EM8FMHKF xjFB7S8SJ01BzMVI3jDhQ2bv0hbXCpaOh+DDqY4xEwckX5J3BPSjAJL2gNSBxtuiQ9il n8eYabOjJ03tiofFInPscsFUeMf3VF8v+E2y4cUE6uwdm1P+/mk/dqgbpKfq4D7R43tN G3ZidKvpbsgmddikL1MEoTvJCMDTzwyDNOTtImRwBfEwrrtCLAzqLkMVOdxTfZ/5WNOj 9+oI6DX1qgHqMiRcP4cNNdbq9oo4G1+oFd78h8SYgrqfzs1JOdvBkprufWq/B1LkMRwS wXoQ== 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=/kOuHIwdV1cmMgDdELPfBrpuX2BOQd/yGACKLJjUP3M=; b=sfnSxHgt4P/aOJ/DdP+vgQ5KTPOwkln17GXv+eWNtT0FkQOd50+KufbT0CMDNYsO6r MauNxK1rad0UTB1bByrlQOhxXn/KknJZQtQhyPN62wxtDk6yoFlSBUF7NvTcfjeqmD4J P6fBGxO4Dq1Rv6pFsGrID3NQDwqa6U67lz6sCEKKdMWQGSslEmM0GEC16x2lL8PAidv1 S4jVNCHBpt2KzwsIZ8HNrWM48sDEBZeDWziaclzqKR9s4S1FTX0AJnQXbahIIXQJIoe0 TeyOFNmBIOa/tK5YW2vdqSzvqbUikVEUVuI7azjMIkBb9eTjIEpfeWQK6KRg0Fa0bwGT p03w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=e4FGYwqA; 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 t30si16307705pgk.19.2019.07.15.07.52.55; Mon, 15 Jul 2019 07:53:11 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=e4FGYwqA; 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 S2404889AbfGOOvv (ORCPT + 99 others); Mon, 15 Jul 2019 10:51:51 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40457 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732151AbfGOObg (ORCPT ); Mon, 15 Jul 2019 10:31:36 -0400 Received: by mail-wr1-f67.google.com with SMTP id r1so17329565wrl.7 for ; Mon, 15 Jul 2019 07:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/kOuHIwdV1cmMgDdELPfBrpuX2BOQd/yGACKLJjUP3M=; b=e4FGYwqAaI4jLb4Z0KPbQ0yK1YMlM/CILrvUEl+SG3ooRm6VM2lnqwzf3NldmberP9 6HwinXj0gqjPCOxdGUz2/1FKdYuIESyshiEu8Dda6Egk0TaNUelDsdVp/b/O+vuqQ/Sh lFafZYsYtewywPdAPJ/xnWCBhy05gJuEptPRhYuUWvKA8A3tk9+ULP4AhQk4pHND7FyP kt9rvOZpBhkYH3EaxEjHKiR3btyAx9dfJE1M9KvSP5GfyFAZ5nnFon+X7brtFooBjw7r xYjLFO+GcbP22eIB4t2rSTyO0iioQXbWkj+EWs0j1OL4Mc5seuzg2xcGvywE603taiho eQtw== 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=/kOuHIwdV1cmMgDdELPfBrpuX2BOQd/yGACKLJjUP3M=; b=TcU9XZ1D/orsWzHnx/gtUkXP5JgIuk5gfL6dLxCmHvjiCErrequ+amBNo362DZAsws 3FxHb2ouz2+glhr7ZCE5OfLfRobGYdBvSCZtOG3ke3Jxc+jzuRzptri3gTDfa7i/xlhW 0USg8yDnca6/lOvvrmHFbKW/sUOjm/FWWY5JU21Fk1r3kRUw11Tn5lNQB+Rj4Y2VIC7h 6inJswNyLBDCovonblB77lL4IBQhkdh50PpaWwYiOOwTWxijzRprxIH1/u7/+MYPI62s sXz8OygZflR/owZJ6+QLhVABTeaBjqLj0+qYt4oX7lJK6G/FNUe/2TxfN1GWQ7xpFXuh UEUA== X-Gm-Message-State: APjAAAVj4gbnBKb0iQW+IjBrbWKof42ChGI43O10pop0tvgPE3T1qVnt eSPP4QxG7vmqJhzBB8tStjXO11vWZJ/Kq+9hsGjwnw== X-Received: by 2002:adf:f28a:: with SMTP id k10mr30519437wro.343.1563201095116; Mon, 15 Jul 2019 07:31:35 -0700 (PDT) MIME-Version: 1.0 References: <20190715142109.3063-1-ubizjak@gmail.com> In-Reply-To: <20190715142109.3063-1-ubizjak@gmail.com> From: Andy Lutomirski Date: Mon, 15 Jul 2019 07:31:23 -0700 Message-ID: Subject: Re: [PATCH] x86/cpu/intel: Skip CPA cache flush on CPUs with cache self-snooping To: Uros Bizjak , Dave Hansen , Peter Zijlstra Cc: Thomas Gleixner , X86 ML , LKML 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 Mon, Jul 15, 2019 at 7:21 AM Uros Bizjak wrote: > > CPUs which have self-snooping capability can handle conflicting > memory type across CPUs by snooping its own cache. Commit #fd329f276ecaa > ("x86/mtrr: Skip cache flushes on CPUs with cache self-snooping") > avoids cache flushes when MTRR registers are programmed. The Page > Attribute Table (PAT) is a companion feature to the MTRRs, and according > to section 11.12.4 of the Intel 64 and IA 32 Architectures Software > Developer's Manual, if the CPU supports cache self-snooping, it is not > necessary to flush caches when remapping a page that was previously > mapped as a different memory type. > > Note that commit #1e03bff360010 > ("x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata") > cleared cache self-snoop capability for CPUs where conflicting memory types > lead to unpredictable behavior, machine check errors, or hangs. It looks like this won't affect the SEV code paths, so I'm not thinking of anything that this will break. But Dave and Peter are much, much more familiar with the messes this could cause than I am. --Andy