Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3137423pxk; Mon, 28 Sep 2020 09:12:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8o2c9Ikeq7Hw6ZTOiW/DJhe3vovwsLhoe9JDT88U0u2ynrDSDM3eloJ3HN6nC6GeeuKcr X-Received: by 2002:a50:cd5d:: with SMTP id d29mr2715364edj.318.1601309573552; Mon, 28 Sep 2020 09:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601309573; cv=none; d=google.com; s=arc-20160816; b=k8bDlz4N2wVumt9moRgQeBlbXroXplOoiIgTPAFhM/v4S8hqHEz/Lf+g0oxYH7AfOe 7ZeiZSHOQUQd/C9uGKWP5MBRF6vZQJ7QIO/T/gglc2Euly4QEUdlkJdpe/A655e0nTfr oi+0MmkvP2fO9Jg0wH+EolrVb40cSsbNiUxiqEOjn6t86e7Tqlal3U34Mb8Ia4zeFZ4O TzBbMVdMd5rnNiK9tpzl6SxSTmjYtyhBLXnv4L8Qg+ATRrJ8T9OvbLppj+ZJ4vTPKZaM rT8/Z1hqJZKpgmljeQ13h2EDimJOzhVgqh/PbkIvgGsAD3+YqqsIU/IBVmMac5PEmDQV KSrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sSbjOkpOXa/SRNzUYaJC32SvSqb9G8e3qi87JReDiYc=; b=XliIUf9mGhnQUO/ViCYHpyEzTuMQZHbLP02r0g3a9sH43OIAomgRZA5a0bQ4YobaGO bOSm6FN3AybuBUPbQlRMfZNN7cqqU45wR8sHLPH2Ovbbr/3MvfSm8jRaO2cP0RE2rGJP zYUeLgH/f/bcoSrz6/3zsLYhieJSQ+UdlyFeq1X3MN+tdlEjZZJik7TaCLytn3ifIDbw XwjN7T5aY4cYPvHDKPVTnWcSQcHe3onvUgiAu0c6tu2IcOJujpZRyhJ9cktddx+AGkdg H1JKOUHf82lkuPlGN++BhRwWfvp4Qh4sVaJ1djXiqA0IhiBQ7wEse0yQ20fW0X26B0GG gd5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=i+be8AIJ; 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 u2si891565ejx.507.2020.09.28.09.12.28; Mon, 28 Sep 2020 09:12:53 -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=i+be8AIJ; 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 S1726573AbgI1QLA (ORCPT + 99 others); Mon, 28 Sep 2020 12:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgI1QK7 (ORCPT ); Mon, 28 Sep 2020 12:10:59 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AAAAC0613CE for ; Mon, 28 Sep 2020 09:10:58 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id n22so1981134edt.4 for ; Mon, 28 Sep 2020 09:10:58 -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=sSbjOkpOXa/SRNzUYaJC32SvSqb9G8e3qi87JReDiYc=; b=i+be8AIJwl8mLk0ZeQtg25l5e4K8bjRLO7Y4bvHYxsM9jdWRhhYd13bbuqqd1qDtml 4W3i+ijZaC6+QmQodqW6d+u59gvdOcXbfmJ9Upfk+e513jAIkpNNjZNbtFcptfEvjnDw LA4rBujnIZKjFNT8Jb/WGEwcv7iZ6yMdAw4outujy6PxTJWYcTpTcl+j0ZdvOsKVSuxy UPHsQmTPtiHzvRq11ffEgYMwlA38C0+8iuTJgTILdeslE8Hp3GEfsm8u8lvZnw91s1qv uW7rN17+dob3i9cuZsXm8i1ZfoSh9AmSQIBgD3w5yaUG0UuO9doJ5UnWLBaa9hGvGyHt uPGQ== 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=sSbjOkpOXa/SRNzUYaJC32SvSqb9G8e3qi87JReDiYc=; b=TR7LFc0ELv2zW50WqQo8/NPPoooxEXCtocWjvqMRUWLCY3vitzk1cCUhK8mP3234Nb R+1ezLf6EvF+QTC5/dAvJZOiZ8fIpKSXq3m1d7C/h+bjJ0Wq7CK8uX6E9qmS8P1o7PgW URR2YA7NP3gXsPE8yFBBZzWnfrQSEF0dpdQ7DeUzKmex0idfBAapPovZxj/3L36lsEEq RAKpbW3lhPlPskIR4E1KllgBLC61PcOHspOKMAAPBWCx7nv0siIgHS/csisuin926s1e fG6NS2O+Gj3o3qYsJAoD7RYo/Z2h8C4eANd18EIpXKcDaJaEYgjNko8XoTUxddJN91Y4 yZBQ== X-Gm-Message-State: AOAM533+Eb8CIxArS0jJxYMD3H+OdnIfwrjVTsDCMwq5MkBiLNQcqvqH YRuh5eWk0Dr5Hvy8JjolOxURsFj9gRfZSmTmZhiZMg== X-Received: by 2002:a50:e78f:: with SMTP id b15mr2661553edn.104.1601309456646; Mon, 28 Sep 2020 09:10:56 -0700 (PDT) MIME-Version: 1.0 References: <20200925143422.21718-1-graf@amazon.com> <20200925143422.21718-9-graf@amazon.com> In-Reply-To: <20200925143422.21718-9-graf@amazon.com> From: Aaron Lewis Date: Mon, 28 Sep 2020 09:10:45 -0700 Message-ID: Subject: Re: [PATCH v8 8/8] KVM: selftests: Add test for user space MSR handling To: Alexander Graf Cc: kvm list , Sean Christopherson , Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , KarimAllah Raslan , Dan Carpenter , Maxim Levitsky , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 7:36 AM Alexander Graf wrote: > > Now that we have the ability to handle MSRs from user space and also to > select which ones we do want to prevent in-kernel KVM code from handling, > let's add a selftest to show case and verify the API. > > Signed-off-by: Alexander Graf Reviewed-by: Aaron Lewis > > --- > > v2 -> v3: > > - s/KVM_CAP_ADD_MSR_ALLOWLIST/KVM_CAP_X86_MSR_ALLOWLIST/g > - Add test to clear whitelist > - Adjust to reply-less API > - Fix asserts > - Actually trap on MSR_IA32_POWER_CTL writes > > v5 -> v6: > > - Adapt to new ioctl API > - Check for passthrough MSRs > - Check for filter exit reason > - Add .gitignore >