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=-4.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 75A36C433DF for ; Wed, 26 Aug 2020 16:52:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35CB12078B for ; Wed, 26 Aug 2020 16:52:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iErvcybf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35CB12078B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B75D96B0010; Wed, 26 Aug 2020 12:52:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B25AE6B0023; Wed, 26 Aug 2020 12:52:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EDB16B0025; Wed, 26 Aug 2020 12:52:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id 8917B6B0010 for ; Wed, 26 Aug 2020 12:52:14 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4582D180AD802 for ; Wed, 26 Aug 2020 16:52:14 +0000 (UTC) X-FDA: 77193312588.18.tray59_63065cb27066 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 0DA3E100EC664 for ; Wed, 26 Aug 2020 16:52:14 +0000 (UTC) X-HE-Tag: tray59_63065cb27066 X-Filterd-Recvd-Size: 5093 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Aug 2020 16:52:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598460730; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fseon1CUZlvG+qAn5/Dq00exA8K9BCSeKO7lSLO6dwU=; b=iErvcybf2p99F5Iz6U8B5Y1UpOnElvgCj2Na0QGa3MeOZDULj37q3uhFTTtaiSl8jkwKEm F92Gj/8wPpJ7EXRWWfyMR97iivTQQB5aMc+lZVtm2AhvaESmulNi/xQ2Qtec/l+Nfq9Uj5 OLzzmjG+9iaDxtgxd7QNrLtMBph8/u8= 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-579-CGPhPkXwNDaMQykNbqtiGg-1; Wed, 26 Aug 2020 12:52:06 -0400 X-MC-Unique: CGPhPkXwNDaMQykNbqtiGg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ADF7D80BCA0; Wed, 26 Aug 2020 16:52:02 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-37.ams2.redhat.com [10.36.112.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D3D619C78; Wed, 26 Aug 2020 16:51:50 +0000 (UTC) From: Florian Weimer To: Dave Martin Cc: "Yu\, Yu-cheng" , Dave Hansen , Andy Lutomirski , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list\:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Weijiang Yang Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack References: <20200825002540.3351-1-yu-cheng.yu@intel.com> <20200825002540.3351-26-yu-cheng.yu@intel.com> <2d253891-9393-44d0-35e0-4b9a2da23cec@intel.com> <086c73d8-9b06-f074-e315-9964eb666db9@intel.com> <73c2211f-8811-2d9f-1930-1c5035e6129c@intel.com> <20200826164604.GW6642@arm.com> Date: Wed, 26 Aug 2020 18:51:48 +0200 In-Reply-To: <20200826164604.GW6642@arm.com> (Dave Martin's message of "Wed, 26 Aug 2020 17:46:05 +0100") Message-ID: <87ft892vvf.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Rspamd-Queue-Id: 0DA3E100EC664 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: * Dave Martin: > On Tue, Aug 25, 2020 at 04:34:27PM -0700, Yu, Yu-cheng wrote: >> On 8/25/2020 4:20 PM, Dave Hansen wrote: >> >On 8/25/20 2:04 PM, Yu, Yu-cheng wrote: >> >>>>I think this is more arch-specific.=C2=A0 Even if it becomes a new s= yscall, >> >>>>we still need to pass the same parameters. >> >>> >> >>>Right, but without the copying in and out of memory. >> >>> >> >>Linux-api is already on the Cc list.=C2=A0 Do we need to add more peop= le to >> >>get some agreements for the syscall? >> >What kind of agreement are you looking for? I'd suggest just coding it >> >up and posting the patches. Adding syscalls really is really pretty >> >straightforward and isn't much code at all. >> > >>=20 >> Sure, I will do that. > > Alternatively, would a regular prctl() work here? Is this something appliation code has to call, or just the dynamic loader? prctl in glibc is a variadic function, so if there's a mismatch between the kernel/userspace syscall convention and the userspace calling convention (for variadic functions) for specific types, it can't be made to work in a generic way. The loader can use inline assembly for system calls and does not have this issue, but applications would be implcated by it. Thanks, Florian