Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4249607ybi; Tue, 11 Jun 2019 03:34:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAhmCYO1PVJvip0aJriUclmDyGSUFYgPJXBSW0kSJZbK5+2+12ENU99s5wxeO2EN3eQVE7 X-Received: by 2002:aa7:972a:: with SMTP id k10mr46971700pfg.116.1560249242083; Tue, 11 Jun 2019 03:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560249242; cv=none; d=google.com; s=arc-20160816; b=wHFpXpcNVeaO56ly0T23yVqA4AvUY/vI+y0KKUM930bCNoMQBNh4GbC5732atjafFz Ovh6OTudpbrj+s4RYq7YoscrYUJL8nVyoYlcHoCJZtK4gplq0US+Fz4O2Lmphi8SqWgW T2Gp9P7vR3mBkXhdHnPXJfTdh9KwBurHU81EpSnCAcFJp7QYl8RqO6gy305pP/jGwLnj DFM4YV3bXu03DE1lV6iohrOpRWQDkVlHmvt6DFWRqrkwUnoD8HriHNkbgrifR14jBjYi neIqXxFV6N7y66usnMz3XAYFVn2z+WULVyobPO08ixnkvnztRQpllnmvsvAfv5Mes5DX Ih9Q== 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; bh=kV96tPAL7kYj88H4EhLrLgx83C/B1Q/iCV+KW7K22qI=; b=qg127aRCFd73Dzh2Wvtshg94yPBiZSPWMC0w6afroTNw7sDkMheg8TK2jjt6KpyKOq dSeOuWUEjZHUcxA5lSeVKGk5OOEG0fwVYUdSgAIORzEX1CP83pQbEKKnxThhb4cAlIOH 2pg4gKyuJdZP1gK4GMXAm/o7fCczowXe7f3aTl0z++HCnLyG/zhA0R0Jn9oiTmH/JuYP yuOfevoLQtqs7JxBOOJ3QCOCwiwOyHC6XMuj1VBxND2Ei6tPFzKr82HzMhQNEKmsGBHV LeY5ye8GrNU7BRp6zIrKu89wIHLEnZQ2TJrXgjz5llctOGWu0sTgGj4tDiZx5b8JUAUF xJdQ== 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 z17si11597627pgv.485.2019.06.11.03.33.45; Tue, 11 Jun 2019 03:34:02 -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 S1728466AbfFKKdT (ORCPT + 99 others); Tue, 11 Jun 2019 06:33:19 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:33330 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfFKKdT (ORCPT ); Tue, 11 Jun 2019 06:33:19 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 21FC68023C; Tue, 11 Jun 2019 12:33:06 +0200 (CEST) Date: Tue, 11 Jun 2019 12:33:16 +0200 From: Pavel Machek To: Yu-cheng Yu Cc: Dave Hansen , 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 , Andy Lutomirski , 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 , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Subject: Re: [PATCH v7 03/14] x86/cet/ibt: Add IBT legacy code bitmap setup function Message-ID: <20190611103316.GA20775@amd> 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> <20190608205218.GA2359@xo-6d-61-c0.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon 2019-06-10 08:47:45, Yu-cheng Yu wrote: > On Sat, 2019-06-08 at 22:52 +0200, Pavel Machek wrote: > > Hi! > >=20 > > > > I've no idea what the kernel should do; since you failed to answer = the > > > > question what happens when you point this to garbage. > > > >=20 > > > > Does it then fault or what? > > >=20 > > > Yeah, I think you'll fault with a rather mysterious CR2 value since > > > you'll go look at the instruction that faulted and not see any > > > references to the CR2 value. > > >=20 > > > I think this new MSR probably needs to get included in oops output wh= en > > > CET is enabled. > > >=20 > > > Why don't we require that a VMA be in place for the entire bitmap? > > > Don't we need a "get" prctl function too in case something like a JIT= is > > > running and needs to find the location of this bitmap to set bits its= elf? > > >=20 > > > Or, do we just go whole-hog and have the kernel manage the bitmap > > > itself. Our interface here could be: > > >=20 > > > prctl(PR_MARK_CODE_AS_LEGACY, start, size); > > >=20 > > > and then have the kernel allocate and set the bitmap for those code > > > locations. > >=20 > > For the record, that sounds like a better interface than userspace know= ing > > about the bitmap formats... > > Pavel >=20 > Initially we implemented the bitmap that way. To manage the bitmap, ever= y time > the application issues a syscall for a .so it loads, and the kernel does > copy_from_user() & copy_to_user() (or similar things). If a system has a= few > legacy .so files and every application does the same, it can take a long = time to > boot up. Loading .so is already many syscalls, I'd not expect measurable performance there. Are you sure? Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlz/g2wACgkQMOfwapXb+vIj7QCfRkp2CAAYHfFjIjZpoiuF3QSp XOcAn2kbcxPiUdvqncAD5H23uN2WhHP1 =j3lF -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--