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 4E383C43334 for ; Sat, 4 Jun 2022 01:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350320AbiFDBXp (ORCPT ); Fri, 3 Jun 2022 21:23:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347796AbiFDBWw (ORCPT ); Fri, 3 Jun 2022 21:22:52 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98DBF13F48 for ; Fri, 3 Jun 2022 18:22:02 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 70-20020a250249000000b0065cbf886b23so8231120ybc.8 for ; Fri, 03 Jun 2022 18:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=Mfje/LGEsIL1Phc7prlzE2OIDnqfhuSW/tqukwpVxsI=; b=D3glnvYPbXr/z3GEfKzM+4eXG6LBrh6/RJH0PVe111Y26a4ttKlQ6AAMFb9Z+3izZ8 kJhWLrzfivtnwfB7zEw6GjRRynu+w+p+DrmRQmNtrGF0SSZF3ycQMaa94bmBoswb6u6k 22zr5Oa4iIfSm2D8i0T5tMGpdvUX6bG9QgM/HgJI4iaDt7JL9MkLZm/0hnpBRtf07TQB 6cH7zN5WdaNp+t6zEOCMmzZ+OUOeq8RsVkUo7TWYvp9dFVeV3R+jRpUKRbQdbp87Vvoh n7OTM894lZ7i46UUNPOt952rkfPLjPr5mcFY0NBTt7VqDlsZ7Q+zHnLAnlzExbUUzCEe XEbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=Mfje/LGEsIL1Phc7prlzE2OIDnqfhuSW/tqukwpVxsI=; b=X+1XM4ReXetND/Pi/zRsLK+GBkLZFJwvj0z0CN4aW6izUeAXKdFWVi7CDnl8p1daTm ZSjFtpvSVnEaXgGXPyHeACBsbfjC1/9eXoCyp6pepthZncUQOQ6EUZJbxLmcZrdVzURR 0BoRBR5ikMSCtX+2kseMqvy5r2l1u3hwbR4Hx2a0A0grhxAwXqzjJhaVyz4hGQK/XXmc pK0d01f/466bSFc69kXU7XFWw+XWJLlZ0rlkkX+BSifGV7qiqr24ZdpqTvVxBUBgj0y2 4nkMuvXScPntjH5PYTuMEo/PiQPZRHHF2joDMD16hSU2tFHsOjHfqK1Zspd0DowuFddW O+rA== X-Gm-Message-State: AOAM5313G+h3Ym1Udo9jTbS0r/22ACCO8mwAXx0eNdClWHtUKRIGJdK1 TwVpWu9xzj8BhtiBRzHvtK9vyl1gfKo= X-Google-Smtp-Source: ABdhPJyuu7qyy+NAD0XIM4dph2EYsRlc1nM27AAK2h4houaEceAl5McsPosj+Sh7NPGTrV6WgqJypRNTMaY= X-Received: from seanjc.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:3e5]) (user=seanjc job=sendgmr) by 2002:a05:6902:1146:b0:660:9278:80fa with SMTP id p6-20020a056902114600b00660927880famr6695754ybu.172.1654305708092; Fri, 03 Jun 2022 18:21:48 -0700 (PDT) Reply-To: Sean Christopherson Date: Sat, 4 Jun 2022 01:20:43 +0000 In-Reply-To: <20220604012058.1972195-1-seanjc@google.com> Message-Id: <20220604012058.1972195-28-seanjc@google.com> Mime-Version: 1.0 References: <20220604012058.1972195-1-seanjc@google.com> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog Subject: [PATCH 27/42] KVM: selftests: Use vcpu_get_cpuid_entry() in CPUID test From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, Vitaly Kuznetsov , David Matlack , Jim Mattson , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use vcpu_get_cpuid_entry() instead of an open coded equivalent in the CPUID test. No functional change intended. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/x86_64/cpuid_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/cpuid_test.c b/tools/testing/selftests/kvm/x86_64/cpuid_test.c index 8723d73dcdbd..694583803468 100644 --- a/tools/testing/selftests/kvm/x86_64/cpuid_test.c +++ b/tools/testing/selftests/kvm/x86_64/cpuid_test.c @@ -147,7 +147,6 @@ struct kvm_cpuid2 *vcpu_alloc_cpuid(struct kvm_vm *vm, vm_vaddr_t *p_gva, struct static void set_cpuid_after_run(struct kvm_vcpu *vcpu) { - struct kvm_cpuid2 *cpuid = vcpu->cpuid; struct kvm_cpuid_entry2 *ent; int rc; u32 eax, ebx, x; @@ -157,7 +156,7 @@ static void set_cpuid_after_run(struct kvm_vcpu *vcpu) TEST_ASSERT(!rc, "Setting unmodified CPUID after KVM_RUN failed: %d", rc); /* Changing CPU features is forbidden */ - ent = get_cpuid_entry(cpuid, 0x7, 0); + ent = vcpu_get_cpuid_entry(vcpu, 0x7); ebx = ent->ebx; ent->ebx--; rc = __vcpu_set_cpuid(vcpu); @@ -165,7 +164,7 @@ static void set_cpuid_after_run(struct kvm_vcpu *vcpu) ent->ebx = ebx; /* Changing MAXPHYADDR is forbidden */ - ent = get_cpuid_entry(cpuid, 0x80000008, 0); + ent = vcpu_get_cpuid_entry(vcpu, 0x80000008); eax = ent->eax; x = eax & 0xff; ent->eax = (eax & ~0xffu) | (x - 1); -- 2.36.1.255.ge46751e96f-goog