From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756085AbcBVWwV (ORCPT ); Mon, 22 Feb 2016 17:52:21 -0500 Received: from mga02.intel.com ([134.134.136.20]:2308 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199AbcBVWwU (ORCPT ); Mon, 22 Feb 2016 17:52:20 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,486,1449561600"; d="scan'208";a="52751968" Date: Mon, 22 Feb 2016 14:50:00 -0800 From: Yu-cheng Yu To: Andy Lutomirski Cc: X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "linux-kernel@vger.kernel.org" , Dave Hansen , Andy Lutomirski , Borislav Petkov , Sai Praneeth Prakhya , "Ravi V. Shankar" , Fenghua Yu Subject: Re: [PATCH 08/10] x86/xsaves: Fix PTRACE frames for XSAVES Message-ID: <20160222225000.GA4259@test-lenovo> References: <1456167621-3974-1-git-send-email-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22, 2016 at 02:45:54PM -0800, Andy Lutomirski wrote: > > +/* > > + * Convert from kernel XSAVES compacted format to standard format and copy > > + * to a ptrace buffer. It supports partial copy but pos always starts from > > + * zero. This is called from xstateregs_get() and there we check the cpu > > + * has XSAVES. > > + */ > > +int copyout_from_xsaves(unsigned int pos, unsigned int count, void *kbuf, > > + void __user *ubuf, const struct xregs_state *xsave) > > Now that you've written this code, can it be shared with the signal > handling code? > For signal handling, we most likely save registers directly to memory. But for ptrace, the thread being debugged is not the active thread. Please let me think about it more. --Yu-cheng