Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp449536ybn; Wed, 2 Oct 2019 00:21:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqywnkef3lR42uv9a0645Nuq5x4epNaCkoojrY5ic/XsJjTmjafkTiO9cnQc6LCJUzxdiucv X-Received: by 2002:a17:906:20c7:: with SMTP id c7mr1757346ejc.248.1570000887632; Wed, 02 Oct 2019 00:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570000887; cv=none; d=google.com; s=arc-20160816; b=bNUSxOHEfR30SXUpqfxWDhfJ/3mXAuD99RUGXPyN1+SSiQQDpaqo6VLgCwt0KRJ+aq HyrqfqN2+6VR1U1QW4/H/ZnJawESW8SLeDJ4OWBpgVUUJisIvTGIykPTmu8bnodxLl9T OrZx7zTcBKNqv/Bele0IkXfJDz0x5T3kJ7ywVY/dImkxlFh9zVqcWv/2e/CrLA5JZh3u 34Ztjvq5XUgP2dKuD4lLWBebxfHLOKd+er/xEkcwx8Gn4S4TNFQ4MORoYfkmyefYMJco zbBMSjhIJH1cz5W8R2MB+MQeIUytlN70AdTSUm4Dk37xEM3BxfD9hhpF4JW4uG1c+mxD vmXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-disposition:mime-version:user-agent:in-reply-to:references :subject:cc:to:from:message-id:date; bh=BScJSrFGqoZde012DB4vq2wZxGKu9oYJ4pilgRf7FOk=; b=wQZDWqj8FzwWIxtldeU87Ytr6jwl6Ct//mMiUUZgZuTjda05vdAHJfmjsPjXOuGG+q QbxzI2ba8KMxGhr5fiVQ5rV98u/kfNdo1pwXWieNnOWVxO057R8acAjd2FH2tupR2jL9 P07hkcB8XWU2E7EEAK83k5C4GxAAU8pPfvWl3979Sbn/JCcl7Xb2aHC1dUkvBfll7ACt bKN1A9cON5MiRWOhAugF4tL1OE3z8VP99022VXt6QtOx2thwj+RvNGOzqX31kbylfUtu 9IiZryvfOE9XL43xNCHLKLti3JPABXFtoF+iMBe8MYZ///HiV2Ht/MrtPfZHyKKHVKMO nUSw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si10603871eda.216.2019.10.02.00.21.03; Wed, 02 Oct 2019 00:21:27 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726875AbfJBHL6 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 2 Oct 2019 03:11:58 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:4795 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfJBHL6 (ORCPT ); Wed, 2 Oct 2019 03:11:58 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 46jnPl5wHGz9v0tb; Wed, 2 Oct 2019 09:11:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id e2yIw6Fj-kKw; Wed, 2 Oct 2019 09:11:55 +0200 (CEST) Received: from vm-hermes.si.c-s.fr (vm-hermes.si.c-s.fr [192.168.25.253]) by pegase1.c-s.fr (Postfix) with ESMTP id 46jnPl56CTz9v0tZ; Wed, 2 Oct 2019 09:11:55 +0200 (CEST) Received: by vm-hermes.si.c-s.fr (Postfix, from userid 33) id 348AA64F; Wed, 2 Oct 2019 09:13:04 +0200 (CEST) Received: from 37.173.255.220 ([37.173.255.220]) by messagerie.si.c-s.fr (Horde Framework) with HTTP; Wed, 02 Oct 2019 09:13:04 +0200 Date: Wed, 02 Oct 2019 09:13:04 +0200 Message-ID: <20191002091304.Horde.44CFpqD3KN1HHZOT0U8wSQ7@messagerie.si.c-s.fr> From: Christophe Leroy To: Daniel Axtens Cc: gor@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, dvyukov@google.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, luto@kernel.org, glider@google.com, aryabinin@virtuozzo.com, x86@kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, Uladzislau Rezki Subject: Re: [PATCH v8 1/5] kasan: support backing vmalloc space with real shadow memory References: <20191001065834.8880-1-dja@axtens.net> <20191001065834.8880-2-dja@axtens.net> <20191001101707.GA21929@pc636> <87zhik2b5x.fsf@dja-thinkpad.axtens.net> In-Reply-To: <87zhik2b5x.fsf@dja-thinkpad.axtens.net> User-Agent: Internet Messaging Program (IMP) H5 (6.2.3) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Daniel Axtens a écrit : > Hi, > >>> /* >>> * Find a place in the tree where VA potentially will be >>> * inserted, unless it is merged with its sibling/siblings. >>> @@ -741,6 +752,10 @@ merge_or_add_vmap_area(struct vmap_area *va, >>> if (sibling->va_end == va->va_start) { >>> sibling->va_end = va->va_end; >>> >>> + kasan_release_vmalloc(orig_start, orig_end, >>> + sibling->va_start, >>> + sibling->va_end); >>> + >> The same. > > The call to kasan_release_vmalloc() is a static inline no-op if > CONFIG_KASAN_VMALLOC is not defined, which I thought was the preferred > way to do things rather than sprinkling the code with ifdefs? > > The complier should be smart enough to eliminate all the > orig_state/orig_end stuff at compile time because it can see that it's > not used, so there's no cost in the binary. > Daniel, You are entirely right in your way to do i, that's fully in line with Linux kernel codying style https://www.kernel.org/doc/html/latest/process/coding-style.html#conditional-compilation Christophe