Received: by 10.213.65.68 with SMTP id h4csp816129imn; Thu, 22 Mar 2018 09:09:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELtij8lZkpJ5MzV00GTS3Yvrx2BPqbPeM/RnMU4rl9Ah6lh/C91AK5fDfznr4G0SGXlNHzcG X-Received: by 10.167.130.88 with SMTP id e24mr21055288pfn.66.1521734979476; Thu, 22 Mar 2018 09:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521734979; cv=none; d=google.com; s=arc-20160816; b=g9bGX5k2SWxqogoj2Kk4IoW48qt7GJlmEkQnVbG/q7gld9V3V6GjXd6+bNpRS+L1Vg lfZArLgeKbTR9XS/jcVrUUSgn7tGkRZjfyvYOURq5vwH5zWlbaT78Vg6Zrm835mNSWd9 HaFwFmbAmbGby+mY796TSGlEIbQ/vwp7+iZ5MmTZAhz4sP6NVjYyBG1x7VEdgigSVEMK npt04uep3jng6vLAq5IJw6spnfmkmpxJ1s0o9MevARYwv3e1et7bPwjhU5TRnJWQoiQ1 9WEADLkcQWw6P2Ksy9AolmZErvEyOrXd+R2/PGLfNNz77B+dwN89HhYUHFyiMrtRUs6W PgrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=WkCdWimEfKql5bh5TiJ6LNAWRLfOQi2IyNE+I0IS3jo=; b=Aij2pkJxP8lOITC2HmkoBtOOHGe9bLAdhJoTM0PX0cPi0wbaKAnhQLHPLXNi/1R/yZ lscQfRk5Hih/EMHedHiLslkCpGfxeH4aOo3Z3MDkXnMHIva1JmBNM0WVbOevDuD0QUmH kAnK/T7MGcTAa92OrT8uaFKO/ekGzrerQytbysWVhccpOpcGsdf+WoJG/Pv+0Zboqny0 Ew6/sMst6u8Bw06NTNu5tDInjLWtOrNTyjaQc5193pXgfd/TVAbxPKPrGV6rDB2oQc+J FYLwh3BOQhKfPoiFAWcqxIikgRBnZWDqk3fIxiuEPj8MwN6jB9Xu07MXqqPf+1J/ws8Q 73gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5-v6si6324409plp.20.2018.03.22.09.09.24; Thu, 22 Mar 2018 09:09:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751839AbeCVQIR (ORCPT + 99 others); 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 Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE7E42183E for ; Thu, 22 Mar 2018 16:08:14 +0000 (UTC) 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 Received: by mail-io0-f178.google.com with SMTP id v13so11598908iob.6 for ; Thu, 22 Mar 2018 09:08:14 -0700 (PDT) X-Gm-Message-State: AElRT7EVaWHuJN001Q4pvTk+52Q7m39UC/B8VwuysTv8BViiKhWgg4Mz isRq+3dmxYM3aWRB7auQSL+3VMz0kk2kfySEgbHoUA== X-Received: by 10.107.40.73 with SMTP id o70mr25768078ioo.6.1521734894339; Thu, 22 Mar 2018 09:08:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.137.70 with HTTP; Thu, 22 Mar 2018 09:07:53 -0700 (PDT) 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 Precedence: bulk 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?