Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4908972rwb; Mon, 31 Jul 2023 14:32:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGBmCS688UI4PvA9ofWSStNyjEuJzLycsByDg1i17l8glFowqS8Tz3lgtLUW9jWZEVBagJP X-Received: by 2002:a17:90a:5504:b0:268:1237:1943 with SMTP id b4-20020a17090a550400b0026812371943mr13103639pji.18.1690839156917; Mon, 31 Jul 2023 14:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690839156; cv=none; d=google.com; s=arc-20160816; b=c8XGrwYQD/HsWW/2naZWNRqq0d2VAPpfk+Ag1TV9P6D5N7V7b1LjSQxpgXFACgt0MX MgnnMbxTbnhymu28vtNpaCijF/lzNq4x4tMPwMk1uaiyw978/k8aChvSl7kACpgNPtKl JpRqKWfkUK625UQh0BEC5ivoP0RjJE9HCMyLNnFrriyOgR9m2DD2Nw0vnL/+TDxC3UQW TuM+FJhMtAVxiDiGq9DMb3UHIggWEsbD/hIglFcWQ0570yBj+54sfUA02OgaZMjqOZxK Li4easnuVMipNPKQm8ZWtvtTm8F/kRxEme8WgEp6l39D3aQycGCDmbRzo7PE97uEyh4Y ESmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=j/i9xkXUzFsa6Pkem09fqHIKArwnqvvallRasjUEu/Q=; fh=CXR3vSfwk/Rbs0FKAI5Y7o7qtIeup4nYBa963sMIKmw=; b=l+1r14F2YXfLj2iJeP9fz1z1NKzR0grt9y8K9U8i3tsffAisTJ9Yn+b+8+XUAJ6PWK fkjnohWWiaabxsqfKy9TIvX3hwkoDEyNoYwo+yUUIMRiSKcWKRgdsPJMppmB4T5/TNRe HmDKVQbl2kmZFqDhGTpURQUyxReVoYTADqRMbPBidMtRuro+zJPocH4YgrkRHwvpXkCI lvn38BNOmmuHj4+jg00tnedXKJFvOI8/PpjzH4L728Jf/6MwgbZS0J9rTrc1igfyVSit JnrW9vf8uJrax6OMpfjtZpjfEzLwPc5v7uYDC5f/lHmzS1VRwOdDh+ELBGD+C8TgPGDR 0NDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="ol/D1vn1"; 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 c4-20020a17090a8d0400b0026390b4a4e0si9234382pjo.124.2023.07.31.14.32.24; Mon, 31 Jul 2023 14:32:36 -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=@google.com header.s=20221208 header.b="ol/D1vn1"; 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 S230451AbjGaUai (ORCPT + 99 others); Mon, 31 Jul 2023 16:30:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjGaUaf (ORCPT ); Mon, 31 Jul 2023 16:30:35 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DED0E52 for ; Mon, 31 Jul 2023 13:30:34 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-58473c4f629so51483227b3.1 for ; Mon, 31 Jul 2023 13:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690835433; x=1691440233; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=j/i9xkXUzFsa6Pkem09fqHIKArwnqvvallRasjUEu/Q=; b=ol/D1vn18oUZ3ioRq0LZxOfrfi4QKNP+IZMw82UVNYZJEQrg2p9TSQdhmZ557zjjK8 YNLay9PTTld/yHQCES78q6zZA15L8qfGm2yWGPxnyouCaj3qwYLG7n+hX9/Z/TiGB1XH ZVFtjTev1VmpfWObXi4tKIdIa0k97i1lFZRWxpr9fL/ucywTEMv5u1QquYLWoaag9TDq steoZtkQhU1j9PzEHd09Pwvd+ClCnQ4gbS1TpSLnbEIoJaoWg5RhujHskm+ScEWrcmpE OhllDSmtXMn5tlecwjurFBTPTPfmxFpH32EowR/qsMrK7SL96pfS+/1oBQPBcKz4O17M evGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690835433; x=1691440233; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j/i9xkXUzFsa6Pkem09fqHIKArwnqvvallRasjUEu/Q=; b=eIYmXGXTWzfiW7T8PzHWFiiZpIyUl5qJuk4N60JI0WKEoQNPFdxuwdQM9G+jYeRmYn o08d+J9/zxEXySji2kwtx9RjGxisVVTC13bXN9Cjvh0/nYa2Sa/+v6MDqiiD5moSTMPi dPNSuRz1Y/8MoeDms0zA3gLjMxr10cABPJNE1C8a2ZYEQGnsoR+P1ejCQIjumrYE7ID9 NMwOy8dpl5BDILKRiFPBYm7FXBFvsBkUSmtQDZxr55LUY/EVqp1fSx/EtB+Wg3DnTb0g CidLKKjHV+zVDqYcST+AhWXyJEn/CGcqcih2dFRnHE2yTEpxOQ63PKxJ3X6rpvqM88cR ZaiA== X-Gm-Message-State: ABy/qLZohSugazMTLgK7/UHz/VJdX9K7HTgDYwhvZ+STNz6DkkdudhVT y2m1znZZ8DHgQ5+VwEIHmk5j3y+Y/oA= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:70a:b0:581:3939:59a2 with SMTP id bs10-20020a05690c070a00b00581393959a2mr85126ywb.3.1690835433789; Mon, 31 Jul 2023 13:30:33 -0700 (PDT) Reply-To: Sean Christopherson Date: Mon, 31 Jul 2023 13:30:25 -0700 In-Reply-To: <20230731203026.1192091-1-seanjc@google.com> Mime-Version: 1.0 References: <20230731203026.1192091-1-seanjc@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230731203026.1192091-3-seanjc@google.com> Subject: [PATCH v4.1 2/3] KVM: selftests: Add #define of expected KVM exit reason for ucall From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Christopherson , Andrew Jones , Aaron Lewis Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 Define the expected architecture specific exit reason for a successful ucall so that common tests can assert that a ucall occurred without the test needing to implement arch specific code. Suggested-by: Andrew Jones Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/include/aarch64/ucall.h | 2 ++ tools/testing/selftests/kvm/include/riscv/ucall.h | 2 ++ tools/testing/selftests/kvm/include/s390x/ucall.h | 2 ++ tools/testing/selftests/kvm/include/x86_64/ucall.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/testing/selftests/kvm/include/aarch64/ucall.h b/tools/testing/selftests/kvm/include/aarch64/ucall.h index fe65fdf4f0d3..4b68f37efd36 100644 --- a/tools/testing/selftests/kvm/include/aarch64/ucall.h +++ b/tools/testing/selftests/kvm/include/aarch64/ucall.h @@ -4,6 +4,8 @@ #include "kvm_util_base.h" +#define UCALL_EXIT_REASON KVM_EXIT_MMIO + /* * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each * VM), it must not be accessed from host code. diff --git a/tools/testing/selftests/kvm/include/riscv/ucall.h b/tools/testing/selftests/kvm/include/riscv/ucall.h index 86ed0500972b..be46eb32ec27 100644 --- a/tools/testing/selftests/kvm/include/riscv/ucall.h +++ b/tools/testing/selftests/kvm/include/riscv/ucall.h @@ -4,6 +4,8 @@ #include "processor.h" +#define UCALL_EXIT_REASON KVM_EXIT_RISCV_SBI + static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa) { } diff --git a/tools/testing/selftests/kvm/include/s390x/ucall.h b/tools/testing/selftests/kvm/include/s390x/ucall.h index 47ad4b1fbccb..b231bf2e49d6 100644 --- a/tools/testing/selftests/kvm/include/s390x/ucall.h +++ b/tools/testing/selftests/kvm/include/s390x/ucall.h @@ -4,6 +4,8 @@ #include "kvm_util_base.h" +#define UCALL_EXIT_REASON KVM_EXIT_S390_SIEIC + static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa) { } diff --git a/tools/testing/selftests/kvm/include/x86_64/ucall.h b/tools/testing/selftests/kvm/include/x86_64/ucall.h index 05cc69b0d550..06b244bd06ee 100644 --- a/tools/testing/selftests/kvm/include/x86_64/ucall.h +++ b/tools/testing/selftests/kvm/include/x86_64/ucall.h @@ -4,6 +4,8 @@ #include "kvm_util_base.h" +#define UCALL_EXIT_REASON KVM_EXIT_IO + static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa) { } -- 2.41.0.585.gd2178a4bd4-goog