From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753901AbcGDUNf (ORCPT ); Mon, 4 Jul 2016 16:13:35 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.189.228]:7971 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753871AbcGDUNa convert rfc822-to-8bit (ORCPT ); Mon, 4 Jul 2016 16:13:30 -0400 X-IronPort-AV: E=Sophos;i="5.26,576,1459814400"; d="scan'208";a="525724611" From: "Tautschnig, Michael" To: "H. Peter Anvin" CC: "x86@kernel.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Thomas Gleixner , "Ingo Molnar" , Jaswinder Singh , "Andi Kleen" Subject: Re: [PATCH] Syscall arguments are unsigned long (full registers) Thread-Topic: [PATCH] Syscall arguments are unsigned long (full registers) Thread-Index: AQHR1iG2YP6J2ItZ706QvGoeaX+DHqAItL+A Date: Mon, 4 Jul 2016 20:13:21 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.166.131] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 4 Jul 2016, at 20:27, H. Peter Anvin wrote: > > On July 4, 2016 6:52:58 AM PDT, "Tautschnig, Michael" wrote: >> All syscall arguments are passed in as types of the same byte size as >> unsigned long (width of full registers). Using a smaller type without a >> cast may result in losing bits of information. In all other instances >> apart from the ones fixed by the patch the code explicitly introduces >> type casts (using, e.g., SYSCALL_DEFINE1). >> >> While goto-cc reported these problems at build time, it is noteworthy >> that the calling conventions specified in the System V AMD64 ABI do >> ensure that parameters 1-6 are passed via registers, thus there is no >> implied risk of misaligned stack access. >> >> [...] > > Wrong. Syscall arguments aren't necessarily full registers, and on x86 truncation is already done by the callee, so we don't need any special handing. Some other architectures have other constraints. Ok - I'm assuming I have thus misunderstood eb974c62565072e10c1422eb3205f5b611dd99a1 ? Supposedly all those SYSCALL_DEFINEx are required for other architectures only? Best, Michael