Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6346332rwn; Tue, 13 Sep 2022 02:56:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6OUzs7l7nhEc+DtIANxxjFOy83lkzomAq7PysNc6ZQWPsWt+2YL0pUqJhoB/i1jYt3fYgZ X-Received: by 2002:a05:6402:5c9:b0:446:fb0:56bb with SMTP id n9-20020a05640205c900b004460fb056bbmr26104031edx.173.1663062973910; Tue, 13 Sep 2022 02:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663062973; cv=none; d=google.com; s=arc-20160816; b=OSHAqvAbpXmBBNl/lq24XckMQbqlGDAfxiX2BN5J3IVwBHjRL3J5+80xwEn0MoRtuJ jtxSEQ7xB80Iausk6fhhC9/ROZZ6hkhJ2/tesAMkm6bs2UT+iFIVHth+Ftkk/n5xwSVi c7ehbpJLQ6mjISWq1L167a/pzJaQJX7LnrGLdyEB/3g/vdG0GaCsQF+BUlhcSLfYssoK 1bLUJiSJbW6UL8LniHnS+j68kAeSq7CAeYDFr3qd/siUVplZhE3QvNPTAzVLDKc+OIBV 3l3dtn/Xv62vBvUSxnCw3ECi/4dNXxcciXSJDGJdMtfMwBGD6pP9XxkR2weoCJN2bt1z teOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=H+b3p8jJeOUzB9Y7KKCEYhhWbXEO9sDNunqO8TSV3bM=; b=n1L1JXLZl4m18Krw+7sgTbOGidKBD4+4cmH0o8s0E4RrJsevG+whUqs50GlyuPPzQR SytVKFacAzMOOjvtaStbslAE62xlgK6f73JV/WeLQ4IYu4G7uD8lVWVtco91bmC8nFW/ NPmYzKh6q/qMAeh3u6cEzOEAPVKTI06PUfvju3o8vXR++jahjt9D41+tgPZFG/b70RrV 2na6gbm/LNKO/oiA33eUFlxd+piw9+TPliL47cN1tFivcZJv8UvLjqwu/54hgnNlhY3m GL+hSdwsXSrraJ+Ki+ocTMsN8fFX24C+nZP4i3ajBLEOdrs/r+1FPhBlheUPWHRGYZpP kF5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kq0H5eCQ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go12-20020a1709070d8c00b0077c099a6413si7148369ejc.59.2022.09.13.02.55.47; Tue, 13 Sep 2022 02:56:13 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=Kq0H5eCQ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231360AbiIMJxJ (ORCPT + 99 others); Tue, 13 Sep 2022 05:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbiIMJxH (ORCPT ); Tue, 13 Sep 2022 05:53:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C7558534 for ; Tue, 13 Sep 2022 02:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663062782; 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=H+b3p8jJeOUzB9Y7KKCEYhhWbXEO9sDNunqO8TSV3bM=; b=Kq0H5eCQPbIcpbdpdrvGqffzOJZ3ZH+DwUPGKDg4U6ZQ0pZQ+aUioJsOk+Cl90Ksoj+SUV cnBu+S8Bb5SqSxxnxMoc2Y2BZXfj1RkYbLUzPONxANnkQRFK4WCmj3CD3JTCZ5JbJDukFt MOjijPd5vQuc3ljCCCoVcJOTMnEdh6w= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-577-aSoRrUuYM_-Olc-HCYNghw-1; Tue, 13 Sep 2022 05:52:57 -0400 X-MC-Unique: aSoRrUuYM_-Olc-HCYNghw-1 Received: by mail-wr1-f70.google.com with SMTP id i29-20020adfa51d000000b00228fa8325c0so2986771wrb.15 for ; Tue, 13 Sep 2022 02:52:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=H+b3p8jJeOUzB9Y7KKCEYhhWbXEO9sDNunqO8TSV3bM=; b=TF1A9n8mmM0V0px7pNeQ0O/tAT/6lGwIp2RI4ucyt1zwKf4EaMcPet8vaKep4EReXU Y9lud4s+gUOSNsAXlGqwWDqFhdb6EC4tABIN6h/nwjJjZJxKZPkQA0qz7v8/UJqUe5Rl JbF75AJVPNSOhJJXEfq/K0VWi/Fzo9D7t4dPv0ISWLr/to/lrH9g3UTemFfAlxg5bMjj uYIiCy3rctXoaFQVNrPp+tG97CFNyntS9L71s1SLKaqOIAdn9K88+EEuNMyPDYUl1ymy YW+Ypp0dyBFaZTofB8qZiZIqHA6bLzBeF7mTEZxbDCD8+iuuR5o4gMyHRia8xZad1V3V xXnw== X-Gm-Message-State: ACgBeo2qeDO3sF+RZyrZOT2kab3y19bACVWQ36XeZvjgyfNlgpCvdE6J Y5VzTgZAVyJJ/Z0fkCZydVgz3s3OyC9oT2K+QOnavtZ4PSmeNFKlp/KosRFhwuZkCg6W/DxABTM 8pJf6W4I+qaAetuTUNu/9nUmDA0d7wFePiHBvcpJilkmz9+cXBE0GLGBANT8yoysCZb0rffYIKd 53 X-Received: by 2002:a7b:cbd2:0:b0:3b4:33d1:d938 with SMTP id n18-20020a7bcbd2000000b003b433d1d938mr1688006wmi.123.1663062776016; Tue, 13 Sep 2022 02:52:56 -0700 (PDT) X-Received: by 2002:a7b:cbd2:0:b0:3b4:33d1:d938 with SMTP id n18-20020a7bcbd2000000b003b433d1d938mr1687990wmi.123.1663062775806; Tue, 13 Sep 2022 02:52:55 -0700 (PDT) Received: from fedora (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id o12-20020a5d4a8c000000b002285f73f11dsm12303111wrq.81.2022.09.13.02.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 02:52:55 -0700 (PDT) From: Vitaly Kuznetsov To: Sean Christopherson Cc: kvm@vger.kernel.org, Paolo Bonzini , Wanpeng Li , Jim Mattson , Michael Kelley , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] KVM: selftests: Rename 'msr->availble' to 'msr->should_not_gp' in hyperv_features test In-Reply-To: References: <20220831085009.1627523-1-vkuznets@redhat.com> <20220831085009.1627523-3-vkuznets@redhat.com> Date: Tue, 13 Sep 2022 11:52:54 +0200 Message-ID: <874jxbr47d.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Sean Christopherson writes: > On Wed, Aug 31, 2022, Vitaly Kuznetsov wrote: >> It may not be clear what 'msr->availble' means. The test actually >> checks that accessing the particular MSR doesn't cause #GP, rename >> the varialble accordingly. >> >> Suggested-by: Maxim Levitsky >> Signed-off-by: Vitaly Kuznetsov >> --- >> .../selftests/kvm/x86_64/hyperv_features.c | 92 +++++++++---------- >> 1 file changed, 46 insertions(+), 46 deletions(-) >> >> diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_features.c b/tools/testing/selftests/kvm/x86_64/hyperv_features.c >> index 79ab0152d281..4ec4776662a4 100644 >> --- a/tools/testing/selftests/kvm/x86_64/hyperv_features.c >> +++ b/tools/testing/selftests/kvm/x86_64/hyperv_features.c >> @@ -33,7 +33,7 @@ static inline uint8_t hypercall(u64 control, vm_vaddr_t input_address, >> >> struct msr_data { >> uint32_t idx; >> - bool available; >> + bool should_not_gp; > > I agree that "available" is a bit inscrutable, but "should_not_gp" is also odd. > I think Max suggested it to reduce the code churn and I silently agreed. > What about inverting it to? > > bool gp_expected; > > or maybe even just > > bool fault_expected; > > and letting the assert define which vector is expected. > This also works, will change. -- Vitaly