Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp728181ybn; Wed, 2 Oct 2019 05:21:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEAOgVzJ82Qcp1EsIfFtYsCwD44iRfkwvDnfEGVQgcTmbsh8loAzdF1VcKjL1/8t8deZob X-Received: by 2002:aa7:c5c1:: with SMTP id h1mr3419687eds.10.1570018901789; Wed, 02 Oct 2019 05:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570018901; cv=none; d=google.com; s=arc-20160816; b=bpnHFItwHApUaFCso7SClbSWmqkXqIbqdV+ij6QnaF5+ODPTej7C8fk5mym35Ut84F 0KSneMPJLkKjwdDyYqU9Etb9v7SySRYK0eBVt8njsyHkyuL4Q1SwS0mKnWB5jT9umP1I DuT1XZsPqEgmjsicc5D2qnwKMhWNTlwCQd4XKbxcYauIUT6PIRsbPSSOnGU0ik5H0FX4 o6U3IOTK7VDegQLqKoyi3nv3zG2CKsEBUYMmE1wsgAd3kiVodIhP8wZCDJHJ9FWX6Wr2 x93NQI7jO8VnacF/rhoGxNFphMOuvu4xQYzjQWhgHV3jE8Lgn0FKy8cOBd84dRr+mZmj 1YXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=ERYCwhz2Jv8a2PVju4gxqh772VeR3/dOesngu7HPYnA=; b=uPFuoELNGeTEWPKDjs0p4Jg7nRa7lRAyzxwLFrA6eSok8QAfV3HCLgEN/4hSmemrx3 mtmJ+rjw8IJZl10gpudnrutnVWak/wyYqLgQCUmbNImXmdD9+BieT+ytKAGCNC3Z06bK eD7m5xmy3cmH2I19eSeD8YB1k4avhdM5wWTwds8UN55MJrrf0gXqGETZiO2+KuEsVKKZ Osda/NJ6nLbs6tNtZMqXcdaF9a4PmAy9lNA4lJX+BG+pAGar0Inxqm+IkL5EsINhoMez ZfjvNX8/dFeaHW2KejFaAoGG2Utbeh5leaCYAvbzRwQljEhMF6YQID850ZcTpNRwnNBx //5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NKTwvoIx; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si10308002ejt.21.2019.10.02.05.21.17; Wed, 02 Oct 2019 05:21:41 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NKTwvoIx; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbfJBLuH (ORCPT + 99 others); Wed, 2 Oct 2019 07:50:07 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33785 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbfJBLuH (ORCPT ); Wed, 2 Oct 2019 07:50:07 -0400 Received: by mail-lf1-f66.google.com with SMTP id y127so12518775lfc.0 for ; Wed, 02 Oct 2019 04:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ERYCwhz2Jv8a2PVju4gxqh772VeR3/dOesngu7HPYnA=; b=NKTwvoIxQtQKHiWFgsb0Dr5MXuoTKgm2v5uaWdQsgbZAg65hZVIWoISq3wolvdEAAR FxxPvE8dnm3bANECmAtFuazY5ZXEviGexcvyvzpErii7cWM6uZL9mg7hf34049JsB6Xd 9pdqnmVmk3p9j35vtwN2sO6IdAtnyUzWR2KGUJYmodCR4iKYYOJciJLMQvdug4MZiuiP 2nVI7cs8AKCxchOuVfkGDUxzjr811bGzOImlN4hKtKc95U20sJvHz2INXyyvmn5DwPiA EMZGI36ZasVGpNtA/WWHXlYBBHpqp6CBBdyKCDD3XPuR7/zujFdCdXJsKCuL7H54F0Yt UMiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ERYCwhz2Jv8a2PVju4gxqh772VeR3/dOesngu7HPYnA=; b=nToojUNG7vpGirv1Pi7cRCbIXhwDoPc9AmmQtCJQ+8uO5vaLo8L8erWf3DPoCejz0j QJGyQ66Fty3Zj+xW7eM05SgqgkZWCi33SUTeW4xllALaxeVd5mUBC8Y+LQFohbmw2Gbs /AfceFobeFPrXk+CSTC7w+f2gXNMg7ue3JZxHWgN9ZC2fCShxC+63fHmeGaz8gtweXlf tEzVtr/RCCIhnJ229PXUv0IxrSI8Ulwzz6AD/JiUQYyrWxhEnnSE+Digy9vkRKXDIg1G IKkW375qumwJ2fczKYmhuI/fehi+I8W215NUWZRRLKK5A6x3Du7W3kZOX6VODbRw8gX9 g50g== X-Gm-Message-State: APjAAAV4hHltcDzznPxfjmGoQykn3hgDvlTg5Emq5RTLUVI9zNkzIm7V KW7sB70yqNJGL0/cich4H50cUeKnXEI= X-Received: by 2002:a19:8c14:: with SMTP id o20mr2075568lfd.158.1570017005189; Wed, 02 Oct 2019 04:50:05 -0700 (PDT) Received: from pc636 ([37.139.158.167]) by smtp.gmail.com with ESMTPSA id x76sm6142064ljb.81.2019.10.02.04.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 04:50:04 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 2 Oct 2019 13:49:52 +0200 To: Daniel Axtens Cc: Uladzislau Rezki , kasan-dev@googlegroups.com, linux-mm@kvack.org, x86@kernel.org, aryabinin@virtuozzo.com, glider@google.com, luto@kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, dvyukov@google.com, christophe.leroy@c-s.fr, linuxppc-dev@lists.ozlabs.org, gor@linux.ibm.com Subject: Re: [PATCH v8 1/5] kasan: support backing vmalloc space with real shadow memory Message-ID: <20191002114952.GA30483@pc636> References: <20191001065834.8880-1-dja@axtens.net> <20191001065834.8880-2-dja@axtens.net> <20191001101707.GA21929@pc636> <87zhik2b5x.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zhik2b5x.fsf@dja-thinkpad.axtens.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 02, 2019 at 11:23:06AM +1000, Daniel Axtens wrote: > 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? > I agree that is totally correct. > 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. > It should. I was more thinking about if those two variables can be considered as unused, resulting in compile warning like "set but not used". But that is theory and in case of having any warning the test robot will notify anyway about that. So, i am totally fine with that if compiler does not complain. If so, please ignore my comments :) -- Vlad Rezki