Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp403991pxp; Fri, 11 Mar 2022 06:37:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4HzUYvh8S7pDCuZXvJKqKRWOxMidcZ+Xq/LGY4ezI1idCBXKSBtU6x2KYtymiIX8+pPox X-Received: by 2002:a17:907:c28:b0:6da:6f40:eced with SMTP id ga40-20020a1709070c2800b006da6f40ecedmr8520225ejc.400.1647009471327; Fri, 11 Mar 2022 06:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647009471; cv=none; d=google.com; s=arc-20160816; b=sjVUhYSxbP8ib1vKLzfrwrwN/vQ1HGROHaEyJqJTWNeGPUyybmRKOoD8rVrb3AUFXi 4BpWHyQy7dN99QN2iuE6NwrfXrec+kYpZht99mALi4J6FO+I5nloDVnBXc0/uQOxq+4B TXGN7NsjQPkG3dmnOl71zpSwv85q+XQpt0eNB/8vnnto9zEnnKRSQ44+42pFOSQ0qIxi aVvbS7Hn/vxqjAYcoNJARQ37Xk+VX8aiLaqdIk/75f2SbuHuDoLfayl/kq9jB0cuNxHW 0c4sn9761SxU02ktrZhViVXw5OrcBJCwiUPff3IEtycTDnOScw+3jloxtRg+Y6QCPGl7 1WyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RryUuol3Ylo4uqhnnPi8mUdUlrjxjJpVahPqVRRMRrc=; b=my9B3ks0/T+btbloCJR9JVp3nuUQ2rQx+CPqUl/ZRaPglD0W2p61cpyujtevftIGHt Ftl8pLA7vOPrVuXn42NF7iOte0h9JFRoEFQjHNCvGTviyv8RH/LAYA3FpIBnrZIRmcxF CNraPNsheqHZWLBcio7MF6pQ0o9n62cRuqXGerceQ0U2nqNx9TudrV0+gPuzYMxFrhNy +vnDpbBnzcc9Jt2dVZzVGpin2czC1ulrsTJmIbtcGD8Jkv3623jrWxCgrKo2hBpClnZG 4GdXbj3x+B7R4DGNj/q7kUUT/qZo2PZ0LzgI414JhYyVmruPcu5wZ+OChBl/YxymYjbm 1FsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BcPBYZyZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a05640234cc00b0041663fefc70si6094760edc.22.2022.03.11.06.37.22; Fri, 11 Mar 2022 06:37:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BcPBYZyZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1345603AbiCKCUl (ORCPT + 99 others); Thu, 10 Mar 2022 21:20:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244602AbiCKCUj (ORCPT ); Thu, 10 Mar 2022 21:20:39 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30A7DE6D99 for ; Thu, 10 Mar 2022 18:19:37 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id bc27so6277269pgb.4 for ; Thu, 10 Mar 2022 18:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RryUuol3Ylo4uqhnnPi8mUdUlrjxjJpVahPqVRRMRrc=; b=BcPBYZyZprDcx+IbcqYMhON72+fH6zR3XH526BzNCXAXytQh20KAPR4p5fYrKTc9vs uO+0TFZc6iKrP4NFkAbJv53WJCoJvFTeE5pDI2VJRXOyG6SecZvQ4PV/g4DqsxzCEznK gDK2Qgx23qcHSmcqAk7XWwH+sC38AibZg1p36hGKBDIZIEJhQNq+1fNY+Dm3mcHd0PV7 cF9YVj4Mxd0F4NsHdIBE+/unKMg+sfZbvwCUT+SKzUZTX6L5rPQQDyZDOwTyt0qOp7Kg 202wy7Eug99PsrXAFGVEwTd88Gco2RUY2wu2fV9Jv1N+/lFIGL7PRyEtEqI+N7DW5iM9 Ff+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RryUuol3Ylo4uqhnnPi8mUdUlrjxjJpVahPqVRRMRrc=; b=4ByiiIk12f5QhqlcWIdt8I0dtUGNJltGnUIaezIkZ0EL2hSSlMbCXR/bKsfSZxW/ti ZQRZXc3RSuMeBvvjHjGpZnGyFa4hwyzByF7Ar3KbaAzWpuBKPvFAXWborsFXTsHXlNge JFnW0isFfzaa+AovXesbpl3HgKqHBk74AFxWrFKIgfbBiJnx/e9HKezS+Tb6yCmhfnnB aA2607l9Z6cZlyxdKw1qxUj9G+SmzoPbwBznK9fjQSEW3/fFiaddoPK1nrGNMLshQdqu sZMvO7oVIchQcJDOIwNwd0oh7Ad/pUhU/DuZUFZVo/qKuH4J70cHPUSqDgoYkbiXBK5T QM+w== X-Gm-Message-State: AOAM530e535S03KuLPuuCZLYroL940yVs2SonSo2hAK3gqyLEsOdm1Q6 Rkh2MYYmMYV4u8jNYyuCBobcKw== X-Received: by 2002:a05:6a00:218d:b0:4f7:439b:64f1 with SMTP id h13-20020a056a00218d00b004f7439b64f1mr7775354pfi.8.1646965176279; Thu, 10 Mar 2022 18:19:36 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id e6-20020a056a001a8600b004f78e446ff5sm74838pfv.15.2022.03.10.18.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 18:19:35 -0800 (PST) Date: Fri, 11 Mar 2022 02:19:32 +0000 From: Sean Christopherson To: Ben Gardon Cc: LKML , kvm , Paolo Bonzini , Peter Xu , David Matlack , Jim Mattson , David Dunn , Jing Zhang , Junaid Shahid Subject: Re: [PATCH 00/13] KVM: x86: Add a cap to disable NX hugepages on a VM Message-ID: References: <20220310164532.1821490-1-bgardon@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 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.