Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2277776ybz; Thu, 30 Apr 2020 14:12:36 -0700 (PDT) X-Google-Smtp-Source: APiQypJy0m3t/8bEprGRiZfg6h8CRbkoZ6LhtwkYm0a6XsWbwtHGIYmgGD9JLZbP81CUY/PjCHtn X-Received: by 2002:a17:906:459:: with SMTP id e25mr359371eja.379.1588281156604; Thu, 30 Apr 2020 14:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588281156; cv=none; d=google.com; s=arc-20160816; b=wZ3/NKKgaHTWhkOOaHqTb38l84ACjq6e+Nby14YbRRY9dHHGZE340WQ6AoN7OiFGAK tsiEkxzeCHOIAz4pHjV5a2T++iNI/vrRrCH5BX5U++qBxtV34H+6R6MwzEgwJLqTUTz1 04YYQeJ2V79o/zgHkPjn5wZZLfQ4vU6DoFzzMaCfXxxg8YBdPdn5RTP5bVupGAXIeXMt U58ecFNFMnS6OMbcInJZPhbC7Rn5wxzH5cyh7q3YH5zAdZ3l/pv1lRvqMb2D/LgyTURZ sibme0b1IwyeZb4N1StGGSSHUH88TliolerYZe8Yqf1PtB1FrIpNdLhJQcetqMXlCbl6 fJ9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7VZLSjXfN7iXJ8eJ+NDw2LG6g4a8Y8iJ2XndpsGf3FM=; b=sCUao0WFiqHQrA8Ip0rN4TM5Sva5ysSJahCENlktfLAQIJxGRDqn8sLIjdM6wJvnZh Wwky7wlR7p8CLe5mt4vbsxN3DUoMoIQzuQyQLIu4m/rLPE3QAjQDPNpeoggKMCpEuaXF UM/Nxa4WxnoSF82GDO3FhjvhCPUxcjOK62FyKdL1IZO5w4nqJI6Npj4txRtRa9WgyEC/ pRdRJ8R/jpdXLFLYQbKRJoDgeu+NvhQUoCSQ5qSrcndkDSeZ5wRdvSLFhDbEpNqYLJ48 Z8yZseSdtZOnaiyk4pEOKqqxAGIHbxYIfMfVrQYvInEtuZcZ6zxEUI2CNvbnAYEoBKxS gl9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eVwgAkFr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 30si536847edr.255.2020.04.30.14.11.59; Thu, 30 Apr 2020 14:12:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eVwgAkFr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726447AbgD3VIO (ORCPT + 99 others); Thu, 30 Apr 2020 17:08:14 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:50626 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726336AbgD3VIO (ORCPT ); Thu, 30 Apr 2020 17:08:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588280892; 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: in-reply-to:in-reply-to:references:references; bh=7VZLSjXfN7iXJ8eJ+NDw2LG6g4a8Y8iJ2XndpsGf3FM=; b=eVwgAkFrN3YoinuhaYCNwfATOkblWB6k7OO6hA9JH+eyxtgURXtwRbbBjcyrBvkmZYxaVX sCa3ooaLnw0Ma1KUNFkgaWy3rFo8raEWCkqd+z+Q0TSoiz3nOh4DA904HVdsrQY2WmQ94g HekD8aNkSM2VzfpGPG8/Qxuy+JvPmd8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-222-dK0Y6FziPn-mAAcCBg-csA-1; Thu, 30 Apr 2020 17:08:09 -0400 X-MC-Unique: dK0Y6FziPn-mAAcCBg-csA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6B2E100A8E8; Thu, 30 Apr 2020 21:08:07 +0000 (UTC) Received: from treble (ovpn-113-19.rdu2.redhat.com [10.10.113.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 004B860C87; Thu, 30 Apr 2020 21:08:06 +0000 (UTC) Date: Thu, 30 Apr 2020 16:08:05 -0500 From: Josh Poimboeuf To: Arnd Bergmann Cc: Peter Zijlstra , the arch/x86 maintainers , Linux Kernel Mailing List , Kees Cook Subject: Re: Remaining randconfig objtool warnings, linux-next-20200428 Message-ID: <20200430210805.67h5la6m7rtygeq5@treble> References: <20200428161044.caamvx67t2z4t6vd@treble> <20200429185536.5xshpcwtn4be4llh@treble> <20200429231115.z2mo5bsmrmj4oark@treble> <20200429232835.yw6ajtjyleob3lmz@treble> <20200430143350.qezebqmx2xwdxqxq@treble> <20200430194630.jkwysx6eftkaf6bu@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200430194630.jkwysx6eftkaf6bu@treble> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 02:46:30PM -0500, Josh Poimboeuf wrote: > > Yup, makes sense. I think I've been getting confused by the syscall > > wrappers. > > > > > How hard would it be to change objtool instead of changing the sources? So I just realized this is an objtool bug after all. Or at least a new GCC quirk. The quick fix is: sed -si 's/cold./cold/' tools/objtool/check.c However... after studying how all this works, I'm actually thinking that it makes sense to move the SYS_NI usage into kernel/sys_ni.c, like you originally suggested. That seems cleaner to me: all the syscall aliasing code together in one file. SYS_NI is similar to COND_SYSCALL, except it has a custom ENOSYS handler. Having "NI" in the name is another clue it belongs in sys_ni.c. Alternatively, I could do the x86-specific SYSCALL_ALIAS, which is easy enough, but I really prefer the sys_ni.c approach. Either of those would allow the removal of some hacky objtool code, which only ever existed in the first place because of posix-stubs.c and that inline asm SYSCALL_ALIAS macro. One of objtool's goals is to standardize ELF data, and it seems reasonable to require the use of C-based aliases. And I think it would be a nice cleanup anyway. -- Josh