From patchwork Sun Nov 5 16:30:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13445926 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2AD8C4167B for ; Sun, 5 Nov 2023 16:34:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 83E5544016D; Sun, 5 Nov 2023 11:34:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EF14440150; Sun, 5 Nov 2023 11:34:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68F7C44016D; Sun, 5 Nov 2023 11:34:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 56297440150 for ; Sun, 5 Nov 2023 11:34:37 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2BE40B5174 for ; Sun, 5 Nov 2023 16:34:37 +0000 (UTC) X-FDA: 81424448994.27.43A7E0F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 6F2A340010 for ; Sun, 5 Nov 2023 16:34:35 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LwnNgzXD; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of pbonzini@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=pbonzini@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699202075; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tZSxOU/afb1AYemia9RbTGAHPmX5iyTSarNrb86gzhc=; b=Bp7c0NrPm5Aic0M84yW9ZfwzpfEVTchuES55nnu/T60kXKAkmpyLkqilqOqr9mTeS/cu3U rt5CmN+tnDj2U0t1TVh5dcsqDMtXBEHyzUsUiTfhjqeO9+PjqklTlmMusXQ3DCIol+NLC3 tliY36l38d9jZTEtkd74s/eIAdFa+Kc= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LwnNgzXD; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of pbonzini@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=pbonzini@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699202075; a=rsa-sha256; cv=none; b=SYisqwKE2oDh5KqasoVPhwA1zVpAj1pCcQ3sObNNBK0qN4KQTVYpGHUXNjiEDKp38vKK16 N97Fz2ksd95IMG85XNAYiaPqqWKXJ2C8DsvzqZaFPhTVppO5X8jgM7WdOcDj/Qotyjhd+x o1+11XvfYFuzjof1PSQ+RzcIEiBkjMM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699202074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tZSxOU/afb1AYemia9RbTGAHPmX5iyTSarNrb86gzhc=; b=LwnNgzXDzmRdxi5LZmvdYmD4jKi505VIOl0j4v9cCNIrubXEwf5/Q/P1QCS+L8sdkHjLzs ch4A/8hn0JuunPtgfg5+ASdp/RX2vwO0ZYNbmNBau4BeuU8QyfdGZihSkFdG+2J6sehd+M ewHEo2KbuZpR6Zup6KF9T/dXvv/0F78= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-472-1AZxmGEfNPitrzdXhM_Ldg-1; Sun, 05 Nov 2023 11:34:28 -0500 X-MC-Unique: 1AZxmGEfNPitrzdXhM_Ldg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49FC238117F2; Sun, 5 Nov 2023 16:34:26 +0000 (UTC) Received: from avogadro.redhat.com (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AF502166B27; Sun, 5 Nov 2023 16:34:18 +0000 (UTC) From: Paolo Bonzini To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Sean Christopherson , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton 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-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , =?utf-8?q?Micka=C3=ABl_Sala?= =?utf-8?q?=C3=BCn?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A. Shutemov" Subject: [PATCH 28/34] KVM: selftests: Add GUEST_SYNC[1-6] macros for synchronizing more data Date: Sun, 5 Nov 2023 17:30:31 +0100 Message-ID: <20231105163040.14904-29-pbonzini@redhat.com> In-Reply-To: <20231105163040.14904-1-pbonzini@redhat.com> References: <20231105163040.14904-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Rspam-User: X-Stat-Signature: hdtupnnq7uk9gii6k5drtnkfa18jwdxj X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6F2A340010 X-HE-Tag: 1699202075-252999 X-HE-Meta: U2FsdGVkX1+bbJ6vO/Qvb7166KUoqmWcWoA5M4HLuX8eDecvgwFz+EMzZCFCsy7UGRV3735tzkubgvOIUs+7r6UPdDH2ingR8zz5LlcXcf1HOmH2UhO2z/5rCGkdFKCF6jEUX4FEv2WlRZCidAt7zPdAqUWImDEgIKb7wxtVhnZ2kNFJJhJbO4MBZZ5gPc4bFbeOSjKc9u5zct45PzWZDSfjYj1nyo4DGLbbKmxHwi1JTM2WCS3CaEn9Fgh4VKQYD4kmWrchKCTCxazsa78xiVc13thiPEs+8HGTplhy2ZqUqHPPePFBki7At0TW1rqdC1XXaFoN6zQE8k4hkyN/dNF5sBzRD19/cr7BREzQ541MfRhic2oV2SUhSu3WukuEc06qKMkWzA3VihnBBTXfzaFC7vzfkdH85DXSIcBURJYJZ1Ej6WpdGF9jlF2XEAKqwSfUy4p1b2QYIQBmM4+l0HecXz9kBsyE7hArMRCjDZf6nlTbC1VExDkcrWJGgwucJtG4KToF9E+fG27aP0oW9v3/RomlvPOLblWhtRHNZ6oUBwLjpyi3wXipreEcLX4jdQtSHDox99pvYMOu8KD0oMjkvuPVrDioOsOQhhhDxlcJhvSLenrcE7LXVPRv660KU8MXKr377WGkiuDmaOwG7lR9NOHcBrKRPCVmopG7RmoTqpBp8Zy+TEz3BMFjDFqRdo0/RHxDHipC01W8kz5TgtdazfCS7FFhk9JqzjIzrFLeUks3fljlW1qdUMt2pXldHcdFEuir5uYJPLcp26FH6AaGa8IiNNvenPz9yeD8gqOEZ7T/4UM7rNmRQErE+lIJljh/QQi/8SSbiZC+8dj02WbRo4r7vwOTFQqgY5u/kaPGgBvq4uDn7iTTzRYUoP+DnOOlR1G+ZgpFKWOoZJIG01iWYZaGXotpHhvT910krgmv5S0raNQyjDyQPXvw2tQuSUr8X2ZIVTGGlfXKXRI 5eWOCA/D DRJHn0V4OMeP9eIRPd0o+smQNnQzvtNkiM9G/KTwL7dOkdjAcyf1SqULNV8/eAa8m1hZ5RANww68bcq35sVflY6kDWKgtMo4esMYSQX+55BkM1Bb3enJd9UOeAz5nPJwtxzJ6M9cY+Wx+X9hBEFe6Z7nXS0tVRE9jiu3yHa63v7c7tcfEtc3liYLYmd06Me7LnNHVhYbuWaKXU3icqSgOD73UOBe1MRy8NAPFQZAJd6UPO8sI6hEG7nzlldJ1B/0M4JYpqHcL3MeTvWny4EwdAu/2TTDwFRn2IPhKGs7iz0i2djJ9qJI9VU/ol+a6ForwFOnz X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Sean Christopherson Add GUEST_SYNC[1-6]() so that tests can pass the maximum amount of information supported via ucall(), without needing to resort to shared memory. Signed-off-by: Sean Christopherson Message-Id: <20231027182217.3615211-31-seanjc@google.com> Signed-off-by: Paolo Bonzini Reviewed-by: Fuad Tabba Tested-by: Fuad Tabba --- tools/testing/selftests/kvm/include/ucall_common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/testing/selftests/kvm/include/ucall_common.h b/tools/testing/selftests/kvm/include/ucall_common.h index ce33d306c2cb..0fb472a5a058 100644 --- a/tools/testing/selftests/kvm/include/ucall_common.h +++ b/tools/testing/selftests/kvm/include/ucall_common.h @@ -52,6 +52,17 @@ int ucall_nr_pages_required(uint64_t page_size); #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_PRINTF(_fmt, _args...) ucall_fmt(UCALL_PRINTF, _fmt, ##_args) #define GUEST_DONE() ucall(UCALL_DONE, 0)