From patchwork Tue Jul 18 23:45:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13318163 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13BFAEB64DA for ; Wed, 19 Jul 2023 05:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID :References:Mime-Version:In-Reply-To:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HAmx4HboKAfN2zabjZs6ans54W3azPH9GuQejnsnjco=; b=iLHi2EczqoLhgB vXnjvX5kzUp7o95M/AsKMBSCvkIzD6edmaBEERd8pWhDr/nMQxusBcL3TordOt/rf3leGw3u2NOBT Z8yiWcxqq2y0CeqN1AvAii8IDy8nceN1IZOe9X0q6oAgK8n5M8wl7sxm+4sZDUGJpIVQ8Oj3BfSsU Bho9T2ywaIncN7vUguzrkOSqHKLqblLlUMNoW6O3FPUEtwsde9u7hSMBNMUUWgCukGbjfK9i8nUtm yX20YPyUO3NJgnC7GWQL454YMSzeUCNY1zXMAcPRjn4ltINRBx28U+BZBvq5UgCcDTUWm7y3nylaE fRIDlbKXfMDG3sOMzTrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qLzcI-005EVU-2u; Wed, 19 Jul 2023 05:20:51 +0000 Received: from casper.infradead.org ([90.155.50.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLzbP-005Dg5-0j for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jul 2023 05:19:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To:Sender: Content-Transfer-Encoding:Content-ID:Content-Description; bh=AUBNLiIlxTx1F6mRQya+iPZZUvsAoMeHoSeivXTBAJs=; b=Av+7EMVOPYo1+yUP8BCz2fbvRj VVATsXgkjPes1bs2DUQY70WOe5VSJLdV350CxhbZFYIWS4wHbtRRXXtoBh1cLVy1vn+9naajzQWdK fmnZlIDxrJYzKVD5p10/qs5A30Vi5CM33+2a5eQave8mEQCrySYS12I6Qdi5jIYO56uxhuZKmVh2X b1m6uzVyzK5LuP5otEzFuaWH0kjis/GrhMN8jUJ1pbMF9g1mp7p9AAsD127W6rB2lAOhLBN00vCs9 /E+ITcoQeW+994tEPW1CFT/TB+MKBCRhl2RVJ5UQs01tpUpwwVsDzEk6OhuAcRvFu6XCZSIFYIyS8 01paUgqQ==; Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1qLuST-005Qv9-Cq for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2023 23:50:24 +0000 Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1b89e3715acso32243695ad.3 for ; Tue, 18 Jul 2023 16:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689724158; x=1692316158; 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=AUBNLiIlxTx1F6mRQya+iPZZUvsAoMeHoSeivXTBAJs=; b=m1E5CQsRhxPohHIaVjXNzAfw9sKja8GxErI8tb88+m9ohtM/2UTUV4KI0EStxpO4aq e3MZZP48Hes3EH+ziFJ16ESLBaMphjB9wBUbLKvQFLpYn2bcEMb9Uv2TfKXvMSlsG4ax +5bc2E2M24iRgByLib+vhoObgGZN9pfMuLHGBIbrmouSiZYtP7I+o1+DUjs0jJquORQM WZA9ZhPgQfZ0ViRdW+5zM3kLeIAxBI958QaGMn+cpDeKcYSO3MEZRWesl52iNilZN/Ay f7w1zt9jHHbnKZaxjQB9PYpmQD1oIBOzEUWtcHD4Ui+04jNinOeJzuhQDL4PbgsMw1sC a+1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689724158; x=1692316158; 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=AUBNLiIlxTx1F6mRQya+iPZZUvsAoMeHoSeivXTBAJs=; b=dw15+0Exrt+ZfI0zE09uCzN30dOg1Ks6EVP92gjAcsZdpauW5R7w8wqR1iVy8KbGZC CfmjmSjNC4ZTQ+7m7aCBrjA8a1zi9q/R72NbYw4f/1VUnjg3z9esbaDkfzzVkG5QnwmM 6so4J7QkGINFXvgrhyUO8YMEo2w4oLwVNrPLfgEoPm9xwlNiE9+ftraJthleYRdKLh5v ZAub3yIw4z6mj7uHvMHRXUUNRog1N+g5TvQiHKLrOEiTPbAfNKxKrto48+fWvrgPchfJ FW2jhyB54XS0iir7X8lna+tRCblbJnjN4kMkNPdVRAjdlJUeDlssGeYNV8HSgvJN+IHn 5QWw== X-Gm-Message-State: ABy/qLb4u4srcRbioF7UWLvHHTUV0ER/imwIj/zgpPYlhcIEZ3FD6Edz ypS6jv0HxOnNaQYIqFjhL68Sv1fqUOU= X-Google-Smtp-Source: APBJJlGZj18kUtv2DZbfIQmZu2TXCF9UTMkYGVm3bO/BF1sxl/m3e0941s7v3QsOSVZsOvdKY/T33+qfBEc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:d4c6:b0:1b1:7336:2637 with SMTP id o6-20020a170902d4c600b001b173362637mr16836plg.11.1689724157723; Tue, 18 Jul 2023 16:49:17 -0700 (PDT) Date: Tue, 18 Jul 2023 16:45:07 -0700 In-Reply-To: <20230718234512.1690985-1-seanjc@google.com> Mime-Version: 1.0 References: <20230718234512.1690985-1-seanjc@google.com> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog Message-ID: <20230718234512.1690985-25-seanjc@google.com> Subject: [RFC PATCH v11 24/29] KVM: selftests: Add GUEST_SYNC[1-6] macros for synchronizing more data From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230719_005021_456843_FB2FD6FB X-CRM114-Status: UNSURE ( 6.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Sean Christopherson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/include/ucall_common.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/testing/selftests/kvm/include/ucall_common.h b/tools/testing/selftests/kvm/include/ucall_common.h index 1a6aaef5ccae..8087c877fd58 100644 --- a/tools/testing/selftests/kvm/include/ucall_common.h +++ b/tools/testing/selftests/kvm/include/ucall_common.h @@ -46,6 +46,18 @@ void ucall_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa); #define GUEST_SYNC_ARGS(stage, arg1, arg2, arg3, arg4) \ ucall(UCALL_SYNC, 6, "hello", stage, arg1, arg2, arg3, arg4) #define GUEST_SYNC(stage) ucall(UCALL_SYNC, 2, "hello", stage) + +#define GUEST_SYNC1(arg0) ucall(UCALL_SYNC, 1, arg0) +#define GUEST_SYNC2(arg0, arg1) ucall(UCALL_SYNC, 2, arg0, arg1) +#define GUEST_SYNC3(arg0, arg1, arg2) \ + ucall(UCALL_SYNC, 3, arg0, arg1, arg2) +#define GUEST_SYNC4(arg0, arg1, arg2, arg3) \ + ucall(UCALL_SYNC, 4, arg0, arg1, arg2, arg3) +#define GUEST_SYNC5(arg0, arg1, arg2, arg3, arg4) \ + ucall(UCALL_SYNC, 5, arg0, arg1, arg2, arg3, arg4) +#define GUEST_SYNC6(arg0, arg1, arg2, arg3, arg4, arg5) \ + ucall(UCALL_SYNC, 6, arg0, arg1, arg2, arg3, arg4, arg5) + #define GUEST_DONE() ucall(UCALL_DONE, 0) enum guest_assert_builtin_args {