Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3122912pxb; Fri, 4 Feb 2022 01:40:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwr+8CvLTU3GtJqwh8EXq60ZDRa3LGQhjRZsCAv7+RIllUZh9M3ulOGrptJzAOt95kgVHt6 X-Received: by 2002:a05:6402:2683:: with SMTP id w3mr2121789edd.405.1643967616862; Fri, 04 Feb 2022 01:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643967616; cv=none; d=google.com; s=arc-20160816; b=sDCr+mnhOMNHQnzuaVzcZ708ybQ2U9v6X2HIKVPSHanSCfrLiLA9o1QSUbKZl6+3sf 1eN6anJNfzgTcjIXT7oH81Ih5LlFh493fK9xF/9Gzrdr+HJhadYPV3+SRSkprSl/rnhX wAmjaa9ael/GtPehmL4cvUykRGYEw9AkxuAeneY56Kl+mrNE21dHyiaS0bPh4LhTFpQg vcm8/TvbeweN/hGo5F7pib7HH6WBhCPLzHS9L5Zgq8OOj5/2E72Ew9PQgd3QftoSkqrm K7KbrpewG+s3RkPVukxwcRpAwta97XmKL41iM/+vOcn8qRVbYHqzkPyqacD+oxnn6zKA H1ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QRfoBad6xaNnxHl59RhSeOObo1h7VnZyGCv6jI7PtEQ=; b=J7Ys0SHgLkjKgkCuc1RXg9WvnJAbwZeruXmAd4dz3+PGIbBwlIvO1d0byfzE71kNKQ ZHC+W4EfkohD37HliJQmSTw+z6BUJcNm839/bto9869TtSZlOGMu4FVZ06E3hBA/NBNQ ifJohyL1W9ldeSGIGlLXglCw5ibE7/KjoYt0S4pAE9KHubAyPb5E6Wbosx5kmjdvv8iC hGSqbbkmRJelvdd5eXr3NArYRIkrS4o/xBvw/EYR9CYdlTtf9wqwB3OPnqxncjeb0GSE P8t+LTkEZMSGFJettUS61vxHVbUc0J5eOiNAA0YNMEC6UHSHiOcXtsXgDFcX7tdkTO4M CRLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=fwyKmh86; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 11si910965eje.845.2022.02.04.01.39.51; Fri, 04 Feb 2022 01:40:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=fwyKmh86; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S238190AbiBDFXP (ORCPT + 99 others); Fri, 4 Feb 2022 00:23:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238084AbiBDFXN (ORCPT ); Fri, 4 Feb 2022 00:23:13 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93975C06173E for ; Thu, 3 Feb 2022 21:23:13 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id u130so4170175pfc.2 for ; Thu, 03 Feb 2022 21:23:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QRfoBad6xaNnxHl59RhSeOObo1h7VnZyGCv6jI7PtEQ=; b=fwyKmh86FlojrU+sd/TBHHZ4viFDON2ToZwJPOhNkKpDr0mbFr4tYNZo9B+ah9HkMJ eC/vGB496MmU85JHlh/wA7cnxT6CWKSIKEYN6RBpJqF+Gg87BRxvkgUaNBpTOeP7XU7v id7fM+Ws+4WgGbSfppglJk/Mu9k+KUKzlgFQY1hKjEuPGWkkH7pXvDIeGF+JcF6XH27I 8w9twYyX909qLSaaktr2++ubwjGOP7j/nwROAYSzc4K9FkmnwQxpldgrkmFwB2MDVKN1 2kcwbVXFUOa1ih+lNCQjv7PlCFKgmOLQkO0DTT3jDapPfhx3nczdJKDflj6W6aiubI0p E+QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QRfoBad6xaNnxHl59RhSeOObo1h7VnZyGCv6jI7PtEQ=; b=wsqqGl+bEjtIwijOAPofSc34VT0M6gx0fLcVnm8FhzKfnPjLVAx7YIlaqOiBSX6rl9 PkR60ndTETEmkrWAKnkkR9yDJIbWsXk4RiPAInVkafT5NTR15Vpe8DVQsjtn/wf/qge8 bx0z09yWzhAt3soMKk5IS+cu7oF5wA9BmpUDv+nEE3ACNQyVaRKkZkHLKkgtFhApsLKk CtRQQSKZTzkYQlMztFRVciULiTjTQNsWdSJ5Hrjo/mx+ZOxrAbhWCGLErFo5YeGVB23k OzkTU0YetssKVaV9KsAVe9u/sCDBIj5nQGINQUS5wIfwBRSiAVyzKRiCEJIN2eMsHKVH wI3w== X-Gm-Message-State: AOAM532qYSvSvyWQ4ZSuWybMuk1j3nYnRq52kPDHKMf1+aU1j1/6eW20 rU1S2nWxLcqnoTqTRyPUrnRlzQ38frd1xEA2Jt0gUQ== X-Received: by 2002:a05:6a00:1508:: with SMTP id q8mr1395954pfu.3.1643952193051; Thu, 03 Feb 2022 21:23:13 -0800 (PST) MIME-Version: 1.0 References: <20220128213150.1333552-1-jane.chu@oracle.com> <20220128213150.1333552-2-jane.chu@oracle.com> <950a3e4e-573c-2d9f-b277-d1283c7256cd@oracle.com> In-Reply-To: From: Dan Williams Date: Thu, 3 Feb 2022 21:23:00 -0800 Message-ID: Subject: Re: [PATCH v5 1/7] mce: fix set_mce_nospec to always unmap the whole page To: Christoph Hellwig Cc: Jane Chu , "david@fromorbit.com" , "djwong@kernel.org" , "vishal.l.verma@intel.com" , "dave.jiang@intel.com" , "agk@redhat.com" , "snitzer@redhat.com" , "dm-devel@redhat.com" , "ira.weiny@intel.com" , "willy@infradead.org" , "vgoyal@redhat.com" , "linux-fsdevel@vger.kernel.org" , "nvdimm@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-xfs@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 3, 2022 at 5:42 AM Christoph Hellwig wrote: > > On Wed, Feb 02, 2022 at 11:07:37PM +0000, Jane Chu wrote: > > On 2/2/2022 1:20 PM, Jane Chu wrote: > > >> Wouldn't it make more sense to move these helpers out of line rather > > >> than exporting _set_memory_present? > > > > > > Do you mean to move > > > return change_page_attr_set(&addr, numpages, __pgprot(_PAGE_PRESENT), 0); > > > into clear_mce_nospec() for the x86 arch and get rid of _set_memory_present? > > > If so, sure I'll do that. > > > > Looks like I can't do that. It's either exporting > > _set_memory_present(), or exporting change_page_attr_set(). Perhaps the > > former is more conventional? > > These helpers above means set_mce_nospec and clear_mce_nospec. If they > are moved to normal functions instead of inlines, there is no need to > export the internals at all. Agree, {set,clear}_mce_nospec() can just move to arch/x86/mm/pat/set_memory.c.