Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5897062pxv; Thu, 29 Jul 2021 00:50:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVo3PJRYoNAQzSnIEBdJVElCSbQEE8Wcpp2r190ZYYp9WH1RyMvG5mlY2+Re5C+27LzJZX X-Received: by 2002:a17:906:481b:: with SMTP id w27mr3410984ejq.517.1627545047145; Thu, 29 Jul 2021 00:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627545047; cv=none; d=google.com; s=arc-20160816; b=idcWFtJxNqL/pmKh6FqIBntUR9dJEmj1LcOXtGwbvp3iOj/WbjAZbLoRoy1v1ZJW9N LXfz4COL4Uflb9VqgN1efuvneXwgzlp1McGZBXvPH4tFNUDcYzgjgEEajPMxqGtRiFrp M+CmRmMoE/0osZLPFvO1GsKIm6W8gnfTEwtim8WN5EzdNPBJ0ZBCzw61iRmhg0tT11pe IcwMjCiktQce+jsFy9T4VTUzzpNtSH11oHtL2Mt+CzH3iQdDBXn67rkfUYcXOoq2X4VE sFXOXl+TE/gbTY96cXk5WIj13jQwzVmPpHuQKe7ycXpbncDxwUof85GcafO7FmrS1WXv OoyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L6N0ezTtWFmQj4Q9ef8/0d56n3pMY70Zf97no+qDSJA=; b=s/ocvkwBuVIqLTdChEfKQ+kCE/x/Zc28ykK/t1nrH4DHacRYxx92BjCOACWyWh5WXh PUmRWba0rji1ync9n1cWdGtqWC+lKnaIj9/Dm7S+cvK41zSsB0eq1+hncbWRycuXqiyw PVAFc1akiI+pc8wBCkUOaC6Pym1NoXqgiAZ3nq/vm8IgD669SBjZ0Hc58GW34/5s1Cyd B/IwBhrsVAz7Bp108ZPY+Stt7J52Q1Fltx9QN4mwgAV/DFcFGPSiagW8jaQ0bxcdaSST p1Kyv6ig0chKNEuNzcaiITBmkFRmETrnUlae29Y9yMrHc2ixZRCfzn9BFTAewI6kSryj HOWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tjwxZwUR; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si1897613edb.130.2021.07.29.00.50.24; Thu, 29 Jul 2021 00:50:47 -0700 (PDT) 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=@google.com header.s=20161025 header.b=tjwxZwUR; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234564AbhG2HtN (ORCPT + 99 others); Thu, 29 Jul 2021 03:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234583AbhG2HtJ (ORCPT ); Thu, 29 Jul 2021 03:49:09 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF89CC061757 for ; Thu, 29 Jul 2021 00:49:06 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id l18so5699021wrv.5 for ; Thu, 29 Jul 2021 00:49:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=L6N0ezTtWFmQj4Q9ef8/0d56n3pMY70Zf97no+qDSJA=; b=tjwxZwURHTWvWkFtjs1Jrg/NcpQ+H2TF5AQKGqyhFX+fc1TzDSMl36rHNr9bRnoaCh B+GT81ypvW+IJ5L45witNhgXDu0m98Tlk9L++fA6GdfaNIHvesS2SSjg2iuLH5H/pt6Y Xeg6g6AMMwR2Gzyg+SpI7BHxnOX9v9yyayq+FTjFLG6TYaFU2tZ8oLmkx2BBDkhbXbuA qj+ze7iXB/npWV+/yui2jOoeylqH85O3xk7SZDvmQ/n2mZ99Yr8sWyAaxmkbvqWulXTc B27qEVfN1GadYAppW4+XErOv/JRb6+4UrYth2NwPUU2ao8+0s3idaEKPmQo2SxmB2s9h G5wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=L6N0ezTtWFmQj4Q9ef8/0d56n3pMY70Zf97no+qDSJA=; b=kIiKD9M3RioUffMEMpIyviyX2i06AQ144aOOZK+iElDpI9rfGPSh8QDQINGevrx7Gv aRuRsi6bPj/1seaMI+G6LkP1Ft1RV6h9MFOXWI+pdn9Ibyflx8iHyTNbW5Vf1d3uhJvy ZN2F2BddV+/hHd3y4tDNf/BQzZQ00OYzxs/6LGx7naS/Lf1rZVTPAlY6ZkphI8FlMQdU pB318C1SR1VXacbE9dWwprSCYToSDs9xqr6Ln1Y/mgZeVMxK5ngDilfnGbtuHo5DaorL cA51pc3wHxW6rWMN/lfsFAUc3OgRu2LstCr9MyfC1bDoC8HSRUOPvO97MssZg3rNUrP3 HiRg== X-Gm-Message-State: AOAM530AjFrM9CFmfPK1mkbjnFNr4Hz2Axf5J78zuyPUq4XsUiEy4Qde HlB8k4cBO0NHPSWig8IEtw6DqQ== X-Received: by 2002:adf:de8a:: with SMTP id w10mr3331505wrl.61.1627544945144; Thu, 29 Jul 2021 00:49:05 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:15:13:377:4a06:5280:39bf]) by smtp.gmail.com with ESMTPSA id k186sm9573131wme.45.2021.07.29.00.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 00:49:04 -0700 (PDT) Date: Thu, 29 Jul 2021 09:48:58 +0200 From: Marco Elver To: Heiko Carstens Cc: Alexander Potapenko , Sven Schnelle , Vasily Gorbik , Christian Borntraeger , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH 2/4] kfence: add function to mask address bits Message-ID: References: <20210728190254.3921642-1-hca@linux.ibm.com> <20210728190254.3921642-3-hca@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210728190254.3921642-3-hca@linux.ibm.com> User-Agent: Mutt/2.0.5 (2021-01-21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 09:02PM +0200, Heiko Carstens wrote: > From: Sven Schnelle > > s390 only reports the page address during a translation fault. > To make the kfence unit tests pass, add a function that might > be implemented by architectures to mask out address bits. > > Signed-off-by: Sven Schnelle > Signed-off-by: Heiko Carstens I noticed this breaks on x86 if CONFIG_KFENCE_KUNIT_TEST=m, because x86 conditionally declares some asm functions if !MODULE. I think the below is the simplest to fix, and if you agree, please carry it as a patch in this series before this patch. With the below, you can add to this patch: Reviewed-by: Marco Elver Thanks, -- Marco ------ >8 ------ From: Marco Elver Date: Wed, 28 Jul 2021 21:57:41 +0200 Subject: [PATCH] kfence, x86: only define helpers if !MODULE x86's only declares non-module accessible functions (such as flush_tlb_one_kernel) if !MODULE. In preparation of including from the KFENCE test module, only define the helpers if !MODULE to avoid breaking the build with CONFIG_KFENCE_KUNIT_TEST=m. Signed-off-by: Marco Elver --- arch/x86/include/asm/kfence.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/include/asm/kfence.h b/arch/x86/include/asm/kfence.h index 05b48b33baf0..ff5c7134a37a 100644 --- a/arch/x86/include/asm/kfence.h +++ b/arch/x86/include/asm/kfence.h @@ -8,6 +8,8 @@ #ifndef _ASM_X86_KFENCE_H #define _ASM_X86_KFENCE_H +#ifndef MODULE + #include #include @@ -66,4 +68,6 @@ static inline bool kfence_protect_page(unsigned long addr, bool protect) return true; } +#endif /* !MODULE */ + #endif /* _ASM_X86_KFENCE_H */ -- 2.32.0.554.ge1b32706d8-goog