Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp962907pxp; Wed, 16 Mar 2022 22:46:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDNX/EyJZUq+FduJj0MBZzGw3xq18MLJd7fKEA7Mh1napNTbtGjo6L2blZHY7MVxFVE3VI X-Received: by 2002:a17:902:ab10:b0:153:b520:dbbe with SMTP id ik16-20020a170902ab1000b00153b520dbbemr2925678plb.55.1647496015514; Wed, 16 Mar 2022 22:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647496015; cv=none; d=google.com; s=arc-20160816; b=W7ZqOeBQs+euqVfwyoGFrlyLiGn9uYnVIPF8/ua608PF6w5MSVFn5W9S+UmaaxzUo8 DlWEmI22ZJjvdqemi2A10qh7WY0ohABDWD81dPy1lJYBbeAWQV8rknG9NGz4UEPLYUkw w20ygzZKxrTPPSwM9G7CtK10SfMuojeS890OxYptVVBkntZ7vseItaAPAaeD8h6wgral xAQBUCKTT6uX+N2i2ikNHlC7e5aui/WLIfRtH/TIl1TgvzGeDhWcxqMczGgtvvFqt9M2 PgvIzarbRA62P+tVZFlv50KNitbNvoDpYzZZUj3bCu6Y/cTB2cnJibJMJVNOMldw0WVb VRvw== 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=bY5xtSrH39029xqE3mOOcec5o9mj3nUWmGzVJpEccxo=; b=S8+/n11fICWyvDktYwZzQRzgR4Ye5OoGuOPbzWa0WyM1JIU4A6+M9rNn2QG64nLudv 0rIMA/gbjBs1Y+DjrNyRa5ucfOO0fPKSnSF2viMEpZK7tjgoJhrIEVcjmvA6SnZU65kZ yqIh2pQa63UjHnBcV2rj37+GDBDNydkdz7sYKEHYIgw1KnqIwhYSmxqZfCH2gGwb3JLm 8eYg+vspu1AUjUmD0Ad33vD31uamOTxuDpsDADdfvS4iba7EWQpYL2uNpg5rWX/BmsEo HbPW+LrSxo6tcBSsZ2INDx9sUD4QO82uBaR2OYUidmQLSgT+tYAMqXBmaYmpE0fYGffQ v3KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Kd8Hv0JD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c20-20020a056a000ad400b004e057a894aesi4446287pfl.176.2022.03.16.22.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Kd8Hv0JD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E0F3E615C; Wed, 16 Mar 2022 21:41:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351122AbiCOXNy (ORCPT + 99 others); Tue, 15 Mar 2022 19:13:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236985AbiCOXNx (ORCPT ); Tue, 15 Mar 2022 19:13:53 -0400 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 027BB2E0A7 for ; Tue, 15 Mar 2022 16:12:41 -0700 (PDT) Received: by mail-yb1-xb2b.google.com with SMTP id w16so1338718ybi.12 for ; Tue, 15 Mar 2022 16:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bY5xtSrH39029xqE3mOOcec5o9mj3nUWmGzVJpEccxo=; b=Kd8Hv0JDmH3YkSwU8rpWKqK11gwQ5RHa2i26ofq5z9ax+InqOEKhrdmlftL5mlCHG5 jwk+gYxQeGW5zFpWK1LImFyaoTxjzGO2tJVtCaPzS97kLptqsz2lexAXlEGun6UleVpr ZwyGMoN/HrFcIZfbPRVFXczcc1F/axmnlaCZywOX1zrb/6tvTeu925CdgSI9zhVTEB9i AEsZBBMGbAE8qEhhLCCJhXUYpgKlqSr9nLQsZNh1TGk0iS78WY79WwrRZzt1991xIKmw wQ7oWPzLQMpQ0BNWzic6O7cBBTlZPtbQTvEIAh791Ls5NFLsEEy8tySw8htT/ExgLOzX kmOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bY5xtSrH39029xqE3mOOcec5o9mj3nUWmGzVJpEccxo=; b=Q+3tZuFE5mLFQOfM4si+DUsHWDQ/8l2yUZoQu+HMtaDEyvqRlafo5Ylp3MyXoHEGlF XPB+zdN4jnUWXSxqdyhzlxQwyLoNt1D9LPkSf/VkbesYAkiKbzPQ7ce40GehGKtdptZQ y6dHHDCKEfnq5GWyZySRSbhMoeI8VZvzOn+hcQnAR7tHwa/uqU2vERaUr+7N/JGhq//z cWBihxdKEOZNiwfa4nH1mk0879X+6A4G/jcFGmwDF373/SOWgmkEPEhiOTFHC8IM0z0i cGdQUn5sa1jbr1PoKd5Z2jz+JnXjAa/fwV2OAVr6ybRr2hYoNp1qHzH7UbHAdVDnUms0 mjPg== X-Gm-Message-State: AOAM530ZliNIIxyccrNzCtqYoftS5Iqns8tWt3mI6MOi54+gpZzasenE cCGRVpR1hoiP07Nb4VMgYHAa+P16EgnveJXlrwPT4Q== X-Received: by 2002:a25:bf87:0:b0:622:1e66:e7fd with SMTP id l7-20020a25bf87000000b006221e66e7fdmr25848318ybk.341.1647385959996; Tue, 15 Mar 2022 16:12:39 -0700 (PDT) MIME-Version: 1.0 References: <20220310164532.1821490-1-bgardon@google.com> In-Reply-To: From: Ben Gardon Date: Tue, 15 Mar 2022 17:12:29 -0600 Message-ID: Subject: Re: [PATCH 00/13] KVM: x86: Add a cap to disable NX hugepages on a VM To: Sean Christopherson Cc: LKML , kvm , Paolo Bonzini , Peter Xu , David Matlack , Jim Mattson , David Dunn , Jing Zhang , Junaid Shahid Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Okay, I'll hold off on the memslot refactor in v2, but if folks have feedback on the other aspects of the v1 patch series, I'd appreciate it. If not, I'll try to get a v2 sent out. I think that the commits adding utility functions for the binary stats interface to the binary stats test could be queued separately from the rest of this series and will be helpful for other folks working on new selftests. On Thu, Mar 10, 2022 at 8:19 PM Sean Christopherson wrote: > > On Thu, Mar 10, 2022, Ben Gardon wrote: > > Those patches are a lot of churn, but at least to me, they make the > > code much more readable. Currently there are many functions which just > > pass along 0 for the memslot, and often have multiple other numerical > > arguments, which makes it hard to understand what the function is > > doing. > > Yeah, my solution for that was to rip out all the params. E.g. the most used > function I ended up with is > > static inline struct kvm_vm *vm_create_with_one_vcpu(struct kvm_vcpu **vcpu, > void *guest_code) > { > return __vm_create_with_one_vcpu(vcpu, 0, guest_code); > } > > and then the usage is > > vm = vm_create_with_one_vcpu(&vcpu, guest_main); > > supp_cpuid = kvm_get_supported_cpuid(); > cpuid2 = vcpu_get_cpuid(vcpu); > > My overarching complaint with the selftests is that they make the hard things hard, > and the easy things harder. If a test wants to be backed by hugepages, it shouldn't > have to manually specify a memslot. > > Let me post my selftests rework as RFC (_very_ RFC at this point). I was hoping to > do more than compile test before posting anything, but it's going to be multiple > weeks before I'll get back to it. Hopefully it'll start a discussion on actually > rewriting the framework so that writing new tests is less painful, and so that every > new thing that comes along doesn't require poking at 50 different tests.