From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2706 invoked by alias); 4 Apr 2012 20:57:12 -0000 Received: (qmail 2698 invoked by uid 22791); 4 Apr 2012 20:57:11 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_CP,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Apr 2012 20:56:58 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q34Kuweh022696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 4 Apr 2012 16:56:58 -0400 Received: from t510.usersys.redhat.com (vpn-8-153.rdu.redhat.com [10.11.8.153]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q34Kuulb009918 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 4 Apr 2012 16:56:57 -0400 Message-ID: <4F7CB598.4000704@redhat.com> Date: Wed, 04 Apr 2012 20:57:00 -0000 From: David Smith User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: William Cohen CC: systemtap@sourceware.org Subject: Re: Improve build-id checking when the task we're interested in isn't 'current'. git commit causing problems on ARM and IA64) References: <4F76225B.8010600@redhat.com> <4F79FE43.9010902@redhat.com> <4F7A091E.6040208@redhat.com> <4F7A23DB.5000800@redhat.com> In-Reply-To: <4F7A23DB.5000800@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2012-q2/txt/msg00013.txt.bz2 On 04/02/2012 05:10 PM, David Smith wrote: > On 04/02/2012 03:16 PM, William Cohen wrote: (stuff from Will deleted that describes a problem on IA64/ARM where some new code I added that calls our __access_process_vm() comes up with an undefined symbol) Here's some more background and context here. The kernel has _acesss_process_vm() but it isn't exported. So, we have an internal copy called __access_process_vm(). We also have a variant, called __access_process_vm_noflush(), that doesn't flush the instruction cache. This variant isn't present upstream. Our __access_process_vm() calls copy_from_user_page() and copy_to_use_page() to do the actual reading/writing. There is a default definition of those functions present in include/asm-generic/cacheflush.h that looks like this: ==== .... #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) .... #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ do { \ memcpy(dst, src, len); \ flush_icache_user_range(vma, page, vaddr, len); \ } while (0) #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ memcpy(dst, src, len) ==== So, copy_to_user_page()/copy_from_user_page() boil down to just memcpy(). Here's how each arch we're interested in handles copy_to_user_page()/copy_from_user_page() in the current upstream kernel source. - x86, x86_64: Just uses the default. - s390x: Just uses the default. - ia64: flush_icache_user_range() is a define that calls flush_icache_range(), which isn't exported - mips: has unexported copy_to_user_page()/copy_from_user_page() functions - arm: copy_from_user_page() is just #defined to be memcpy(). copy_to_user_page() is an unexported function So, we've got problems on ia64, mips, and arm. Note that I'm a bit worried that __access_process_vm_noflush() isn't quite right on mips, since it doesn't call its arch specific copy_from_user_page() (all other arches just use memcpy to read). But, the mips arch-specific copy_from_user_page() isn't exported. We'd someone who understands mips details to look at the internals of copy_from_user_page() to know if the differences are important. So, that's the status of __access_process_vm() on all the arches that systemtap runs on. However... I realized while looking at this (prompted by Will) that the build-id checking code is only reading user memory, not writing it. When reading user memory, __access_process_vm() and __access_process_vm_noflush() are fairly equivalent. So, I've switch the build-id checking code to use __access_process_vm_noflush() (commit f1410a8). This should hopefully fix ia64, mips, and arm on current kernels. Will, if this doesn't fix ARM, let me know. -- David Smith dsmith@redhat.com Red Hat http://www.redhat.com 256.217.0141 (direct) 256.837.0057 (fax)