From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751841AbeCVQIR (ORCPT ); Thu, 22 Mar 2018 12:08:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:48952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbeCVQIP (ORCPT ); Thu, 22 Mar 2018 12:08:15 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE7E42183E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org X-Google-Smtp-Source: AG47ELv5LTreVZqYke2oFu/Om2XXn0RHL/t4f5+5vwHyVypSEEIGI/yubftGUZ1Y7taiUayTFeSkoM0ggIkbE5muTZM= MIME-Version: 1.0 In-Reply-To: <9C732DC6-F9CA-474F-B8F5-F8EBE406B12E@intel.com> References: <1521481767-22113-1-git-send-email-chang.seok.bae@intel.com> <1521481767-22113-15-git-send-email-chang.seok.bae@intel.com> <9C732DC6-F9CA-474F-B8F5-F8EBE406B12E@intel.com> From: Andy Lutomirski Date: Thu, 22 Mar 2018 16:07:53 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 14/15] x86/fsgsbase/64: Support legacy behavior when FS/GS updated by ptracer To: "Bae, Chang Seok" Cc: Andy Lutomirski , X86 ML , Andi Kleen , "H. Peter Anvin" , "Metzger, Markus T" , "Luck, Tony" , "Shankar, Ravi V" , LKML 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 Thu, Mar 22, 2018 at 3:45 PM, Bae, Chang Seok wrote: > On 3/21/18, 18:41, "Andy Lutomirski" wrote: >> mov to gs changes GSBASE even if GS was unchanged. > In GDB, ptrace (syscall) doesn't happen when FS/GS unchanged as > its (context) cache seems to be first checked. This does not allow to > preserve GSBASE as you know. > >> But it's not clear to me that you've identified any case where >> emulating this behavior is useful. > One argument I heard is (if debugging a legacy application) user > might want to (indirectly) access LDT during inferior call and this > mov to fs/gs has been useful (maybe needed). > > But your patch doesn't actually do this, since gdb will just do SETREGS anyway, right?