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=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 20554C5519F for ; Wed, 25 Nov 2020 12:44:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90D63206E5 for ; Wed, 25 Nov 2020 12:44:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QDPnapi5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZE/ZgEKd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90D63206E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3n0W47oC0Scuu/bBjE3U3FtJnevyBk7eLv03gyI96HI=; b=QDPnapi5ic7lcjdABlNQdKI6K YFU7IljM0WRDvHoc+IkjkdbTD7QLgU8L4GnpwGJE6tmJ9hWw3G96HlCr5eZW48GDcniGbUmarbW7w 2696O/xpXpzpk7B0TnBzqz1V2erJf167XmlHo5FBlMd0FS2f0+6AI2jro8tXI7DHUidIfEQKYfBk6 ZLRU1wfrcp7lHWAQC35WaWqxU97n7FQnjc9EypgHID0t3x0RL/YhntYQsSAwxT3iRQv/Kxy8qCmpd bdO4p1x316g3lVlanck0ERvSOSk2wfxBWnliHkbNqCoE7cBqLerWC/7ssPnGl+tuO+5M965gjFmVg Vgmd+wHSg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khu8U-0003TL-Hh; Wed, 25 Nov 2020 12:43:02 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khu8N-0003PH-TC for linux-arm-kernel@lists.infradead.org; Wed, 25 Nov 2020 12:42:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606308175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E+jgAoXCcc+2e3woKE/RD7YJatBg4rpbL38pBlAO/5Y=; b=ZE/ZgEKdodjQPv9xsAun9oB0x3G+vlgvb+54jDvMGZsWB6n4pv8TMvUdPbWHw1Q22Zkaix AfhMADeRX6ZdCK2Qkl7mcmYrh3DFeg3X5HbwtbbppJ/r1szAq8MgQ9TTDgN/Y8foRyZl+d cOeYYZGQMkJ2p9wUaFyXUZxyv4vBnQU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-DI1Pfe2wOHqV_YxKmpoagw-1; Wed, 25 Nov 2020 07:42:50 -0500 X-MC-Unique: DI1Pfe2wOHqV_YxKmpoagw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E63451E7C7; Wed, 25 Nov 2020 12:42:44 +0000 (UTC) Received: from [10.36.112.131] (ovpn-112-131.ams2.redhat.com [10.36.112.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id C339A5D6AC; Wed, 25 Nov 2020 12:42:37 +0000 (UTC) Subject: Re: [PATCH v12 04/10] set_memory: allow querying whether set_direct_map_*() is actually enabled To: Mike Rapoport References: <20201125092208.12544-1-rppt@kernel.org> <20201125092208.12544-5-rppt@kernel.org> <5ea6eacd-79e8-0645-da39-d3461f60e627@redhat.com> <20201125121138.GJ123287@linux.ibm.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Wed, 25 Nov 2020 13:42:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201125121138.GJ123287@linux.ibm.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_074256_043739_8172DC47 X-CRM114-Status: GOOD ( 21.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Peter Zijlstra , Catalin Marinas , Dave Hansen , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, "H. Peter Anvin" , Christopher Lameter , Shuah Khan , Thomas Gleixner , Elena Reshetova , linux-arch@vger.kernel.org, Tycho Andersen , linux-nvdimm@lists.01.org, Will Deacon , x86@kernel.org, Matthew Wilcox , Ingo Molnar , Michael Kerrisk , Arnd Bergmann , James Bottomley , Borislav Petkov , Alexander Viro , Andy Lutomirski , Paul Walmsley , "Kirill A. Shutemov" , Dan Williams , linux-arm-kernel@lists.infradead.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , linux-fsdevel@vger.kernel.org, Andrew Morton , Rick Edgecombe , Roman Gushchin , Mike Rapoport Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 25.11.20 13:11, Mike Rapoport wrote: > On Wed, Nov 25, 2020 at 12:22:52PM +0100, David Hildenbrand wrote: >>> #include >>> >>> #endif /* __ASM_CACHEFLUSH_H */ >>> diff --git a/arch/arm64/include/asm/set_memory.h b/arch/arm64/include/asm/set_memory.h >>> new file mode 100644 >>> index 000000000000..ecb6b0f449ab >>> --- /dev/null >>> +++ b/arch/arm64/include/asm/set_memory.h >>> @@ -0,0 +1,17 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-only */ >>> + >>> +#ifndef _ASM_ARM64_SET_MEMORY_H >>> +#define _ASM_ARM64_SET_MEMORY_H >>> + >>> +#include >>> + >>> +bool can_set_direct_map(void); >>> +#define can_set_direct_map can_set_direct_map >> >> Well, that looks weird. >> [...] > > We have a lot of those e.g. in linux/pgtable.h > >>> } >>> +#else /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */ >>> +/* >>> + * Some architectures, e.g. ARM64 can disable direct map modifications at >>> + * boot time. Let them overrive this query. >>> + */ >>> +#ifndef can_set_direct_map >>> +static inline bool can_set_direct_map(void) >>> +{ >>> + return true; >>> +} >> >> I think we prefer __weak functions for something like that, avoids the >> ifdefery. > > I'd prefer this for two reasons: first, static inline can be optimized > away and second, there is no really good place to put generic > implementation. Fair enough Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel