Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3081030rwb; Mon, 15 Aug 2022 17:39:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR5buXYZ1P67D1N9rnvLNoKGLxpLpsyA78ssIVCoqh43No/bWQ9gabFTD/5IG3A+sqe9oWFr X-Received: by 2002:a17:906:7309:b0:731:5c2:a9a6 with SMTP id di9-20020a170906730900b0073105c2a9a6mr11966045ejc.486.1660610369391; Mon, 15 Aug 2022 17:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610369; cv=none; d=google.com; s=arc-20160816; b=YRWZZfB7vGNUFCJc3+YvmtTOHlnAoUpkUNaMHzqdQZharorMlGYfUV/Omy35xSk40Q lQTY5TZQsNrdbJVINmf5rQFTYPws9hr3ZrsJOuwCPnakG8MSx37W1Lq89V6rLBNfgL4j ap8ZCbaQhHSNocl66BXMjhGc4vUapX9kzqtFqh+yfWSwH7zKg1X7v9LhfGM/V9VTAEZ0 4/ZDeIgO+xIM+FcIpiJ+RYaLrTfMaunoKQbdQMzvxNjOaw6w7CLNh93dsAbc6fwsOEmO lGFK+tuQePT/68Ps3Nw6K79+5qD+HL6YNjQsjeF33l8/ldAVUO3b4FZlhK5KdFZV0Bad Y8BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bpBpSgh8JWzelMakX1k9QhNmfeXrQyuz8OC9HTYAYhQ=; b=zgYZLj5zMzggj19Y3kBJDAMW8yYkO662ybQrVcQoDxpIUNN0IWpOXZVtYEeIvVD1gb PG7Ro1CthMtahJPEFePLCXfew3Qd3K05bqrXbx3+KUUMn0hqI4QWOKlS8A3iSLXQ3Oz+ lsmCkfXFO6VaPu4qiIhNEBcPIKpqeM+SKrnFjXzAg9I4LY6LZ1Q6/jEqMAe/TbUH1pS8 OvgTVBgFY7sdplxX0EPKZDF5RD4k+eAxnjrvnzxfbScBnDkxRvOKk1UdsRz6ObZmfTb+ /3cWk3H3InCerSw0t5AYyYw4P08T09dODRn7cNbBmhq1rlL+ZtmOghQS4TQyEhgahCkX w2HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KzGHOxpn; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he33-20020a1709073da100b0072f0a99a61asi9576075ejc.617.2022.08.15.17.39.04; Mon, 15 Aug 2022 17:39:29 -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=@linuxfoundation.org header.s=korg header.b=KzGHOxpn; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351935AbiHPAUi (ORCPT + 99 others); Mon, 15 Aug 2022 20:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357631AbiHPAN5 (ORCPT ); Mon, 15 Aug 2022 20:13:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 147C8178C34; Mon, 15 Aug 2022 13:30:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 32BB3B80EB1; Mon, 15 Aug 2022 20:30:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81BBCC433D7; Mon, 15 Aug 2022 20:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595432; bh=94xa95o8KqgbjETlbVwuPqDvmR7RMIi6Gf8mC9KqAAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KzGHOxpndLkRBVAqtN52TBgNsZsftMuPviFP9kJjd6YBOufAsY3B9wCccNzL5vSb8 fZlhqqwnb4Fz4fodm7bXF+vflq0pr0074TJbgL/Zr3Mm01m1PhDcwzfCckULa+pHW5 lUVg4o0JPtGcIxzkvJSnXCdXbqnxM5i13J/X7Gz8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Christopherson , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.19 0730/1157] KVM: selftests: Convert s390x/diag318_test_handler away from VCPU_ID Date: Mon, 15 Aug 2022 20:01:26 +0200 Message-Id: <20220815180508.661549997@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Sean Christopherson [ Upstream commit 7cdcdfe50d8d68b7b9ba2e1b0345ff47fdda390f ] Convert diag318_test_handler to use vm_create_with_vcpus() and pass around a 'struct kvm_vcpu' object instead of passing around vCPU IDs. Note, this is a "functional" change in the sense that the test now creates a vCPU with vcpu_id==0 instead of vcpu_id==6. The non-zero VCPU_ID was 100% arbitrary and added little to no validation coverage. If testing non-zero vCPU IDs is desirable for generic tests, that can be done in the future by tweaking the VM creation helpers. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- .../selftests/kvm/lib/s390x/diag318_test_handler.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/kvm/lib/s390x/diag318_test_handler.c b/tools/testing/selftests/kvm/lib/s390x/diag318_test_handler.c index 86b9e611ad87..21c31fe10c1a 100644 --- a/tools/testing/selftests/kvm/lib/s390x/diag318_test_handler.c +++ b/tools/testing/selftests/kvm/lib/s390x/diag318_test_handler.c @@ -8,8 +8,6 @@ #include "test_util.h" #include "kvm_util.h" -#define VCPU_ID 6 - #define ICPT_INSTRUCTION 0x04 #define IPA0_DIAG 0x8300 @@ -27,14 +25,15 @@ static void guest_code(void) */ static uint64_t diag318_handler(void) { + struct kvm_vcpu *vcpu; struct kvm_vm *vm; struct kvm_run *run; uint64_t reg; uint64_t diag318_info; - vm = vm_create_default(VCPU_ID, 0, guest_code); - vcpu_run(vm, VCPU_ID); - run = vcpu_state(vm, VCPU_ID); + vm = vm_create_with_one_vcpu(&vcpu, guest_code); + vcpu_run(vm, vcpu->id); + run = vcpu->run; TEST_ASSERT(run->exit_reason == KVM_EXIT_S390_SIEIC, "DIAGNOSE 0x0318 instruction was not intercepted"); -- 2.35.1