Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4337573imm; Mon, 30 Jul 2018 12:45:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcIhZq4h7ZoKNVoMr5xasLPMg4HnxzWZYPRq3rfSG1rz3Kc2NX4Fd7H9wXhrJ6TN61R9Hy6 X-Received: by 2002:a62:98d6:: with SMTP id d83-v6mr19386959pfk.186.1532979920578; Mon, 30 Jul 2018 12:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532979920; cv=none; d=google.com; s=arc-20160816; b=gOFcoE/uwcTpe8jjS+p7TpiE0DZxnflcqdg9XB40Emif3OVeBHWEBuPofh42ccBJkX 9/7Mj+w2c+XP3fjgYFx1qXe3DJlRA4nLgTCgfqj24yR48dnTCDKaMAp366tV33DKDihe RTDfTkP9/CH2PDkVYOdX85fK8nid+5B7jckpCdNPv2HRjAb0KkVTaTqT66EhbRWakjmH s1xJBPoFyzITM1/DOdKJLX1Vt1LaWl75AwOLaoOblztBTwQDKBbwcEqEnjhuHwpgo3P3 mDqef14KDpHPoGapixfWUavlz+02JS1tUJV3w6wXoeg9hjqg/NRRk02cxbTmPXVdvgvI ZFQQ== 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:arc-authentication-results; bh=WalWassM/M1p1dKVOh2JFRTjwWEZLwNYPo+rN3WIQMI=; b=K/UO0f552efyr/k9ruuLDDoEx/6Uf92HUrqZdYkCe5KdPvWQrRGWK8unu6cB91g/ET TtBvZaBSOkLtgKT3t/48k58Xn0t/EOx7pYghr8Y/n1n0hZCKNbtzn8bDdtX71yAImEZL lGn4ueTcmn0bR3//q4U/0LNbHq35LHvaGf//awup7fcByqGtA8UMcYwflozxicj55QrQ zCWhrqXIQJfMbVJutjEmpBdAFVB7A5JykCxL6DdX7V9FGyUHR2cs7LO8Jalvm8IpVcHK ER6n9CGMtpCJg8vugOtHRuycegLxnwgp37WvW0UvDxSD+X1yTMO6B405I9p7T4APYCIF 1GvA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24-v6si10199910pgv.527.2018.07.30.12.45.06; Mon, 30 Jul 2018 12:45:20 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732079AbeG3VUp (ORCPT + 99 others); Mon, 30 Jul 2018 17:20:45 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:39262 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbeG3VUp (ORCPT ); Mon, 30 Jul 2018 17:20:45 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1fkE4Y-0004RM-1Y; Mon, 30 Jul 2018 21:43:14 +0200 Date: Mon, 30 Jul 2018 21:43:14 +0200 From: Florian Westphal To: Dmitry Safonov Cc: David Miller , nharold@google.com, fw@strlen.de, steffen.klassert@secunet.com, linux-kernel@vger.kernel.org, herbert@gondor.apana.org.au, 0x7f454c46@gmail.com, netdev@vger.kernel.org, luto@kernel.org, ard.biesheuvel@linaro.org, hpa@zytor.com, mingo@redhat.com, john.stultz@linaro.org, kirill.shutemov@linux.intel.com, oleg@redhat.com, sboyd@kernel.org, rostedt@goodmis.org, tglx@linutronix.de, x86@kernel.org, linux-efi@vger.kernel.org, akpm@linux-foundation.org, gregkh@linuxfoundation.org, mchehab+samsung@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, eparis@redhat.com, kadlec@blackhole.kfki.hu, pablo@netfilter.org, paul@paul-moore.com, coreteam@netfilter.org, linux-audit@redhat.com, netfilter-devel@vger.kernel.org, fan.du@intel.com Subject: Re: [PATCH 00/18] xfrm: Add compat layer Message-ID: <20180730194314.ixzvniuvdfofvvpj@breakpoint.cc> References: <1532703111.2679.20.camel@arista.com> <1532795215.2679.27.camel@arista.com> <20180728.141812.1026007723536955024.davem@davemloft.net> <1532972360.2679.32.camel@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1532972360.2679.32.camel@arista.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dmitry Safonov wrote: > On Sat, 2018-07-28 at 14:18 -0700, David Miller wrote: > > From: Dmitry Safonov > > Date: Sat, 28 Jul 2018 17:26:55 +0100 > > > > > Well, I think, I'll rework my patches set according to critics and > > > separate compat xfrm layer. I've already a selftest to check that > > 32/64 > > > bit xfrm works - so the most time-taking part is done. > > > > The way you've done the compat structures using __packed is only > > going > > to work on x86, just FYI. > > Thanks for pointing, so I'll probably cover it under something like > HAS_COMPAT_XFRM. > (if there isn't any better idea). You can do that, I suspect you can use CONFIG_COMPAT_FOR_U64_ALIGNMENT as AFAICR the only reason for the compat problem is different alignment requirements of 64bit integer types in the structs, not e.g. due to "long" size differences. Instead of __packed, you can use the "compat" data types, e.g. compat_u64 instead of u64: struct compat_xfrm_lifetime_cur { compat_u64 bytes, packets, add_time, use_time; }; /* same size on i386, but only 4 byte alignment required even on x86_64*/ You might be able to reuse https://git.breakpoint.cc/cgit/fw/net-next.git/commit/?h=xfrm_config_compat_07&id=f64430e6d9e297f3990f485a4832e273751b9869 in your patch set. I can try to submit the first few patches (which are not related to compat, they just add const qualifiers) for inclusion later this week.