Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp920779iog; Fri, 17 Jun 2022 17:33:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tjsKu2PFFny4xPosYUqUVatA6SWoBREvUomGjhXvKZEjsaY5kxIS2r8qxep8qZrI88IOWG X-Received: by 2002:a17:906:99c1:b0:6fe:b01d:134 with SMTP id s1-20020a17090699c100b006feb01d0134mr11564999ejn.598.1655512423962; Fri, 17 Jun 2022 17:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655512423; cv=none; d=google.com; s=arc-20160816; b=fc1To5OO4FXORNXuxEvOWaG9RDDTuswV10OZ3UNmC2xf7qthzlHIeQ4TOBvuzTd2U6 2gdCgKHokyrjrz9paHkzxYD4NIPiEp81EGfwHE0WE2H3H6kwOE4s8zfROjrfGAzNkOxD yUvIBW9TVdQed1tOdPNrHOOitD+x89AsUZzOOJfZezmzbdEqZMuylYNTgnrshgohhC7w ncr+Jjh7kGLNrW/Y7avyiBHOcD0WhvjCLbmhebp35j9gq1JytKxGiS6Qal/gR3p5/ULN XtUOsCgfpKSwNzFF12SARWd1uuOIGGKFFi1h/VG/fVPcQUkV61CEjjksQBCzK6X6WDBV QsGA== 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:mime-version:message-id:date :reply-to:dkim-signature; bh=4HlwtKsrcUiP4ezxQu89E9aBkat4STQcCRUlQRJmlM4=; b=WjfSh5n9/sAWNjmzyvopqoYiicJACKVm9vH21rSHg/RJoWNBI64VGIhG5NflR85uJl ZuzI+xxKbvhi3BEXI/+1MjvXqK2w6YEGiNCF4oylUdiXWxhqRi9Wcohqx0yIf/ES9SZn LSSnnzVcLRDtmNUnZ57QG+HWixdAGjI9B9z8Vxv6lK43vnrAstCfWMePThwG+7S0v9dB ie9LO/oyL/qfuzL4zhm1VBBbU84v6Y00RkX0rxHjrtKw0phUOhF1X52B0mZ3TyxYEjpd f9uq0xCUPlnCpdpxK3AFht04TL/sZCsuGZzAMxthjB989yOifs42EizX0UdZ3/ZtUVaJ 7OIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cqH7RwM3; 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 s25-20020a170906779900b007121245806esi5530194ejm.952.2022.06.17.17.33.18; Fri, 17 Jun 2022 17:33:43 -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=20210112 header.b=cqH7RwM3; 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 S1383235AbiFRAQZ (ORCPT + 99 others); Fri, 17 Jun 2022 20:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238420AbiFRAQX (ORCPT ); Fri, 17 Jun 2022 20:16:23 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 658191C919 for ; Fri, 17 Jun 2022 17:16:22 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id m5-20020a17090a4d8500b001e0cfe135c7so2898917pjh.3 for ; Fri, 17 Jun 2022 17:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:message-id:mime-version:subject:from:to:cc; bh=4HlwtKsrcUiP4ezxQu89E9aBkat4STQcCRUlQRJmlM4=; b=cqH7RwM35eUa9gSH23Vyp0IXD8rbHQ6iHBYjzqYB4r/ApR3GiB5irQq91CvaOTU2a/ JbiD+lO3mhGF7Q9VF8Z+RL2N3kcJKkwfgbC11BxFaQhlTH5WcSxRdyy/VhMTgegBEuWE m0ICZIKBakq6kG4UrIJM1l7DZgPfrlXNTJzqVOW/b/BDjaQn7NZ1PZDqtivgtVVTA1vf J3LNa6ebna+9KeWC2sraxN7xZP7PZA5oz+Ft9ZxR6ro5zNG2FCSpgajvCr+Yw7sr0lRJ GloAY8IFUzs+m+0goppunIS/0Ln/zHmwSHJByc2TnvMQ/Qh39U6cvZifZQqRqYSCI5Ep Y1SQ== 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:message-id:mime-version:subject :from:to:cc; bh=4HlwtKsrcUiP4ezxQu89E9aBkat4STQcCRUlQRJmlM4=; b=auZt00gDg7Y0YQeN/y/llBjq9ora6FjPE6FA0Rref9bXtvYI6oBXQmRXWwz/FRp4DD Dej9Ed61Idwle4M3Suyov1hj76WXetVgOudpjACM+l/jSOMCeG5oOLDa69G3pCGdfy0W xzskOWgZn1IAsNAq19rQmfdoNmawnLZvVHj6qsleEcPPIx+FazeZREDvqvNHQgKx/S7v dbRGESv3GfW4VFPDSX+8Tr9ZZGXUlY14QfGmNo8Qh0QuFvTIRfD3O/xklm8rUFBxPyBR eJiPOzs/jzy5BkFd8R3uTFoHaKZK1HzqysctzIQxc264Q0MzOcmCcpwGKxHnlSydOixQ wbvA== X-Gm-Message-State: AJIora8Z+Mg1TMInv8IxJBqQ5gpXjxkentC3BxT3qOkSW0JHN8NIBv6K VJ1qnvXKS/guY1WH7y1LSTCclU9tgiY= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:16d2:b0:522:81c0:a635 with SMTP id l18-20020a056a0016d200b0052281c0a635mr12877654pfc.0.1655511381838; Fri, 17 Jun 2022 17:16:21 -0700 (PDT) Reply-To: Sean Christopherson Date: Sat, 18 Jun 2022 00:16:15 +0000 Message-Id: <20220618001618.1840806-1-seanjc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.0.rc0.104.g0611611a94-goog Subject: [PATCH 0/3] KVM: selftests: Consolidate ucall code From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Colton Lewis , Andrew Jones , Sean Christopherson 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_NONE, 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 Consolidate the code for making and getting ucalls. All architectures pass the ucall struct via memory, so filling and copying the struct is 100% generic. The only per-arch code is sending and receiving the address of said struct. Tested on x86 and arm, compile tested on s390 and RISC-V. Sean Christopherson (3): KVM: selftests: Consolidate common code for popuplating ucall struct KVM: selftests: Consolidate boilerplate code in get_ucall() KVM: selftest: Add __weak stubs for ucall_arch_(un)init() tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/include/ucall_common.h | 17 ++++++- .../testing/selftests/kvm/lib/aarch64/ucall.c | 36 +++----------- tools/testing/selftests/kvm/lib/riscv/ucall.c | 44 ++--------------- tools/testing/selftests/kvm/lib/s390x/ucall.c | 41 ++-------------- .../testing/selftests/kvm/lib/ucall_common.c | 49 +++++++++++++++++++ .../testing/selftests/kvm/lib/x86_64/ucall.c | 41 ++-------------- 7 files changed, 87 insertions(+), 142 deletions(-) create mode 100644 tools/testing/selftests/kvm/lib/ucall_common.c base-commit: 8baacf67c76c560fed954ac972b63e6e59a6fba0 -- 2.37.0.rc0.104.g0611611a94-goog