Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3402443ybi; Mon, 10 Jun 2019 09:38:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFZf3IG6mALPDxZ8cRU/z/A5yl/3TY/AyItIq9zcICtvk0N3iX94hNU1nOZWCu/nW3otiT X-Received: by 2002:a63:d218:: with SMTP id a24mr9083412pgg.419.1560184719625; Mon, 10 Jun 2019 09:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560184719; cv=none; d=google.com; s=arc-20160816; b=WPSlMF/5vo7+nGjiYmwK7xMTNQ3fWe27JHoGrSrCNd5jt2XZa/OHe81WTbVUF5oXg/ MD88nnPK/PlN7cGuL6S4z/N8lZ1v/DxjBKT5hBna8k5VNctZYaWQJ+l5SfkDRwjJ5z4G o17BQFt8JlJF/QRSdivhKaFGFwMMHycV6z68T2gHCWhLBCtrLnl0cH6VL8i7HXgPyGAf X8C8dmxkh5WwwypjgW1NwmT9VYAz9BFXEGgCJmXFTUsIBcQ3BveKPZYa/dvw0Nia+5Ie k+rQEArYCh9nf9cJDi86j2r9+R8HOMUw7cFOHG/WRek+E8vmrVoJMK9N2lC0UDfL0Le0 34RQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=7FynTzfNS8wGbP6wCU8qyDZECZ9kJrnfMNsGD1nf+r8=; b=r/9GwRgEFP6wrmd1w3kb9wTEW0pRsL1qEDgJ46J6O/Abg2gWQNklipQ2fQHW+dZ4lk FySr32gSgP/V2Dt8gxQMmJWR21iJ0XUM60Ze0cPIIUhFQVAWJC8l7lJbKw20rSW28ZUS BA93WWebGtf/Ja1q4zQ90ZgmZD8JtkEJgVRo+sJktWrvtS0U67+Gy0QNXUbSpTmkVW9o kgalQQZrl3havOHbjU+EPS0yqZYJQw4NFyISuvfyt0f0BTpbIDdI1mzMTzhFbpVRnqgH ExlH5LyqACLqt1KSVIrfDbv6Q/iENTkWGzBnS08egEQvV3lRWkD75N2Zez/VUbab3+ho VVbA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21si10297296pln.204.2019.06.10.09.38.24; Mon, 10 Jun 2019 09:38: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391476AbfFJQLM (ORCPT + 99 others); Mon, 10 Jun 2019 12:11:12 -0400 Received: from mga04.intel.com ([192.55.52.120]:21107 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389178AbfFJQLL (ORCPT ); Mon, 10 Jun 2019 12:11:11 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 09:11:11 -0700 X-ExtLoop1: 1 Received: from yyu32-desk1.sc.intel.com ([143.183.136.147]) by fmsmga001.fm.intel.com with ESMTP; 10 Jun 2019 09:11:11 -0700 Message-ID: Subject: Re: [PATCH v7 03/14] x86/cet/ibt: Add IBT legacy code bitmap setup function From: Yu-cheng Yu To: Andy Lutomirski , Dave Hansen Cc: Peter Zijlstra , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Date: Mon, 10 Jun 2019 09:03:04 -0700 In-Reply-To: <4F7D0C3C-F239-4B67-BB05-31350F809293@amacapital.net> References: <20190606200926.4029-1-yu-cheng.yu@intel.com> <20190606200926.4029-4-yu-cheng.yu@intel.com> <20190607080832.GT3419@hirez.programming.kicks-ass.net> <20190607174336.GM3436@hirez.programming.kicks-ass.net> <34E0D316-552A-401C-ABAA-5584B5BC98C5@amacapital.net> <7e0b97bf1fbe6ff20653a8e4e147c6285cc5552d.camel@intel.com> <4b448cde-ee4e-1c95-0f7f-4fe694be7db6@intel.com> <0e505563f7dae3849b57fb327f578f41b760b6f7.camel@intel.com> <4F7D0C3C-F239-4B67-BB05-31350F809293@amacapital.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-06-07 at 15:27 -0700, Andy Lutomirski wrote: > > On Jun 7, 2019, at 2:09 PM, Dave Hansen wrote: > > > > On 6/7/19 1:06 PM, Yu-cheng Yu wrote: > > > > Huh, how does glibc know about all possible past and future legacy code > > > > in the application? > > > > > > When dlopen() gets a legacy binary and the policy allows that, it will > > > manage > > > the bitmap: > > > > > > If a bitmap has not been created, create one. > > > Set bits for the legacy code being loaded. > > > > I was thinking about code that doesn't go through GLIBC like JITs. > > CRIU is another consideration: it would be rather annoying if CET programs > can’t migrate between LA57 and normal machines. When a machine migrates, does its applications' addresses change? If no, then the bitmap should still work, right? Yu-cheng