From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933787Ab3BLSq1 (ORCPT ); Tue, 12 Feb 2013 13:46:27 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:37946 "EHLO mail-ea0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933742Ab3BLSq0 (ORCPT ); Tue, 12 Feb 2013 13:46:26 -0500 MIME-Version: 1.0 In-Reply-To: <511A8922.6050908@zytor.com> References: <20130209110031.GA17833@n2100.arm.linux.org.uk> <5119C34B.70207@zytor.com> <511A7892.4020407@zytor.com> <511A8922.6050908@zytor.com> From: Linus Torvalds Date: Tue, 12 Feb 2013 10:46:04 -0800 X-Google-Sender-Auth: URMlB_OYjh0OEVrKzxA__ut76-I Message-ID: Subject: Re: [tip:x86/mm] x86, mm: Use a bitfield to mask nuisance get_user() warnings To: "H. Peter Anvin" Cc: "H.J. Lu" , Ingo Molnar , Linux Kernel Mailing List , Jamie Lokier , ville.syrjala@linux.intel.com, Borislav Petkov , Russell King - ARM Linux , Thomas Gleixner , linux-tip-commits@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 12, 2013 at 10:25 AM, H. Peter Anvin wrote: > I just thought up this variant, I'm about to test it, but H.J., do you > see any problems with it? Looks good to me. And we already use __builtin_choose_expr(), so it's "portable". And it should avoid all the potential issues with bitfields (rmk already pointed out how bitfields don't work well with the ARM model, who knows what other pitfalls bitfield code generation could have) I wonder if we could/should eventually do some of the sizeof() in generic code - not have these magic things duplicated in all the architectures, just have the architectures specify the raw typed details (__copy_to_user_4() etc). So cross-platform portability could be a good thing. That's a separate discussion, though, and possibly not worth it. Linus