Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4883968yba; Wed, 8 May 2019 04:34:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqx56W78CpHmNOW3+qIBI1v21R4aP1NrqchxsbuTn8eNVqbHCXwVOigmw/jfWO17GvCBczxY X-Received: by 2002:a65:608d:: with SMTP id t13mr45202112pgu.406.1557315262466; Wed, 08 May 2019 04:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315262; cv=none; d=google.com; s=arc-20160816; b=tsuoxiIwae2GhDN9S9/u3oaweUtuPJfrewgd7ovnf0D4ywPqv4DCHkFfuQyDcqXVll Tg1r/Z28OzZ2J+L+abmXSjm3pKaJLjdL7EdP/K2yfTqOMMsXrkqlgf9CXEYfBINnXNYU dPIdLvqSa8MC0UgIRjGQ/7fxxroX4LPQGH7TQSzQcSOVJE+sezmw0QcVsIfJPW09N0zA Xp02hFhJgpTOR0AjTUwozEy0QjtH1SwTHjSuCnd/HuXRZQDCkbsgulP++Tcy2nOiTsFH 3l2wipwUX5QghVVEQYPSbpnOJgbJ/Pqthf0JWHzTWFVZ9DApoh0oEF28lCBj9EAQqiWS crWg== 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; bh=IMVKRPD91r9MIGHIcHDIHWSb1J68VUuJeZtvfzj/19g=; b=pV8vO3/xOPISCBEFi0TubctH05ak8oRM0PdvwhjyPElQAHsHFSeBT4qBWV0eUC+ymD nyWY0jgxRDMyLh/Ex2GumY/JDZGlWtCZyBraTVvciKMxqEPd+KCpAFZHY5dLmD72uV+r rhQ3IKpvfh5EQiRJWk0QrkHj002vax0W9a7pyY+ffS54c6P1M4iYEipB5TVs8lyCe9fY 4yE/nlaoYLStSNkPW8FjECyv0K8G3/e172EJpcacccuLxrxEcsllVf3AHyf33trKMVIa YIVBDrcsk4AiMnJ7SIbmJz+FO4xObdjvKBk6mgzW597J8pcWdigtXRmNgomgaLsqEaQ3 8ltw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=I10wVl1C; 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 g132si22264886pfc.260.2019.05.08.04.34.06; Wed, 08 May 2019 04:34:22 -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=I10wVl1C; 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 S1728176AbfEHLcp (ORCPT + 99 others); Wed, 8 May 2019 07:32:45 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:36343 "EHLO mail-wm1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727394AbfEHLco (ORCPT ); Wed, 8 May 2019 07:32:44 -0400 Received: by mail-wm1-f50.google.com with SMTP id j187so2819964wmj.1 for ; Wed, 08 May 2019 04:32:43 -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=IMVKRPD91r9MIGHIcHDIHWSb1J68VUuJeZtvfzj/19g=; b=I10wVl1CdPh7kWFokwuyovaZ+UmagWP7YD/Dhe10KeZFPR0qRjqJeYYC86o1Xjjs4L 9yy8m7YhmNeK8rSM2gYAZQAxMjOda8oY/PPBrFxi6QI4J3LLfM0QJ2paFmkFh6kCfAbc ehdgU1WtY17SjggNXUZkhKRGCo7ulImbzxVCBbB5hFHNt6g55qyYId9LkGrYORDt/VVO Rb83SKJ3OHckwj2Vl5NeTcTymjgI0SGTeRAHkejU/Pg9jvEKAurI1tkOfYhlunywwZgY UsTc2WZVXYDowmBZH9Laz1c6jJsyjMdZqsz8ACixPGjqUml9VHlOrSg6IIS3BtsoxfQL d02g== 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=IMVKRPD91r9MIGHIcHDIHWSb1J68VUuJeZtvfzj/19g=; b=aScstWvVF/dmrL+xHP7R+zEcTmUBFTHX4S0KsCR1qk+ypXE+gQuBRgUhH6XR7Xw95p VdMSb9XDU8f+PkshftlhCdZEoWtHH0QVMhH5VNBPN6m+2GPAsXeGWARGCP1oYO9z4nLV 4od7fq8CN73M4+xyLabaV09RXK8/QrYRnwgevVEP68h5ZXX/kaokAR6tOEP5YkO1Tg0o uBL5xsPoFmfbQsvRMFnoitidgmx6cEF/WMjuXFZiHAYXWCEBktz+YEXgs09sRAc4OyIs 23V74Npz1PBgPYg9jRTks4oNIEWExp7amkm8j4xnLpmS3zadoajDzy8HjpLjadgQWyZo HILA== X-Gm-Message-State: APjAAAXi5TLbBcBShNgQetHp14QKWKb8H0oSznwAQ0UPh4a+dlhQuVAV qCSuBZu6BuBU69E5p6jTmOI= X-Received: by 2002:a1c:9ec7:: with SMTP id h190mr2868289wme.105.1557315162937; Wed, 08 May 2019 04:32:42 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id m6sm2926767wmc.32.2019.05.08.04.32.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 04:32:42 -0700 (PDT) Date: Wed, 8 May 2019 13:32:39 +0200 From: Ingo Molnar To: "Reshetova, Elena" Cc: David Laight , Andy Lutomirski , Theodore Ts'o , Eric Biggers , "ebiggers@google.com" , "herbert@gondor.apana.org.au" , Peter Zijlstra , "keescook@chromium.org" , Daniel Borkmann , "linux-kernel@vger.kernel.org" , "jpoimboe@redhat.com" , "jannh@google.com" , "Perla, Enrico" , "mingo@redhat.com" , "bp@alien8.de" , "tglx@linutronix.de" , "gregkh@linuxfoundation.org" , "Edgecombe, Rick P" , Linus Torvalds , Peter Zijlstra Subject: Re: [PATCH] x86/entry/64: randomize kernel stack offset upon syscall Message-ID: <20190508113239.GA33324@gmail.com> References: <303fc4ee5ac04e4fac104df1188952e8@AcuMS.aculab.com> <2236FBA76BA1254E88B949DDB74E612BA4C6C2C3@IRSMSX102.ger.corp.intel.com> <2e55aeb3b39440c0bebf47f0f9522dd8@AcuMS.aculab.com> <20190502150853.GA16779@gmail.com> <20190502164524.GB115950@gmail.com> <2236FBA76BA1254E88B949DDB74E612BA4C6F523@IRSMSX102.ger.corp.intel.com> <2236FBA76BA1254E88B949DDB74E612BA4C760A7@IRSMSX102.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2236FBA76BA1254E88B949DDB74E612BA4C760A7@IRSMSX102.ger.corp.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Reshetova, Elena wrote: > CONFIG_PAGE_TABLE_ISOLATION=n: > > base: Simple syscall: 0.0510 microseconds > get_random_bytes(4096 bytes buffer): Simple syscall: 0.0597 microseconds > > So, pure speed wise get_random_bytes() with 1 page per-cpu buffer wins. It still adds +17% overhead to the system call path, which is sad. Why is it so expensive? Thanks, Ingo