Message ID | 20231105163040.14904-29-pbonzini@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2209403vqu; Sun, 5 Nov 2023 08:38:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9YmSserVyoVi/BkJRrwgS1LUgJ2p6R8uilDnQT/XWQxsBWKxorG4UTKQeC908Uf9ra7Q3 X-Received: by 2002:a05:6a00:2d14:b0:68a:6018:a66f with SMTP id fa20-20020a056a002d1400b0068a6018a66fmr11042841pfb.2.1699202306891; Sun, 05 Nov 2023 08:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699202306; cv=none; d=google.com; s=arc-20160816; b=dOkynNA+ZUYwwSs4tr+fP75L1GLxGL7y65dKU1lifpuN7Fw36vH55RONRGlKhVJOMI YZbnMgrqPKJmsV/T9dJyp88/G1zGuTNBaMTal3P6orGUFjUvI5WyU8hCNR5/UaTqUGK2 pbyGXJM1ArHn6hrIzMojRS1dvNWgkcmUJjuyX03TYCDa12A6ZzhpHsta4cBgRzgXWbH8 CSCF/jQ4TGPc/hDqPSj+cPA4DbICb9gduPwvIhq5+SdW8EV3Z1UVrLspFsso5zgYCCbf eeyNn7lmbjpW/U01BC/4XwrBmCnL7eTe8IpDBnTWCKYztaHPJbZZxOwdIL02KfQS/4q3 7lMQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tZSxOU/afb1AYemia9RbTGAHPmX5iyTSarNrb86gzhc=; fh=HrMuB0qA2qw4RqBwyiyN+RBlGw+Ob1hcALwHW/PphXs=; b=t8Vqla+YZiEF1GXVsdGHH1M+dxVyAOTXsWUKjPqzjUE1bDzgy6oUKlOU97CgxDU6rr prpNmuCxdeftxitE+b0yngw1F8XWgGwyeg/nVt0Txq3rO0e/S0U04ezWIVP1RN47IQaV oU0H+r1qVJn1ylA+UCYdwuso3nqyFFiBXgLAI5bAXJSMEgGv5CYbcie88uU+RxcS8Taa AGrZc9WCCb7TZkGoGkVcZF8PQ0qlJf9ymOOQU6CNsughgjO9aSeMiD2fxn7u7i9pAtyt IUYezWaYoHMl7S1Dr2qUj53hLbfJ+/az9+6JvvP2iZvZDnpBsrmNPbSEgtQFX+g+HS80 IzVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZMBbeGb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n3-20020a056a0007c300b006bf1f9bb921si5904955pfu.120.2023.11.05.08.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 08:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZMBbeGb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0CF718058039; Sun, 5 Nov 2023 08:37:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjKEQg5 (ORCPT <rfc822;heyuhang3455@gmail.com> + 34 others); Sun, 5 Nov 2023 11:36:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbjKEQge (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 5 Nov 2023 11:36:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92F81FFC for <linux-kernel@vger.kernel.org>; Sun, 5 Nov 2023 08:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699202071; 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=ZMBbeGb6nd91O61WQx6VXIpsTikvwAxqh2/Z/XjtRQqORCTTB7SH5Bz8Jrb07zfNZLHfuO 6r0WdUASn84fH8i2ePFlTLVeuLk8UZVlQOyoVSyhViVZfq57GPufttTnzk3sgOynlnKXwu Ezmt6ph5fnH8agmD071JSRLPmMvAj54= 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 <pbonzini@redhat.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, Huacai Chen <chenhuacai@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Sean Christopherson <seanjc@google.com>, Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Andrew Morton <akpm@linux-foundation.org> 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 <xiaoyao.li@intel.com>, Xu Yilun <yilun.xu@intel.com>, Chao Peng <chao.p.peng@linux.intel.com>, Fuad Tabba <tabba@google.com>, Jarkko Sakkinen <jarkko@kernel.org>, Anish Moorthy <amoorthy@google.com>, David Matlack <dmatlack@google.com>, Yu Zhang <yu.c.zhang@linux.intel.com>, Isaku Yamahata <isaku.yamahata@intel.com>, =?utf-8?q?Micka=C3=ABl_Sala?= =?utf-8?q?=C3=BCn?= <mic@digikod.net>, Vlastimil Babka <vbabka@suse.cz>, Vishal Annapurve <vannapurve@google.com>, Ackerley Tng <ackerleytng@google.com>, Maciej Szmigiero <mail@maciej.szmigiero.name>, David Hildenbrand <david@redhat.com>, Quentin Perret <qperret@google.com>, Michael Roth <michael.roth@amd.com>, Wang <wei.w.wang@intel.com>, Liam Merwick <liam.merwick@oracle.com>, Isaku Yamahata <isaku.yamahata@gmail.com>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> 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 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 05 Nov 2023 08:37:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781742757879377706 X-GMAIL-MSGID: 1781742757879377706 |
Series |
KVM: guest_memfd() and per-page attributes
|
|
Commit Message
Paolo Bonzini
Nov. 5, 2023, 4:30 p.m. UTC
From: Sean Christopherson <seanjc@google.com> 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 <seanjc@google.com> Message-Id: <20231027182217.3615211-31-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- tools/testing/selftests/kvm/include/ucall_common.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
Comments
On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini <pbonzini@redhat.com> wrote: > > From: Sean Christopherson <seanjc@google.com> > > 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 <seanjc@google.com> > Message-Id: <20231027182217.3615211-31-seanjc@google.com> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > --- Reviewed-by: Fuad Tabba <tabba@google.com> Tested-by: Fuad Tabba <tabba@google.com> Cheers, /fuad > 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) > > -- > 2.39.1 > >
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)