From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46724C433FE for ; Thu, 5 May 2022 14:27:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380626AbiEEOah (ORCPT ); Thu, 5 May 2022 10:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240889AbiEEOaa (ORCPT ); Thu, 5 May 2022 10:30:30 -0400 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4327AE46 for ; Thu, 5 May 2022 07:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651760809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=i0cUYdqS9xzmHM5kRAiCV+ZbNGelOHxmao2CZi0snPU=; b=eOrYjjECLcwCwSwSEwH5/yJacFtxObjTDLFpq8/4orHD3HiVhbTM7+gn3IICcWCfK1FXwk x51S3E7EbMaOA8DsIeeQvOE7RCdC5bocgZQnYR6EOXw/A9jixDBL+3mfNUWYDKAdXpyVbp T3Cc7pVKTwtpDY+rp1ijneMrJz7FUPE= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-hMfB8b8TOneOIi7LHMNxUw-1; Thu, 05 May 2022 10:26:46 -0400 X-MC-Unique: hMfB8b8TOneOIi7LHMNxUw-1 Received: by mail-wm1-f70.google.com with SMTP id u3-20020a05600c210300b0039430c7665eso1826986wml.2 for ; Thu, 05 May 2022 07:26:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=i0cUYdqS9xzmHM5kRAiCV+ZbNGelOHxmao2CZi0snPU=; b=CoSZ2W+LLvQbBsJTwiswOC3C9afo5MaS6m2Hk4KvCg3le+4WmpnDjo7ZTNinHg5Ad4 tzgMDqdPeANnKglPdwgCo0fS7QDS+77+IphmNMLpYm4cYKvzbw9dS61cLNxfmg3blBby M0zUwxWRO8LUtTZHWA/qNN2j5pONOkLJ4Kan9M8ZSndizVd7u/SuCXs2yCfBdMoqe6pq ZqBOwTsdBcZuyMmrGbqU7M5054MvIM1H9s6Ll1fNsr7O2sGeAwAOHm3FhSfE6kHg5BRs T4l5nBLI5n2wsPCgspN5tqw6ZvJqlWwj7IR2ZZgXjXOymZHXzKItZvyUzhxqLHyUHhGo Uxow== X-Gm-Message-State: AOAM5337rSOb5rU53dRJ9bMlDAJsk0JA4O1M5TnAcobNw6TbL12ubjFM wnALyN2vnKj5EVaOJjg7fA7C+4olWHDCf3lMGp3ptKUWnMXfhW0cDVzkkDZNPOXVhuSskl8XPzu 7VrXQK/8NTaY4YO38oLTrxa1i X-Received: by 2002:a5d:6c68:0:b0:20c:7246:a86 with SMTP id r8-20020a5d6c68000000b0020c72460a86mr11371723wrz.283.1651760804943; Thu, 05 May 2022 07:26:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfO9wYCP5WFn8whkyiypT2RoD+B4ozX8T8FJ9GKGRxy89IUG4oGCdAZOy4HeM1xugGkuYWeA== X-Received: by 2002:a5d:6c68:0:b0:20c:7246:a86 with SMTP id r8-20020a5d6c68000000b0020c72460a86mr11371709wrz.283.1651760804754; Thu, 05 May 2022 07:26:44 -0700 (PDT) Received: from fedora (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id s22-20020a1cf216000000b003942a244ee9sm1476899wmc.46.2022.05.05.07.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 07:26:44 -0700 (PDT) From: Vitaly Kuznetsov To: Sean Christopherson , Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Andrew Jones , David Matlack , Ben Gardon , Oliver Upton , Sean Christopherson Subject: Re: [PATCH 000/128] KVM: selftests: Overhaul APIs, purge VCPU_ID In-Reply-To: <20220504224914.1654036-1-seanjc@google.com> References: <20220504224914.1654036-1-seanjc@google.com> Date: Thu, 05 May 2022 16:26:43 +0200 Message-ID: <8735ho12e4.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sean Christopherson writes: > Overhaul KVM's selftest APIs to get selftests to a state where adding new > features and writing tests is less painful/disgusting (I feel dirty every > time I copy+paste VCPU_ID). > > The primary theme is to stop treating tests like second class citizens. > Stop hiding vcpu, kvm_vm, etc... There's no sensitive data/constructs, and > the encapsulation has led to really, really bad and difficult to maintain > code. E.g. having to pass around the VM just to call a vCPU ioctl(), > arbitrary non-zero vCPU IDs, tests having to care about the vCPU ID in the > first place, etc... > > The other theme in the rework is to deduplicate code and try to set us > up for success in the future. E.g. provide macros/helpers instead of > spamming CTRL-C => CTRL-V (see the -700 LoC), structure the VM creation > APIs to build on one another, etc... > > The ridiculous patch count (as opposed to just laughable) is due to > converting each test away from using hardcoded vCPU IDs in a separate patch. > The vast majority of those patches probably aren't worth reviewing in depth, > the changes are mostly mechanical in nature. > > However, _running_ non-x86 tests (or tests that have unique non-x86 > behavior) would be extremely valuable. All patches have been compile tested > on x86, arm, risc-v, and s390, but I've only run the tests on x86. Based on > my track record for the x86+common tests, I will be very, very surprised if > I didn't break any of the non-x86 tests, e.g. pthread_create()'s 'void *' > param tripped me up multiple times. > > I believe the only x86 test I haven't run is amx_test, due to lack of > hardware. > > Based on kvm/queue + kvm/master (wanted to avoid conflicts with fixes that > are sitting in kvm/master): > > 2fd3ab9c169a Merge remote-tracking branch 'kvm/master' into x86/selftests_overhaul > 2764011106d0 (kvm/queue) KVM: VMX: Include MKTME KeyID bits in shadow_zero_check > > Cc: kvm@vger.kernel.org > Cc: Vitaly Kuznetsov This looks like a really nice API cleanup and a lot of work, thanks! I've skimmed through the series and nothing besides '-Werror' caught my eye (I've commented separately). I think that if post-series selftests still compile and run with the same result on VMX/SVM/ARM we should get this merged early as any patch to selftests is going to break the mergeability and rebasing this is no fun. Also, this series conflicts with my Hyper-V IPI/TLB flush selftests added in "[PATCH v3 00/34] KVM: x86: hyper-v: Fine-grained TLB flush + L2 TLB flush feature" but I can certainly rebase as soon as this hits kvm/queue. ... -- Vitaly