From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-24.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9247C4338F for ; Thu, 29 Jul 2021 07:49:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D97861050 for ; Thu, 29 Jul 2021 07:49:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D97861050 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 67F186B0036; Thu, 29 Jul 2021 03:49:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 630098D0001; Thu, 29 Jul 2021 03:49:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51DD16B006C; Thu, 29 Jul 2021 03:49:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0172.hostedemail.com [216.40.44.172]) by kanga.kvack.org (Postfix) with ESMTP id 3B10E6B0036 for ; Thu, 29 Jul 2021 03:49:07 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D0E6920300 for ; Thu, 29 Jul 2021 07:49:06 +0000 (UTC) X-FDA: 78414849492.09.BAC1A39 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by imf27.hostedemail.com (Postfix) with ESMTP id 8DC11702616E for ; Thu, 29 Jul 2021 07:49:06 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id q3so5754439wrx.0 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=MXjy/YqWzp5cN2YWJrxMLPCSKimG68vQZttkjWMEHoB/DDVVE/lk3e0IbIzfzc+LyR XMpBn0lcFgGqE6SzqJLFYTG9dy0vqFMke9qYBKQVgFxl+/qkyP9/eX80WreKcMvqmvGl os82G947WqQ9DFOugbGPCB2Nfun0+FVSxpylOMN+2d+PS1yMDwi4/wG3SVcNlQ3M5SWD qHOw99zATzLWJ/2RGFkvcVnOQdsJPpZfpDV190dOsj6RI8MUde0AOjrh/CfeuqMVoRnn +psumCnGY04be9YYX+AwaW7NSv2uuL8LvlqyDl4kKiRCsmkc1aw7fwmfcKxIOnlGMwHo vJKQ== X-Gm-Message-State: AOAM531AzQdVjfI8v5qSyaN33JkaFxUDkfuFmPpl4VX2IMfMCanCpCzi kyrZEEsKkIpHzn4Uk0Ni2dJqzg== X-Google-Smtp-Source: ABdhPJzbR1HACnZZJBDhiL2ARbrJnGx5sYQIaYtEWpSvBcN3z0ditxTzHS+Wuapzs4HhC7B1gYUdMQ== 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) X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8DC11702616E Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=tjwxZwUR; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of elver@google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=elver@google.com X-Stat-Signature: 17mtuxcn65peq3tenb7n7986he5fwky7 X-HE-Tag: 1627544946-958710 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000018, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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