Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754666AbbHLKHh (ORCPT ); Wed, 12 Aug 2015 06:07:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:57480 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754290AbbHLKHg (ORCPT ); Wed, 12 Aug 2015 06:07:36 -0400 Date: Wed, 12 Aug 2015 12:07:38 +0200 From: Borislav Petkov To: yalin wang Cc: Thomas Gleixner , mingo@redhat.com, hpa@zytor.com, x86@kernel.org, bp@suse.de, open list , Will Deacon Subject: Re: [x86] copy_from{to}_user question Message-ID: <20150812100738.GA14020@nazgul.tnic> References: <7FD389F5-C677-4439-8082-EB0CAE2814F6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7FD389F5-C677-4439-8082-EB0CAE2814F6@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1250 Lines: 34 On Wed, Aug 12, 2015 at 05:01:14PM +0800, yalin wang wrote: > hi x86 maintainers, > > i have a question about copy_from{to}_user() function, > i find on other platforms like arm/ arm64 /hexagon, > all copy_from{to}_user function only check source address for > copy_from and only check to address for copy_to user function, > never check both source and dest together, > > but on x86 platform, i see copy_from{to}_user use a generic function > named copy_user_generic_unrolled() in arch/x86/lib/copy_user_64.S, That one is the fallback and used only on machines which don't set X86_FEATURE_REP_GOOD or X86_FEATURE_ERMS. Basically old P4 and K7 and early K8s. > it check source and dest address no matter it is copy_from user or > copy_to_user , is it correct? > for copy_from_user i think only need check source address is enough, How else would we be able to use the same function in copy_to and copy_from variants? -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/