Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp301376imm; Thu, 21 Jun 2018 19:01:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLWRdKLzSBHP0cTNEHIatbQEYq31QvS01vW+LrmW+QZPGp29AmHD9xpFsN558ki/ZqNxnOl X-Received: by 2002:a17:902:e3:: with SMTP id a90-v6mr31354253pla.227.1529632890060; Thu, 21 Jun 2018 19:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529632890; cv=none; d=google.com; s=arc-20160816; b=kqXWApV8I3tnVxQJryvkviTHiMYeatyxyyc1g5HbIEF2gTGkgTPSoCbyQGytBBKtJB 4qLfVkb/XX9WFc+SHTsasfCYO/1C3WZaAWOF18nWcPx/XRQwx0Akgfrn11Z0DWqhZNNp FO2+GG3V1E+lCaOwxctY0temtPsDv1gOjCIKW2lO1M2kEwY2afzXWyJ2mnIpS6kZQRiL WVlme6Rv9Mh47/pcfPABMYRtSVm/ZW7pKe0ka+2J4zT3t0y9264s5UCOFQhUU8/pGf7b QqbI0iERcVoY6qadqWo1bpi8ZOQ/IoPDi0c1ql2wdjpt9Uryem75tuKkjHFwJ+cByFCz 8SoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=iZGWmSsqob4UebOy5XsVOPy1aYICOQVGw4aRi5H71Wk=; b=zS3n5laoKweoOr7K42Mk2bQTE7HZGB/QkuHSV8x3w7w6VSdx+F0jxzRok4ze2ls4p3 PamycMsTMXG4frVyvayk+5SAxhiqrMl5ASwFqqgesh1NfejvfZdXoPRpzzNc00ha989H x73tc9pDFg7kxo65IF+hlyioOH0urhO68SQUWTWlvkCQytQmEUA8GYzcgzO4XtmzaE/H OEqY/yh0QRWVmmTQBTPpeDN4wx560dIvz7Qhr1E/V7M+w/wtLF/QziSk7t0OdSzN85Xp 7qonHU5nPVYffc2vt1x1cRCKBWWkdXyIFZ9qJepoON/xsI7IC16Y7dPcS0jRqDAprFcE UABA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hPdCwylE; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si6096096plb.27.2018.06.21.19.01.14; Thu, 21 Jun 2018 19:01:30 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hPdCwylE; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934328AbeFVB64 (ORCPT + 99 others); Thu, 21 Jun 2018 21:58:56 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53766 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934244AbeFVB6z (ORCPT ); Thu, 21 Jun 2018 21:58:55 -0400 Received: by mail-wm0-f66.google.com with SMTP id x6-v6so549646wmc.3 for ; Thu, 21 Jun 2018 18:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iZGWmSsqob4UebOy5XsVOPy1aYICOQVGw4aRi5H71Wk=; b=hPdCwylEJpBBmixeOrRDMmdhSaBLulordH55qYNyivSJC1O5WKPNxgTO0dqTjoI1KH /vqhOdu3qLA0C3yP/2/lsVp99FmPbB2rPnJkZItVQ4+WQSBrzxkJFn8iyJjgE6DBXbw0 lAvWY+kNnnQao5kjQRZskWUTE8C8GVRpN9CU+c+kA+kONGKQrpMOKPRuc6DaO0KYzhAl r11N/tvcFH+5wxt11zt1JefPm8E/FLaedjOCHNYJ7Bs1eqDn87iUtt+Jo95TScjRAuK/ JuuhyBvZ89K7cq3KdxlhYxvkeEqRCFI8Losfdqq9ir8FsZyPpfEVdex2hGVxtj7LFQzW IZjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=iZGWmSsqob4UebOy5XsVOPy1aYICOQVGw4aRi5H71Wk=; b=rNxnHiRHq8wzNr64V400CcH+AqKfErtuFV6lD7anQXHMgxxYuWAl08JEaTMr+b8/Ki opTbxWk8fxrsdMtIc61RTW2WiKDvA2uiivciQpauHBrsUG/U20/y0LBhPSk3t2yqdPMD HZDkItMn/KE+AaRgXuKqyH1kbdl/Y/kfOq+MJZNAKbDFa+qkiSjrtyqkaF4yE+dpJgsr audENg+ex6L3TbRQpyB1/tveOEgl5fLpSvVEVsI24kMFRAflmsEaTKazOa6d0SO7BhZN jToEfM+m6xv57H6VVml+5jpa7bFiQ68YDY3WMl74JbmNfbMvd7rfbgRQJJ4XNYCWxYf7 PVxA== X-Gm-Message-State: APt69E1KvUfAB6eYJkwB3vpH79gAF/aztbtMvBZMeDxr9C3rWRWK+1tU 7L5gqaOfX/gPmZkuLCaesp8= X-Received: by 2002:a1c:8893:: with SMTP id k141-v6mr13496wmd.133.1529632734135; Thu, 21 Jun 2018 18:58:54 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id d102-v6sm685057wma.10.2018.06.21.18.58.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jun 2018 18:58:53 -0700 (PDT) Date: Fri, 22 Jun 2018 03:58:51 +0200 From: Ingo Molnar To: "H. Peter Anvin, Intel" Cc: Linux Kernel Mailing List , "H. Peter Anvin" , Thomas Gleixner , Andy Lutomirski , "Chang S . Bae" , "Markus T . Metzger" , "H . Peter Anvin" , Linus Torvalds , Peter Zijlstra , Josh Poimboeuf Subject: Re: [PATCH v3 0/7] x86/ptrace: regset access to the GDT and LDT Message-ID: <20180622015851.GA10254@gmail.com> References: <20180621211754.12757-1-h.peter.anvin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180621211754.12757-1-h.peter.anvin@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * H. Peter Anvin, Intel wrote: > From: "H. Peter Anvin" > > Give a debugger access to the visible part of the GDT and LDT. This > allows a debugger to find out what a particular segment descriptor > corresponds to; e.g. if %cs is 16, 32, or 64 bits. > > v3: > Requalify LDT segments for selectors that have actually changed. > > v2: > Add missing change to elf.h for the very last patch. > > Cc: Ingo Molnar > Cc: Thomas Gleixner > Cc: Andy Lutomirski > Cc: Chang S. Bae > Cc: Markus T. Metzger > Cc: H. Peter Anvin > > arch/x86/Kconfig | 4 + > arch/x86/include/asm/desc.h | 24 +++- > arch/x86/include/asm/ldt.h | 16 +++ > arch/x86/include/asm/segment.h | 10 ++ > arch/x86/kernel/Makefile | 3 +- > arch/x86/kernel/ldt.c | 283 ++++++++++++++++++++++++++++++++--------- > arch/x86/kernel/ptrace.c | 103 ++++++++++++++- > arch/x86/kernel/tls.c | 102 +++++---------- > arch/x86/kernel/tls.h | 8 +- > include/uapi/linux/elf.h | 2 + > 10 files changed, 413 insertions(+), 142 deletions(-) Ok, this looks mostly good to me at a quick glance, but could you please do one more iteration and more explicitly describe where you change/extend existing ABIs? I.e. instead of a terse and somewhat vague summary: > x86/tls,ptrace: provide regset access to the GDT > > Give a debugger access to the visible part of the GDT and LDT. This > allows a debugger to find out what a particular segment descriptor > corresponds to; e.g. if %cs is 16, 32, or 64 bits. Please make it really explicit how the ABI is affected, both in the title and in the description, and also _explain_ how this helps us over what we had before, plus also list limitations of the new ABI. I.e. something like: x86/tls, ptrace: Extend the ptrace ABI with the new REGSET_GDT method Add the new REGSET_GDT ptrace variant to PTRACE_{GET|SET}REGSET, to give read and write access to the GDT: - Previously only certain parts of the GDT were visible, and only via random ABIs and instructions - there was no architectured access to all of it. - The SETREGSET variant is only allowed to change the TLS area of the GDT. (or so.) This is important not just for documentation and library support purposes, but also to be able to review it properly, to match 'intent' to 'implementation'. (It might also help later on in finding bugs/quirks, if any.) Please do this for all patches in the series that change the ABI. Thanks, Ingo