Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp661905pxk; Thu, 3 Sep 2020 09:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhiYffFQlyPQmDnaasV3Wqna+Lil+ZzgS4h6kePRYEG15bbBWYd2uiJuMz/Q3YSPOH1Eop X-Received: by 2002:a17:906:eced:: with SMTP id qt13mr2884211ejb.357.1599150245324; Thu, 03 Sep 2020 09:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599150245; cv=none; d=google.com; s=arc-20160816; b=VOcX9cuqm+bxJCyQA1Z/T0lrvpR0DKK6tQVgjIOCdOS/GHOOb4adPcWxJnSRy5e+iq GJ0KfXBJgIU/ByIEQSu8QF/CsO9I6oKCYCMMyReYY0JYWUdrUgJ4syRI2m7ICQDNNY6J JiXDvUtExY5Cpldsbh1VaccdUsb37Dnruu8P6iPQMpUY12uNQ8DO0lW7D5mw7lYXfBSK HCIWzLluGE3VgbBv5MQKXY+/lLkpgeYnE5ZRw+t54oaETRDhJ9bprBrT77iHlxBkow34 qjqag2f6jIgDzhVndx/y4uQgEn8fClcWUHPr9LOzzR2W6bwAPo3pkBDJECGPT80KfFUl zsVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=IfI8tqyZXNLtZWINEmgVGL3LOlkLvPG81gAXaeNqO+A=; b=n1SgYvW1uSet/vZxe0gzZC1Iu0ZkHS7iNG3a0n5V0NjIpwg+Jdo0CDsSjSbOJ4RIlQ zDZ9F6LhEMod10rvmz0jOS17YXxcevtot4Q4yyuSmU7TmelL3RCQOg1ahLO8gBehf0nV wKdErAzh5M0AacoR2dfEp/S9sTN9/eYpaK/02mSP7soHW1PkpKMOz7D9w0X/kj5621WV 6+tj5n+ogT+PJt0AeWHeH+LPlOgfZuY5CMRvhBBCOM2Zl3SzVefsfOGYDVqm0zRY9vFQ T0miJJCqL5sJZf99XoFUV8vtkdqu8YQJdLiCi/kZp5ORitsc9cuXwavRnH8vOaI5eDkZ NfCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o62si1937353edd.494.2020.09.03.09.23.42; Thu, 03 Sep 2020 09:24:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728454AbgICQVT (ORCPT + 99 others); Thu, 3 Sep 2020 12:21:19 -0400 Received: from mga02.intel.com ([134.134.136.20]:3943 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbgICQVR (ORCPT ); Thu, 3 Sep 2020 12:21:17 -0400 IronPort-SDR: SBu/OVMwEM4iqnI+P+Z0V5LKrshiHqNKrOA6f07eDzqW9DMm2LlRL+0fKRLJjsGWWS4S/fswi/ 4XwYE9x7PqGQ== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145348301" X-IronPort-AV: E=Sophos;i="5.76,387,1592895600"; d="scan'208";a="145348301" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2020 09:21:15 -0700 IronPort-SDR: +Pe0zUpW7n8ydj/YOVTaKR79uc3vTuh90uRyD5Hw3BPUUqT/NnJucVFtliTUbdOkPMAUiK4O9f Kyp5qF3qstzg== X-IronPort-AV: E=Sophos;i="5.76,387,1592895600"; d="scan'208";a="503120164" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.209.173.133]) ([10.209.173.133]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2020 09:21:11 -0700 Subject: Re: [PATCH v11 6/9] x86/cet: Add PTRACE interface for CET To: Dave Hansen , Andy Lutomirski Cc: Jann Horn , the arch/x86 maintainers , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , kernel list , linux-doc@vger.kernel.org, Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang References: <46e42e5e-0bca-5f3f-efc9-5ab15827cc0b@intel.com> <40BC093A-F430-4DCC-8DC0-2BA90A6FC3FA@amacapital.net> <88261152-2de1-fe8d-7ab0-acb108e97e04@intel.com> <1b51d89c-c7de-2032-df23-e138d1369ffa@intel.com> From: "Yu, Yu-cheng" Message-ID: <3967f126-f7ea-36fd-bec0-dfbbc46ef221@intel.com> Date: Thu, 3 Sep 2020 09:21:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <1b51d89c-c7de-2032-df23-e138d1369ffa@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/3/2020 9:11 AM, Dave Hansen wrote: > On 9/3/20 9:09 AM, Yu, Yu-cheng wrote: >> If the debugger is going to write an MSR, only in the third case would >> this make a slight sense.  For example, if the system has CET enabled, >> but the task does not have CET enabled, and GDB is writing to a CET MSR. >>  But still, this is strange to me. > > If this is strange, then why do we even _implement_ writes? > For example, if the task has CET enabled, and it is in a control protection fault, the debugger can clear the task's IBT state, or unwind the shadow stack, etc. But if the task does not have CET enabled (its CET MSRs are in INIT state), it would make sense for the PTRACE call to return failure than doing something else, right?