Received: by 10.213.65.68 with SMTP id h4csp1064682imn; Thu, 22 Mar 2018 14:31:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELtgMdqMELYHzl17AxemavutY8PZvRLMW01UGLnUm1SA0MwyT5K+Vh2XsJLkv0c98+dfAaUH X-Received: by 2002:a17:902:2943:: with SMTP id g61-v6mr4284408plb.238.1521754293608; Thu, 22 Mar 2018 14:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521754293; cv=none; d=google.com; s=arc-20160816; b=yqKjG0ngD2JfmA2gRDQiHjBDK1NfB0xWGarMP/3kKeRJCmFauZoErIbWr7Bz7RRUHF kIxQzm6ztpGzIbA7tVbKX1ls5W+0FGHtJm0qa/Eis23HyerCs+FWnC33wj1+hsKJaYLD 5O29azx18JChD03m7Ara6q9ttqvEnfFx9/NIKqzkVQLuodvm3+OJte89bdfG7/+aV5DV auT1SmgrZhPoBBfYvL8498P8O250jPcEfe09btD5vdGVNIPC9QFXuwusWgAlDxDe2HVh xz1ZiH19ofMpp1gDxQgngY8/Mu1x6AZHTf52XBUZz43cIRdX4zElCT33Or7HkdKEP5Lb 7r6Q== 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=+IohVDiTt64+EPVw3X2mVF4lEKjCgnP9W399X3SWUC0=; b=RjnROrUUqTQMtZrB35u5Uvhas5YwYqueArN9Lm94anXfDiHobPoDTslyCWzD1+PA9w q2g1vyj3a45HgthFu0wuQlOGGNBeA7DxEbnqqNoVbufbf8L13VVrzJGJ0w8DF2jO3iYF XXVPl3Eed6vwyNg3H4SPjU8VCD6v2tjRG3arsZJ0ZVps5MyIkE2CA4k64sO/QVymfU5l Ad8/ZpBZ5Wgyw5o8c8m0EpbqMtflpNWRAoQTAMvZRs3gOGufuP8l9kL095flaAvs2YGu MV36/qlm7Y3leZsXyVJPiIrpNPke/46tSFczHwEo3y6ZVRRf4QNp4z08HwcK/BfZyy5g sj+g== 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 i2si4860417pgq.40.2018.03.22.14.31.18; Thu, 22 Mar 2018 14:31:33 -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 S1751915AbeCVV23 (ORCPT + 99 others); Thu, 22 Mar 2018 17:28:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbeCVV22 (ORCPT ); Thu, 22 Mar 2018 17:28:28 -0400 Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (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 AF6272183D for ; Thu, 22 Mar 2018 21:28:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF6272183D 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-it0-f53.google.com with SMTP id z7-v6so3236742iti.1 for ; Thu, 22 Mar 2018 14:28:27 -0700 (PDT) X-Gm-Message-State: AElRT7Hta2XDSpxE0x0ZutvMXBlw5ra13+Bdf3dmFdgs+ksRNAcolnZI ubIZafZkmbJHv6eQ/RZc3hqk7OCImIcUgXYvncdkNA== X-Received: by 2002:a24:c281:: with SMTP id i123-v6mr8707893itg.146.1521754107094; Thu, 22 Mar 2018 14:28:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.137.70 with HTTP; Thu, 22 Mar 2018 14:28:06 -0700 (PDT) In-Reply-To: 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 21:28:06 +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 9:17 PM, Bae, Chang Seok wrote: > > ________________________________________ > From: Andy Lutomirski [luto@kernel.org] > Sent: Thursday, March 22, 2018 09:53 >>>> But your patch doesn't actually do this, since gdb will just do >>>> SETREGS anyway, right? >>> GDB does SETREGS on any exclusive (FS/GS) updates in inferior call. > >> This means that your patch has exactly the same effect as the code in >> my git tree, right? Then let's stick with something like what's in my >> git tree, since it's far simpler. > > Difference is if flipping FS/GS multiple times, user may check the base from LDT. > But I don't have strong will to keep arguing this; Markus or somebody might > want to say something. > > The whole point as I understand is to avoid any regression on legacy ptracers. > If a strong confidence lies on the simple version, let me. My first thought bought > this in fact. I agree that we want to avoid regressions, but you seem to have discovered that basically all ptracers() use SETREGS. Your patch behaves the same as the simple patch if SETREGS is used. > > Thanks, > Chang