Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp918373pxa; Wed, 19 Aug 2020 19:52:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfNGiEix4V2usWBllz/2W7uhdTFmDw1g6cWPCWUWS6AU2zaIG6C4HNNwm4GH4Wn/YhvUBN X-Received: by 2002:a17:906:68b:: with SMTP id u11mr1325407ejb.143.1597891933587; Wed, 19 Aug 2020 19:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597891933; cv=none; d=google.com; s=arc-20160816; b=vadfu9k0bwrUOE+0hY54R7CdCzYyuBYme/5wT65Ou++RKumPmNS0eOIy6GuqG33drK bbIVfBEw8EkKzgjsbMdsaDr0di73LuHr+WpqyTnoPyKOsGwWfOrbzzE/rJIzHnZ0dHAy czX8+dLrhv9rj3NkWpJ4BPsXxG+8Jf2s07mhpDzylksriq6RBDpayvt4D5g0fXiN2LKR PiDKZGJq6c8cxEyEihySfOetnRghhF/QfySxem1QSBEQVNya0gbYvSAe9+ySkgUG3mhu GwuUYFZ4bc0VE2U6DT+19ZpVmvcroa5HY+OpnMwsQBDC/lxkmEO4n3uYf2LiXDrSLIkQ 1Rig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xfDH+S997URl4jyz8F0i4sHZ1MqQgFzjhRKMHTCjfHo=; b=ueneyY8eO+ItKrF5HQHuTFVmGbfknF2KVJvI/OBkM/CI+SJFzxYq6sjy/lsqk3UhUP ENa8uy8wqn02tAZ+wqcuP7rcW533HBYyOtMrFBoPpb2H+ngKnCvdHRIHtuStar2D+qV5 YZ3r6uRzVDOsoFH1IeMcjPAFYY3HkPuU92NQzciZ7daOu5KJ2IXTikOkeQSB1uYX3+Ws BY6XdivDNCycKCpkYRaG41JrnmB3QLvTUBshLw1blqFfO8RIlUIUGWN3VOP4gNXfYujz Gdp4V7VrsqqqzjgxdodZJ6qR270ZAujZNQHpm7RSxZPRM3YTN4SwJze4x+if/+xX7Hdc PF+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gVPWYW+3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si362561ejc.225.2020.08.19.19.51.49; Wed, 19 Aug 2020 19:52:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gVPWYW+3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgHTCri (ORCPT + 99 others); Wed, 19 Aug 2020 22:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgHTCrg (ORCPT ); Wed, 19 Aug 2020 22:47:36 -0400 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E51AC061757 for ; Wed, 19 Aug 2020 19:47:36 -0700 (PDT) Received: by mail-oi1-x243.google.com with SMTP id b22so792158oic.8 for ; Wed, 19 Aug 2020 19:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xfDH+S997URl4jyz8F0i4sHZ1MqQgFzjhRKMHTCjfHo=; b=gVPWYW+3j/AcWKLc3KV4NYbhQITuq5Q/GEeFgOh5PfQTlqj7vQvilcmgmIllA8t4eX Sdk3sdnbs60wBu1xObrnZoPB7l4CzCJ9mLg26fpDRUE8tY6w/epVGJ58psd2w/W+fMJt vAInXmH2HvOVw6c14vKndSF6OeLggz+nTgLjYCd8Z57kGr4hKZGSY9hwfTt9hS7QSobF dsWsM+vJmB9IYHksv/yd3Oo6Nzfr2Y+MUvYjyK0ubeJEaVueMZs5I1ww05HDqGaQTCLT ro4dG/4d/vEf4u+rd3siB8GN8oJp0QvBFeNI0xz+MT3l2aDpjkyamQ38OWv/Y49NTvyd rs1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xfDH+S997URl4jyz8F0i4sHZ1MqQgFzjhRKMHTCjfHo=; b=MQMlw22Fffv9WyuWR+LgoOjzLrkZNHbt1f7pzQRoZqGeVgwcLFmV08SqNwc3liuDBR joF6tZrjw9YEROikwJPWUj1apxjQzNMMb/FG/60AE7bfb7MULujKNR2KxzwMmoSaJltA DKBmkxj/Y2FtZWnE7pherH5AHJ8+V0gPVQGhGhYYnJUJTUA1SDvt8a3UnUUhd8FNcW0B v+BwzSMX542mzZb5Kfr/RKNdI8Bo51hmzHq4qiXt1aHLOCtdez+SmiWtTHqGTbde+L+5 P9AIhe72SEiscSOr/y5hcHMTpm2aTFxbF1bckvFJlq1PyYZHDh4ecIZ1RXEW0fPp0iAW 8Wyw== X-Gm-Message-State: AOAM5307xO8iHE7kr5C39x/QZWN+HzLFLZbNVTl+RSCzrhzVTeD2tJ+f pHaBzNrdDW2TM6g2jtAxXcKRBeBaznNkS+djwv6D4A== X-Received: by 2002:aca:670b:: with SMTP id z11mr671653oix.6.1597891652183; Wed, 19 Aug 2020 19:47:32 -0700 (PDT) MIME-Version: 1.0 References: <20200803211423.29398-1-graf@amazon.com> In-Reply-To: From: Jim Mattson Date: Wed, 19 Aug 2020 19:47:21 -0700 Message-ID: Subject: Re: [PATCH v4 0/3] Allow user space to restrict and augment MSR emulation To: "Graf (AWS), Alexander" Cc: Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , "Raslan, KarimAllah" , Aaron Lewis , kvm list , "linux-doc@vger.kernel.org" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 19, 2020 at 3:09 PM Jim Mattson wrote: > > On Wed, Aug 19, 2020 at 2:46 PM Graf (AWS), Alexander wrote: > > > Special MSRs like EFER also irritate me a bit. We can't really trap on them - most code paths just know they're handled in kernel. Maybe I'll add some sanity checks as well... > > Why can't we intercept EFER? Some MSRs (IA32_GSBASE comes to mind) can't be completely handled by userspace, even if we do intercept RDMSR and WRMSR. The EFER.LMA bit also falls into that category, though the rest of the register isn't a problem (and EFER.LMA is always derivable). Is that what you meant?