Received: by 10.223.176.5 with SMTP id f5csp2716306wra; Mon, 29 Jan 2018 02:49:25 -0800 (PST) X-Google-Smtp-Source: AH8x22745EJz7/gIZR/Cg64jd4RnwbW/IMVHHCS1VDgr/nvkGnwNiNwTbGp+/fO3TMDcv8hG6z+F X-Received: by 10.99.123.91 with SMTP id k27mr21216356pgn.179.1517222965761; Mon, 29 Jan 2018 02:49:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517222965; cv=none; d=google.com; s=arc-20160816; b=r6WKeL16Ly0glcG1XgConz8abbn+WDtu6fimL6ySPlXdw/HOhvUfCYnQMwctJm52cx FHOVe2WqnS+vuDmzj0pe3XQf2ezTzxtd1tzJPMD3Ez2rn44egd2O9usqeYiv/mbDBozD QUYMg+6lt8JwxJiqElI+M0U1zTeYRHQExQf/cE8kQMD2TyT1ruDph0pqbT7ZCyr9X8gS dEpgQUcT2kYy+03ecvP07F+78PcCC06pDevaVq+5wXB9hZO1KKFGYCINyw/+V/sssOJa G7EEqwQpSBQs0giOMNJeB+7HNumP8N90rkyK7gJY7vLnRbhWoXB/grgUcgcTlIqNEBW4 +cNQ== 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:dkim-signature :arc-authentication-results; bh=OzSIsNPlVZ62EYUT5YEPXE/UwDWJETIP9r8eQ+1DmG8=; b=w1/BkWiDJXLoC7w1Y+2ImkKexE8R5ybtTHGBUNEat/3pSsTUUjFOlYR0O8QigkJ476 3PSedYH2GJbuAHA9FinxbVuUVyPcHXH3qdKN9/aRy/An5Tr5dD3XHnx+XVrhstE41yJz gncIJEOtGgIIOHdNtwVsDeu6xn5Ieulh9vqijdiRHVtj8sNfhfSP+XkMGgRZ4zAxr7E1 L18sDDbvcFgrF4BGbjxZMMvvnqn4RP8C+48y3eapTulvxB3hGiCl74ZNI6gA8wZAiIea eTtnkiv1Gfgp83MYjRsshM9rVZBYXj8OP7VR2NSHwnahkWxcYbYuYJAPiVwst7cu7rMA JapQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pB4dTo5S; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6-v6si9015490plo.800.2018.01.29.02.49.11; Mon, 29 Jan 2018 02:49:25 -0800 (PST) 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=pB4dTo5S; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751826AbeA2KrZ (ORCPT + 99 others); Mon, 29 Jan 2018 05:47:25 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:51405 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751770AbeA2KrX (ORCPT ); Mon, 29 Jan 2018 05:47:23 -0500 Received: by mail-wm0-f54.google.com with SMTP id r71so13296503wmd.1; Mon, 29 Jan 2018 02:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OzSIsNPlVZ62EYUT5YEPXE/UwDWJETIP9r8eQ+1DmG8=; b=pB4dTo5SZ2Q7/neq/6t0UEwqek3nvvO3ZJ+qzibfJYypF3ht9e2g5V/y/jcJYFNAak 2fsuiOoh/ggTDNRqZTLlX/6fhb/fSSsEkWO8acsm/YDgZ8i/GzvagYmod2e46UDDtnFL e/jpk5DS8izGSXN3lml3rOIwZyKQel275jrN7q9Nf9dNePBM3z2np54fK7hRIbMZItne 9CfcWI64tNpSVDK84S9w+u1c5tS8GbHsQeEGm6qfPFDduOK1b8CHvraqlMflkCdrCEJ4 ZdssmPCDWaBHwozku6DSrJb3jBezc6n2SoFoZmfOMJqvmdhk8pR/UEjjKHca0oDsibrY VBkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OzSIsNPlVZ62EYUT5YEPXE/UwDWJETIP9r8eQ+1DmG8=; b=XkqpOmq+Mbo+7VcKHJdImRWPgxEaPt87g9iM+if4qbf9cSduHxDwCRUGoivdo5uJjE +5Tlh2V5V623mT33jAgWWrRBUBUjSzxlMAD/Dml5D41An2/3KHh/1t6f4X6lNunGMbcL BbUVUHBOWmawpYSyF2kQwhCsrkPtg1H5VpVsqNhIu6Wn1YhOucNVfgp7NcjcaRLbqLvY Th5eU8zOCqTWU9b4tRMUmvszNaGWVNyKfS2nKJmN+84wiLFAhVpxx3rBesgOhrHcUmYf y0vzxCvlv1gJrNFqU/Us/BmKlfPtbEZN62NYYSf00X0fMK0SvcpURqH5zdH02CgDfTQ4 Z7AA== X-Gm-Message-State: AKwxyteBLbZKPUMtSuUwOcU390BPCIHw1gi3BLtmI+YzRx8cl95aR4NR frukxDZLHG4qBQf+F2g2oGo= X-Received: by 10.80.193.130 with SMTP id m2mr20343806edf.172.1517222841976; Mon, 29 Jan 2018 02:47:21 -0800 (PST) Received: from [10.1.123.162] ([31.131.246.13]) by smtp.googlemail.com with ESMTPSA id q45sm6100064eda.53.2018.01.29.02.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 02:47:21 -0800 (PST) Subject: Re: [PATCH] x86: vmx: Allow direct access to MSR_IA32_SPEC_CTRL To: David Woodhouse , Liran Alon Cc: konrad.wilk@oracle.com, luto@kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, asit.k.mallick@intel.com, dave.hansen@intel.com, karahmed@amazon.de, jun.nakajima@intel.com, dan.j.williams@intel.com, ashok.raj@intel.com, daniel.kiper@oracle.com, arjan.van.de.ven@intel.com, tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org, ak@linux.intel.com, kvm@vger.kernel.org, aarcange@redhat.com References: <6b9a1ec2-5ebd-4624-a825-3f31db5cefb5@default> <1517215563.6624.118.camel@infradead.org> From: Paolo Bonzini Message-ID: <15dec0b0-4467-a667-e940-83c29eb9fde3@redhat.com> Date: Mon, 29 Jan 2018 11:47:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1517215563.6624.118.camel@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/01/2018 09:46, David Woodhouse wrote: > I'd actually quite like to repeat the benchmark on the new fixed > microcode, if anyone has it yet, to see if that read/swap slowness is > still quite as excessive. I'm certainly not ruling this out, but I'm > just a little wary of premature optimisation, and I'd like to make sure > we have everything *else* in the KVM patches right first. > > The fact that the save-and-restrict macros I have in the tip of my > working tree at the moment are horrid and causing 0-day nastygrams, > probably doesn't help persuade me to favour the approach ;) > > ... hm, the CPU actually has separate MSR save/restore lists for > entry/exit, doesn't it? Is there any way to sanely make use of that and > do the restoration manually on vmentry but let it be automatic on > vmexit, by having it *only* in the guest's MSR-store area to be saved > on exit and restored on exit, but *not* in the host's MSR-store area? Right now we don't even use the store-on-vmexit list at all, so the Simplest Patch That Can Possibly Work is definitely the one using rdmsr/wrmsr. It's not really premature optimization---though it doesn't hurt that it isn't awfully slow. Paolo