From patchwork Thu Sep 26 13:38:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 11162779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 586C2924 for ; Thu, 26 Sep 2019 13:40:02 +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 369A1222C2 for ; Thu, 26 Sep 2019 13:40:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q6On8p92" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 369A1222C2 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+patchwork-linux-arm=patchwork.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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iBql/vkoV7BI+uZ2JS1dvl969e2zjsO3FPMgJXMBb/U=; b=q6On8p92cUCXqp J0Svt7v/0kJtmQ9+w8QYUzLCZAWRaiMhfAwqg4SyqKZF1Uo/w49hXhdOOJa8g06f9q7CZmVJE+t1p G7vu2Oummzv96l0PyOhCFHrvjoliAeCIYBcBQteJJmoqsQSJWCrnzKXEd8e+hZ0lROb1FRP7dQ97E aR1Nj0Kr0IrtPSm5hqcibVCa5NWTYoo9FY79Z8/1XGojrSlPkrKP47VfnFpTXEF+0YU/tU4ybckxj E6V9Vo+D9Syj2paO2QS7UGJixK8piTbZ9iTVLM4mvV/V+gjxKytybw7nRdSX3fKi4dbvS/KtzNdP3 XH/Ii+EeE0BGnBgo93yg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDU00-0007if-Fp; Thu, 26 Sep 2019 13:40:00 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDTyr-000712-C9 for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2019 13:38:50 +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 CBF2715A2; Thu, 26 Sep 2019 06:38:48 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A86023F534; Thu, 26 Sep 2019 06:38:47 -0700 (PDT) From: Vincenzo Frascino To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] arm64: vdso32: Fix compilation warning Date: Thu, 26 Sep 2019 14:38:04 +0100 Message-Id: <20190926133805.52348-4-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926133805.52348-1-vincenzo.frascino@arm.com> References: <20190920142738.qlsjwguc6bpnez63@willie-the-truck> <20190926133805.52348-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190926_063849_469839_C11080CC X-CRM114-Status: GOOD ( 10.41 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: ard.biesheuvel@linaro.org, catalin.marinas@arm.com, ndesaulniers@google.com, tglx@linutronix.de, vincenzo.frascino@arm.com, will@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org As reported by Will Deacon the following compilation warning appears during the compilation of the vdso32: In file included from ./arch/arm64/include/asm/thread_info.h:17:0, from ./include/linux/thread_info.h:38, from ./arch/arm64/include/asm/preempt.h:5, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from .../work/linux/lib/vdso/gettimeofday.c:7, from :0: ./arch/arm64/include/asm/memory.h: In function ‘__tag_set’: ./arch/arm64/include/asm/memory.h:233:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] u64 __addr = (u64)addr & ~__tag_shifted(0xff); ^ In file included from ./arch/arm64/include/asm/pgtable-hwdef.h:8:0, from ./arch/arm64/include/asm/processor.h:34, from ./arch/arm64/include/asm/elf.h:118, from ./include/linux/elf.h:5, from ./include/linux/elfnote.h:62, from arch/arm64/kernel/vdso32/note.c:11: ./arch/arm64/include/asm/memory.h: In function ‘__tag_set’: ./arch/arm64/include/asm/memory.h:233:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] u64 __addr = (u64)addr & ~__tag_shifted(0xff); ^ This happens because few 64 bit compilation headers are included during the generation of vdso32. Fix the issue redefining the __tag_set function. Note: This fix is meant to be temporary, a more comprehensive solution based on the refactoring of the generic headers will be provided with a future patch set. At that point it will be possible to revert this patch. Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Vincenzo Frascino --- arch/arm64/include/asm/memory.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index b61b50bf68b1..cfa9cd87af14 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -228,11 +228,16 @@ static inline unsigned long kaslr_offset(void) #define __tag_get(addr) 0 #endif /* CONFIG_KASAN_SW_TAGS */ +#ifdef __aarch64__ static inline const void *__tag_set(const void *addr, u8 tag) { u64 __addr = (u64)addr & ~__tag_shifted(0xff); return (const void *)(__addr | __tag_shifted(tag)); } +#else +/* Unused in compat vdso */ +#define __tag_set(addr, tag) 0 +#endif /* * Physical vs virtual RAM address space conversion. These are