Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp281148imj; Thu, 7 Feb 2019 04:19:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IaFIttm/srlzyd21eUc5cAFJGryjdAUPAElEytj5y1TxkiOBfZ9v5ESdAJ/jj7QPc1o5b2Q X-Received: by 2002:a17:902:2:: with SMTP id 2mr16560305pla.228.1549541967484; Thu, 07 Feb 2019 04:19:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549541967; cv=none; d=google.com; s=arc-20160816; b=LKlNDocCk2o91CAPXzcI55K+QD0xUo6dnGDpUWoHmEV+qFoFbDO4rtqvmG4QsaUjC1 aXUbUSc+qKVBgMNt8gyiMCWap4IDi+kIX/dZcDi6s08brTATUo1OEodz2xOo+RhidwIc 4dKk5V5Ol8CwOU0T1bMlx5Upt9ySZd8QfH2W9Z6IVU8Vjmw0qJxR1U9RByPsKwQo36Zx X7bAMevhGBdPlRA3COZR/jokhc6KrR8NSwjBNRYXmvsvy+GqTge9W/0KP2pzBUKLB+NI AfHrU8T13ngT+sEBc8OTEgZ5uBbA1S+GSSVopOd8z5/h+AmhVDio0S7L2IEaGmR074oR wVhw== 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:from:date:dkim-signature; bh=A8Cyi9FsctFQg1reS4e416nOpGL9/m9gfB3WKNmLr5w=; b=ZITxHXtLoeBE+Jro8Q+2Ap9jV7iuK4T7gxE26INjYk4g9OSzlKBU9Wlpixy/4QLAca 8tL1EUsdjbxHXZXWTsG1orvEtm4PmE67Dnq4C5055nEXB+DvQXOykh5D4HQAFd2YhOn1 Gk2rAVaGJmZBo0vRItrf/TI6nH4BYoaQWuH96bIvHKpQs+vaCiHTYOiX6SzgqV2C+La+ fQ/VquuulyPQO5BVP9DuVMYl40jBVn/CN7/JU8LF1OBdJrw60e0qugZzL0ZAZIoOoxNT iqDVyah7iE7xjk4YSXIA4zf61t4wjbuOwDO9JJJ3XQQmOImz5TGlQzgt5U4MHIIdOVUZ yfKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ZW7+SbnW; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si8103959pgp.4.2019.02.07.04.19.09; Thu, 07 Feb 2019 04:19:27 -0800 (PST) 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=@alien8.de header.s=dkim header.b=ZW7+SbnW; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbfBGMRp (ORCPT + 99 others); Thu, 7 Feb 2019 07:17:45 -0500 Received: from mail.skyhub.de ([5.9.137.197]:59326 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbfBGMRo (ORCPT ); Thu, 7 Feb 2019 07:17:44 -0500 Received: from zn.tnic (p200300EC2BD1880034901D79874D129C.dip0.t-ipconnect.de [IPv6:2003:ec:2bd1:8800:3490:1d79:874d:129c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 3F4831EC01AF; Thu, 7 Feb 2019 13:17:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1549541861; 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:in-reply-to:in-reply-to: references:references; bh=A8Cyi9FsctFQg1reS4e416nOpGL9/m9gfB3WKNmLr5w=; b=ZW7+SbnWyI4WaQasfoXxmPf+VBst3IdtOsw6FbILJm0FlLcRDIr1QSKsqQOYSY6Dsut1mX 5XCOImqkeJ9/arIGz+1G/J5Tbek9dwsxVCeqCxM716K4k6RxJI5SMxyjkDOh/Jxo5PI1N1 hRMjJEkp9bFNTvmk1f/svoF7FXpU2Uk= Date: Thu, 7 Feb 2019 13:17:29 +0100 From: Borislav Petkov To: Thomas Garnier Cc: kernel-hardening@lists.openwall.com, kristen@linux.intel.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, "Peter Zijlstra (Intel)" , Ard Biesheuvel , Thomas Garnier , Nadav Amit , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 02/27] x86: Use symbol name in jump table for PIE support Message-ID: <20190207121729.GE2414@zn.tnic> References: <20190131192533.34130-1-thgarnie@chromium.org> <20190131192533.34130-3-thgarnie@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190131192533.34130-3-thgarnie@chromium.org> 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 Thu, Jan 31, 2019 at 11:24:09AM -0800, Thomas Garnier wrote: > Replace the %c constraint with %P. The %c is incompatible with PIE > because it implies an immediate value whereas %P reference a symbol. How so? AFAIK, %c requires a constant operand and if %P is used to print a constant, it simply drops syntax-specific prefixes and does a bare constant. I guess that here https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#x86Operandmodifiers is not entirely correct as it should not say "If used for a constant" for %P but say "symbol or constant". But before/after asm doesn't show any difference. So what gives? before: # 39 "./arch/x86/include/asm/jump_label.h" 1 1: .byte 0xe9 .long .L241 - 2f # 2: .pushsection __jump_table, "aw" .balign 8 .long 1b - ., .L241 - . # .quad __use_tsc + 1 - . #, .popsection after: # 39 "./arch/x86/include/asm/jump_label.h" 1 1: .byte 0xe9 .long .L241 - 2f # 2: .pushsection __jump_table, "aw" .balign 8 .long 1b - ., .L241 - . # .quad __use_tsc+1 - . # .popsection -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.