[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/spec-ctrl: Build with BRANCH_HARDEN lfences by default


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 7 Oct 2021 10:37:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+PkwmS7Zhv0I0rTaqPmtM6jc93w/HGVw2VW0J1GBWAY=; b=Mp0kiBNjPGH2eGsqYoU57kt4Gb3HERBMTTkWYigMiQvUpfc0TT69VdvfF/Xqf2+64mSsRbvU2hZMvTOenVYLsh0nVC82ME+XN4NWXqo1+qGKw51latbgYyBsusEr9R2krTbXVvnOwwSbSkWCqsJIhcjYUpYcTJDsLujtUs+FOywuTW/+QuT0eZs+93Owm+3bjkKvl9lWh5ih+9mxZSxZigcGCYLuOFc+ijooeNBFPVwj0Eiq7Tn1n+HEVB3f+2FeneDNIc/GFPqGkfDrkv6Vyf4rtL3E/XqHETB/uowmCnDKLk4NP1YVayxIvEqBSJUduzTJM0+gzssORwbk1ADV+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GR3AoUk5uJqp05+tUyYLpJpc+ZS1JEPRDcGIvVjYw3yeCJpGEzmjObxdz6uC0z1F8B0ObaT5bdxZSb7IzhG+ofSW2VG3A4DY2l/K/7sFrX1OqW/Sjo1m+lVAnC18fEffDNXKlrKvykxfZj/RE1r6zyChXzeBpa7iI80s9pykz7xl2Bam6f5dVjnmb4meXlAmPQCk2arrozcTqklyF9uetYOARKDI91wJsmoAi5X5rZU/Z41eWbqfYpdy1pnKbX9Mnl526uGc6m/5x/oL+ODt1raymtwVbyMhLZ9syaVuz6A/+XtcO+R5ooPza+YBWpGI3Uhsq9vDzIezKuox3GkFHA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 07 Oct 2021 08:37:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.10.2021 13:11, Andrew Cooper wrote:
> Branch Harden is enabled by default at compile and boot time.  Invert the code
> to compile with lfence by default and nop out in the non-default case.
> 
> This has several advantages.  It removes 3829 patch points (in the random
> build of Xen I have to hand) by default on boot, 70% (!) of the
> .altinstr_replacement section.  For builds of Xen with a non-nops capable tool
> chain, the code after `spec-ctrl=no-branch-harden` is better because Xen can
> write long nops.
> 
> Most importantly however, it means the disassembly actually matches what runs
> in the common case, with the ability to distinguish the lfences from other
> uses of nops.
> 
> Finally, make opt_branch_harden local to spec_ctrl.c and __initdata.  It has
> never been used externally, even at it's introduction in c/s 3860d5534df4
> "spec: add l1tf-barrier".
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.