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=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_MUTT 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 8CA0AC31E46 for ; Wed, 12 Jun 2019 15:01:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 57544208CA for ; Wed, 12 Jun 2019 15:01:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S3kR9kN4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57544208CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.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:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/m8iQKhUANXHHdks4tJ4Te3Xyb1K72PRjfRP9WNFSrc=; b=S3kR9kN4rOvyaJ jAbgThItwmtuacfdWbYrxZb4XzJneo7wJA4FIJjZ/NMRrFPaj7ySVwjnnbV+eyYByoeKj1NHAfxs7 qcQAw034WiHN4X8cvVC0SfrBqQgDJGnFF6YCqrb+5dJXY4hy2M937rMtYy8kjTcsUfGI5v99kW7zq NpqAPTm9kIH30JrRSoBHbS6MVMaKJfdiR/5ImJiMyc+Lq86NoT0XK32wPNUQVC3CkaBEOBpxm4yif lcx9lm5mREHZ5zsnN5KtajyiQyUI23jqNr/qGbb9Fe/L50ZQ+oU2WIliqn/kucXR5A7B66fVsU8IQ DJyoIG7UzBuiEGdUE+qg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hb4l4-0001DP-GW; Wed, 12 Jun 2019 15:01:50 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hb4kI-00013X-Ak for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2019 15:01:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B40A2B; Wed, 12 Jun 2019 08:01:00 -0700 (PDT) Received: from C02TF0J2HF1T.local (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 71C193F557; Wed, 12 Jun 2019 08:00:46 -0700 (PDT) Date: Wed, 12 Jun 2019 16:00:42 +0100 From: Catalin Marinas To: Szabolcs Nagy Subject: Re: [PATCH v17 15/15] selftests, arm64: add a selftest for passing tagged pointers to kernel Message-ID: <20190612150040.GH28951@C02TF0J2HF1T.local> References: <7cd942c0-d4c1-0cf4-623a-bce6ef14d992@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7cd942c0-d4c1-0cf4-623a-bce6ef14d992@arm.com> User-Agent: Mutt/1.11.2 (2019-01-07) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190612_080102_464437_07CC102D X-CRM114-Status: GOOD ( 15.93 ) 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 , "kvm@vger.kernel.org" , Will Deacon , "dri-devel@lists.freedesktop.org" , "linux-mm@kvack.org" , Khalid Aziz , "linux-kselftest@vger.kernel.org" , Felix Kuehling , Vincenzo Frascino , nd , Jacob Bramley , Leon Romanovsky , "linux-rdma@vger.kernel.org" , "amd-gfx@lists.freedesktop.org" , Christoph Hellwig , Jason Gunthorpe , Dmitry Vyukov , Dave P Martin , Evgeniy Stepanov , "linux-media@vger.kernel.org" , Kevin Brodsky , Kees Cook , Ruben Ayrapetyan , Andrey Konovalov , Ramana Radhakrishnan , Alex Williamson , Mauro Carvalho Chehab , "linux-arm-kernel@lists.infradead.org" , Kostya Serebryany , Greg Kroah-Hartman , Yishai Hadas , "linux-kernel@vger.kernel.org" , Jens Wiklander , Lee Smith , Alexander Deucher , Andrew Morton , enh , Robin Murphy , Christian Koenig , Luc Van Oostenryck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 12, 2019 at 01:30:36PM +0100, Szabolcs Nagy wrote: > On 12/06/2019 12:43, Andrey Konovalov wrote: > > --- /dev/null > > +++ b/tools/testing/selftests/arm64/tags_lib.c > > @@ -0,0 +1,62 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > + > > +#include > > +#include > > + > > +#define TAG_SHIFT (56) > > +#define TAG_MASK (0xffUL << TAG_SHIFT) > > + > > +#define PR_SET_TAGGED_ADDR_CTRL 55 > > +#define PR_GET_TAGGED_ADDR_CTRL 56 > > +#define PR_TAGGED_ADDR_ENABLE (1UL << 0) > > + > > +void *__libc_malloc(size_t size); > > +void __libc_free(void *ptr); > > +void *__libc_realloc(void *ptr, size_t size); > > +void *__libc_calloc(size_t nmemb, size_t size); > > this does not work on at least musl. > > the most robust solution would be to implement > the malloc apis with mmap/munmap/mremap, if that's > too cumbersome then use dlsym RTLD_NEXT (although > that has the slight wart that in glibc it may call > calloc so wrapping calloc that way is tricky). > > in simple linux tests i'd just use static or > stack allocations or mmap. > > if a generic preloadable lib solution is needed > then do it properly with pthread_once to avoid > races etc. Thanks for the feedback Szabolcs. I guess we can go back to the initial simple test that Andrey had and drop the whole LD_PRELOAD hack (I'll just use it for my internal testing). BTW, when you get some time, please review Vincenzo's ABI documentation patches from a user/libc perspective. Once agreed, they should become part of this series. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel