Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3852978rdb; Thu, 14 Sep 2023 05:00:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHu4WSekRVnJ20sMXu70UCM7dX4AU2H1WvCYaYEzbgW8ePPosVKzX8iBk3iu3RYQ9uhRBb X-Received: by 2002:a05:6a00:340d:b0:690:2ab8:2d67 with SMTP id cn13-20020a056a00340d00b006902ab82d67mr1644705pfb.1.1694692825048; Thu, 14 Sep 2023 05:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694692825; cv=none; d=google.com; s=arc-20160816; b=xCpMl8o5Yz3hNT/CJe0c27mpAbq/Pt21fSJA8t4mBUgwcRh2g3KI692jrjk3wMWKbO dFSY8fHLy7tRVWc8teNuvftjP0kEUDlMws6qFsSiF4r6t90zBlvtUiOr87Vnhz0OMkkL MRneumDOVLs8SJEiKVgdQrVdV0XBxVLIypzEUGbsv+auLthKnNXAQlaiPIf9+JYxsGZ5 DQKHmtaWqhiALU7hlj2pOZbExfjyjctdGw+b0GAyA18kzqmk7ccIPNAntg374fuRzxQd zsdbhiqrTy16sztNV/8XE/XcIctnTb38tdoquTMGCARC4tROAgBujyGRVhZZFqW/bZmS ZbIQ== 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=Vjv0zC4RrtxbIkJLIAO5e3EhKuQZW28HjcF6ypERxIg=; fh=61hsfVoef5Tbbo+Rm06/Hxsz4fAtyORDF8Po5ZVRZDI=; b=nAQrPwaYxBdxAcB4CJdrYwm0VR54z+5tFcwPRUIpgCQaF5yIY1t5Jy2Ekt/rIuCJZp GMuVXR0/CSqhkfWBWn0rdD5LNuvs8+rgBnjgs6mAnwQg3R0Sawbb8K5bT+s2/4tr9hZv qPB7WlAI4M3Rcx5roplWp0WhvI0KffkLJh5M90LaBjr5/lFytlFSBeBC/jpSErMXX4oH axHpvVkenZNeQr+/hgEnwiNDXLJkcXr7gj1MuNboW/qo/1dbMGX7gUmFua2NJXzg6AsQ PLRFqPEslI6KFKOz4W+MDe1fFuOmotp0CdjM43rLakxgGaWzQL4IGdzas5K3EymPXJLH F66w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4dEdCKgs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d134-20020a63368c000000b00566016fc08csi1385675pga.83.2023.09.14.05.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 05:00:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4dEdCKgs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8A5D08328AE8; Wed, 13 Sep 2023 19:01:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234837AbjINCBE (ORCPT + 99 others); Wed, 13 Sep 2023 22:01:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234251AbjINB77 (ORCPT ); Wed, 13 Sep 2023 21:59:59 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D6F33C0A for ; Wed, 13 Sep 2023 18:56:32 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1c0c3ccd3d6so4000925ad.1 for ; Wed, 13 Sep 2023 18:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694656592; x=1695261392; darn=vger.kernel.org; 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=Vjv0zC4RrtxbIkJLIAO5e3EhKuQZW28HjcF6ypERxIg=; b=4dEdCKgsqAUfA71gJDGn1QkhjWkryjd4tWQSydavJOoANvp/FtV+Br8R0i1zeosT3Y u8pvf7DfZ8MHlLpx2+B3bj7hUFd7pFeNJPnwR3f+bRUa38lwP1kOt1Pp5T/X4ZMWLUx7 s1o9dH78hruSsEApGeTQuP+TKkGaZlSggRV7vwNwF739cPJ8WAgLjdLVVWZaeUJTWN9S OfbOmimZGumNiujKk3Ydfl2B1x9HG901OBVUL/c3lLv3JYZvI5b0ZvfbvuxJSCkGdvlG OydBaR5ujEvrTFiOuFZiWEuPFp9bWOar6/5nW/qVCcOifbAiW0IuWtjlcA3Cm3zHyg2w WXfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694656592; x=1695261392; 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=Vjv0zC4RrtxbIkJLIAO5e3EhKuQZW28HjcF6ypERxIg=; b=EGkGg9rOFqEfuKD8ueHzfv9QQaqISfrJFzwlf82ZKV2eRW0yV8oydRML9HvnqPoSWx Mx/JQDmKZj9Gcf3jIBy7TEPUwfKHK7vCT0ZncWFkkVazoUcDrrzzoLH2U6ZzG8nP7QTp t2OsLEE6nyT3GZ6XQRu0X+7FZscI0Pe41y1PjRBKc5g10H0sUO3inpdcmZneZF6Q/EpO K6wO16AVJDNYEXVGT/si2EtNkhYOAL9y6SrszyJWWhD74DONQ4t4+fDtBaEyPyf1r9FE aeeKNnM7F7Ef0ITZ0fjDv/gLanSqrrCc5uUu57Qweix8y+13ZZ0RCbQ3dQoAGV/CPI6e KfIQ== X-Gm-Message-State: AOJu0Ywahzfyv/pYOBitW32xP8efkUzYY8T6k9qcVkXUKj3mRVKyZzmk p3y94p4Gn9t6mEi0o5hcQvmRGqjN678= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:e551:b0:1c3:a4f2:7c85 with SMTP id n17-20020a170902e55100b001c3a4f27c85mr212223plf.6.1694656591946; Wed, 13 Sep 2023 18:56:31 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 13 Sep 2023 18:55:26 -0700 In-Reply-To: <20230914015531.1419405-1-seanjc@google.com> Mime-Version: 1.0 References: <20230914015531.1419405-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.283.g2d96d420d3-goog Message-ID: <20230914015531.1419405-29-seanjc@google.com> Subject: [RFC PATCH v12 28/33] 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 , Anish Moorthy , Yu Zhang , Isaku Yamahata , Xu Yilun , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 19:01:10 -0700 (PDT) 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 --- 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 112bc1da732a..7cf40aba7add 100644 --- a/tools/testing/selftests/kvm/include/ucall_common.h +++ b/tools/testing/selftests/kvm/include/ucall_common.h @@ -54,6 +54,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.42.0.283.g2d96d420d3-goog