Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbcDRAp1 (ORCPT ); Sun, 17 Apr 2016 20:45:27 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:45293 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbcDRAp0 (ORCPT ); Sun, 17 Apr 2016 20:45:26 -0400 Message-ID: <1460940317.9121.56.camel@decadent.org.uk> Subject: Re: System call number masking From: Ben Hutchings To: Andy Lutomirski Cc: Andy Lutomirski , X86 ML , LKML Date: Mon, 18 Apr 2016 01:45:17 +0100 In-Reply-To: References: <1460654550.4560.9.camel@decadent.org.uk> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-kIHOqOkeNr5N/0Bz/LY0" X-Mailer: Evolution 3.18.5.1-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2070 Lines: 54 --=-kIHOqOkeNr5N/0Bz/LY0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-04-14 at 10:48 -0700, Andy Lutomirski wrote: > On Thu, Apr 14, 2016 at 10:22 AM, Ben Hutchings wro= te: > >=20 > > I'm updating my x32-as-boot-time-option patch for 4.6, and I noticed a > > subtle change in system call number masking on x86_64 as a result of > > moving the slow path into C. > >=20 > > Previously we would mask out the upper 32 bits before doing anything > > with the system call number, both on the slow and fast paths, if and > > only if x32 was enabled. > I always thought that the old behavior was nonsensical.=C2=A0=C2=A0The be= havior > should be the same regardless of config options. [...] Oops, my C is failing me - ints are sign-extended, not zero-extended, when promoted to unsigned long. =C2=A0So the slow path actually does test the upper 32 bits, and the odd one out is the x32 fast path. Ben. --=20 Ben Hutchings Always try to do things in chronological order; it's less confusing that way. --=-kIHOqOkeNr5N/0Bz/LY0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJXFC4dAAoJEOe/yOyVhhEJzOEP/RRyfvrW2DCWvzWswuB3awyF GKNub51sGVhajqXsrplv/MYfP49g8HRu4XySP2iGlHW7tVsyhbB8XqWV+QwhmT0G PsdG+m5xS0yVCXgQKYaBoGp09Ca/I+dJZ3iCZ3An/XRmpQ/jm7KZOgTDtn+GnnJh 2fA0AjSPPu6c3HaG2LaYcdZA7UHwJOuQ2MmPDx6FZar8MBBgcmH1d3/qbKi7X6Wm X5cRme0I2xg7q0D2Jbm93pi5cXxOhoUXkaHpegNZUzlKOwvgKkPGWEudTibT1Pil Es3+iwjKkeJjrjYHXaO31TukPpCx09sDpyhMmUJ9H4IpiyFisn4CDoEhqxjl/elK VxZMyRM/56Z2hVj0//8RJEYjEMQOtWTLYgOuKKQhYjxBW2GyVtK8PNHgJBwMeL94 QNBLe+4BraG6mpRcQ3ZjTEcl4thDLEvpMbsGKPAtf+kFVAxs+8dE+Wa7OfvpNheW CclNxiOedyR/tR/G3bnWes7MPOkXJJImTsHEZw3zVzia6+BCtPwJ3kIR3l7sIop+ sPWxhBbbAu+x6oSGu4vN1Y5cPlzS+G5BJ66XiCn/2OrwatrLhUJbtaFtW4eoFuga iLntOF0C3xYvKchHWUjG74TF0FcRms8zOpw9yhgUjQPJM3Vb4m4e7RVfxz+e6XuY yzWQpEkKbIVt6o0gy4di =Nvtn -----END PGP SIGNATURE----- --=-kIHOqOkeNr5N/0Bz/LY0--