Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3788758rwb; Tue, 16 Aug 2022 08:47:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR5GZ3twmo1qTGlxk0fnxV2kdry7uHOSDnLow8rQq0uwUMN6rpKpgO269aMS7AgTg6jXU4F5 X-Received: by 2002:a17:906:5d07:b0:730:9e98:8fbf with SMTP id g7-20020a1709065d0700b007309e988fbfmr13733524ejt.610.1660664842302; Tue, 16 Aug 2022 08:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660664842; cv=none; d=google.com; s=arc-20160816; b=PsCaOobG+2CDemXSEp1cZ/zfhcNmpfkMNqKLr6rJ8IFD5ytpv5WzNE0guxY0wBBMAg zPvniU8niRwjobqML/hlg+zU5JCP9nKZpSEu/emc3Z+uyfHBLqILsRg9HhXM07l1zde+ yJoxMV/63X/c2XEt6ZoX7bLSfUQ18r3Wuru8aVp+inPtfQpvQQETpavvtOD+7+Dd9YGu HSr/Cetexv9jNbjrhfxWIKgCoB+dE2lVKoiD3d8eQSixRw+w/Hzy4Net0quxDh+IuVcg 5skHJaNMHTdF+M6rDdjs81I5TWdYnSOxbP8q/7Nmu8ECuXk+og6kBvYYyKTB68N+EYUy GMAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=n4zdtnTMg/Nj0u62JjmBzedy558TEd0PMQVz2MXl/JA=; b=viIM7fAOJ7fYBjs9woDyLfpNmiARNkDCLB3n+Fgxnb3hM/DWL0pYrLgiTkr3i9yMX2 alfsVupGcJWeqXugQcliBoxdrMKtk6A/vwObCPRDFP/fltKDaDdGuMxxxaCfq7ncTSY/ ygSfCp0Mm6xyED+f2TjLDh0RSKIbgvoUViCqyrHjmUN+zGEad/Td/rq2WxcT4KlGxgml 0UGFGuHNpY+Ryr/YPlxLt9oZJYCZTgDCEuv5EUnPQ0pF0VG7b8BbcV2XnkiNBxVJ2Cwk wFaF0t3kEsz/p8kMDrltodtT70lw0s4WXlhnMdnYLfQCP32b6wUG6p4JqG/rUVyLJfXR K/SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=jX69LCaE; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb31-20020a170907961f00b0073123a3bea6si11529981ejc.769.2022.08.16.08.46.56; Tue, 16 Aug 2022 08:47:22 -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=@linux.dev header.s=key1 header.b=jX69LCaE; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235416AbiHPPct (ORCPT + 99 others); Tue, 16 Aug 2022 11:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234793AbiHPPcp (ORCPT ); Tue, 16 Aug 2022 11:32:45 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBDD13FA3A; Tue, 16 Aug 2022 08:32:42 -0700 (PDT) Date: Tue, 16 Aug 2022 17:32:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1660663960; 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: in-reply-to:in-reply-to:references:references; bh=n4zdtnTMg/Nj0u62JjmBzedy558TEd0PMQVz2MXl/JA=; b=jX69LCaEZn5f8TYNbLo+3A+OqmQSfDaJ+6VXs6m01AdYhuBWmsz93qw3mCB4G9nhAHZsGb YxuOplEghsk1IsGe1Q4jvuUP3zon3FxfSWafscdgwO2qhzus0uk7p4dixihA9uzpLBUA8p ZA4Piyw07DUZfGw2dNkXr75ahf5DB68= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Andrew Jones To: Peter Gonda Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, marcorr@google.com, seanjc@google.com, michael.roth@amd.com, thomas.lendacky@amd.com, joro@8bytes.org, mizhang@google.com, pbonzini@redhat.com, vannapurve@google.com Subject: Re: [V3 07/11] KVM: selftests: Consolidate boilerplate code in get_ucall() Message-ID: <20220816153239.gvehm3wj2wat6pke@kamzik> References: <20220810152033.946942-1-pgonda@google.com> <20220810152033.946942-8-pgonda@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220810152033.946942-8-pgonda@google.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, Aug 10, 2022 at 08:20:29AM -0700, Peter Gonda wrote: > From: Sean Christopherson > > Consolidate the actual copying of a ucall struct from guest=>host into > the common get_ucall(). Return a host virtual address instead of a guest > virtual address even though the addr_gva2hva() part could be moved to > get_ucall() too. Conceptually, get_ucall() is invoked from the host and > should return a host virtual address (and returning NULL for "nothing to > see here" is far superior to returning 0). > > Use pointer shenanigans instead of an unnecessary bounce buffer when the > caller of get_ucall() provides a valid pointer. > > Signed-off-by: Sean Christopherson > Signed-off-by: Peter Gonda > --- > .../selftests/kvm/include/ucall_common.h | 8 ++------ > .../testing/selftests/kvm/lib/aarch64/ucall.c | 14 +++----------- > tools/testing/selftests/kvm/lib/riscv/ucall.c | 19 +++---------------- > tools/testing/selftests/kvm/lib/s390x/ucall.c | 16 +++------------- > .../testing/selftests/kvm/lib/ucall_common.c | 19 +++++++++++++++++++ > .../testing/selftests/kvm/lib/x86_64/ucall.c | 16 +++------------- > 6 files changed, 33 insertions(+), 59 deletions(-) > Reviewed-by: Andrew Jones