Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp716481imj; Thu, 7 Feb 2019 10:42:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IZncHgLGt84qYXfpsWdeDTRdo3ZDGqvVfuVSR8afYXdpoy+/NFl0r8xRZ4Qx5mrdiDDMnhr X-Received: by 2002:a17:902:42e4:: with SMTP id h91mr18200023pld.18.1549564945415; Thu, 07 Feb 2019 10:42:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549564945; cv=none; d=google.com; s=arc-20160816; b=YlftSoW2NxVEfW0uD5ErBYWZOYog449+2r/aJrM75YpzfO+RdNW4dZOG4D/Dvdem3j COafxpUUH7JjHJQUfkIR/0WEmPY3T7mJtUCPJU7r0QjcY0ZvcOyKrrKJFVMnQl/nuEK/ LLxd9440sJjSG5n01l4mz1uTiMMiKXccTH5pZKLOW2ik+cXmC2+7ubfjjFcB+mTqflH+ gjC6hNfNMYULnvbfFMA+YfexBY61Dehl56UZKKmxnqb8ejasClOuVdAWx83uvIQdkHgL jtekd/idBzvazh7C4XmxYZX3U0a/NMwlLkjGVPwI98TlgxRbjX5gX/eYgtV8FGT2QAT/ QX6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+pJVUhxuEh6ER2HhkTAfSs1ZA20iueyp2PJeWgW0y+Y=; b=i0wuiixTlfSxduhAQVfJ+KOHCtni2YSeoeXdKIJMgm2Ac7QP4eQ/sKntAjU4a1rn8k Fpu5mguzpF9kB35QIbgmmitcqVNMR4saD+Aotx9/ZQmYWjyr56HhimPI0QUcL8yYcjBp Hhb4+gI31kDerqQNyUfPSWoCqZ6dmen4r/FwPPYpz9GorAnAxbT1Pdg0yjxVhDKIQ9b1 to4C1Rwu56noVLDKl8RH+6ay8RfTVlNIX6TGxkMd7CL7vYqmQGniEcomFHQ0Yan81QNx RQ0OwOCHXkYtn23/tH5WUyP10eKEF6U4UJXmkJYFQ9lLb0UMYLSttckGsb4HkZZ/szrs mQnQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z24si9213052pgv.225.2019.02.07.10.42.00; Thu, 07 Feb 2019 10:42:25 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfBGSkX (ORCPT + 99 others); Thu, 7 Feb 2019 13:40:23 -0500 Received: from mga12.intel.com ([192.55.52.136]:8635 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfBGSkX (ORCPT ); Thu, 7 Feb 2019 13:40:23 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2019 10:40:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,345,1544515200"; d="scan'208";a="116048121" Received: from agluck-desk.sc.intel.com (HELO agluck-desk) ([10.3.52.160]) by orsmga008.jf.intel.com with ESMTP; 07 Feb 2019 10:40:21 -0800 Date: Thu, 7 Feb 2019 10:40:21 -0800 From: "Luck, Tony" To: Peter Zijlstra Cc: Linus Torvalds , Dan Williams , Ingo Molnar , Linux List Kernel Mailing , Dave Hansen , Andy Lutomirski , Borislav Petkov , Thomas Gleixner , Rik van Riel Subject: Re: [GIT PULL] x86/mm changes for v4.21 Message-ID: <20190207184021.GA17049@agluck-desk> References: <20181224231106.GA27438@gmail.com> <20190207001737.GA32096@agluck-desk> <20190207101846.GB32511@hirez.programming.kicks-ass.net> <20190207140131.GB32477@hirez.programming.kicks-ass.net> <20190207173600.GA15682@agluck-desk> <20190207175720.GE32511@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190207175720.GE32511@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 07, 2019 at 06:57:20PM +0100, Peter Zijlstra wrote: > Something like so then? AFAICT CLFLUSH will also #GP if feed it crap. Correct. CFLUSH will also #GP on a non-canonical address. > - __flush_tlb_one_kernel(__cpa_addr(cpa, i)); > + __flush_tlb_one_kernel(fix_addr(__cpa_addr(cpa, i))); > - clflush_cache_range_opt((void *)addr, PAGE_SIZE); > + clflush_cache_range_opt((void *)fix_addr(addr), PAGE_SIZE); Looks like as close as you can get without being crazy. Many/most of the apparent function calls here are going to be inlined. So likely safe. Tried it out and it works! So: Tested-by: Tony Luck Thanks -Tony