From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38CB8C433EF for ; Tue, 21 Jun 2022 14:41:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351686AbiFUOlK (ORCPT ); Tue, 21 Jun 2022 10:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351436AbiFUOlI (ORCPT ); Tue, 21 Jun 2022 10:41:08 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 167BC24F06 for ; Tue, 21 Jun 2022 07:41:07 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id f16so11895776pjj.1 for ; Tue, 21 Jun 2022 07:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JOicc8moSgPUHZwRa0UCLUvVifYA0qTN8DaBzCizOgw=; b=cKCuyyDnkfNQBL6avZcuKqgcaAnrDgGaMrPVXHKS56JghxcscK9NoNnj3Fq7/NVRC+ oRVzrbe4sEZRyZOqRivaOWFZO8Gd7vthX9YgbDCc1RkeiGegxd0pyZQqGZ/UzgMt5ruJ MaD7F/sfEkQoWFzd4qxP745PX7p+Gml77tWHRrjRjkZiJB4Si0+QNOhldE61LLtgrKtz z7nAckxCBVmBlyIGhrdH+2BUYxEDwzsjv/pBBt1WZ1hcXBLEmjxXq9UXzk0BiNzqacIe VkYCNWJt/9iPC5J8GLSnvPOdHVjKAoDqjVqKQeMuB+EOm3tQprFc1Ew0wMXup3tiDdCK rfwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JOicc8moSgPUHZwRa0UCLUvVifYA0qTN8DaBzCizOgw=; b=Eo13eu+DoWMgwx6g78Cc0JtMacplQ2LUiheh5nP+QCghcgDwPJn/g8K3hvJji8l6oh qB9q0U4MXD6ZulI0OT6zF9GXxXAUDkElL1itJRDydw0UWzeB9UkZXOrWaRl3J0qkOaJa NcaxXcVp6T7/AgxG+Ux2U5K3dSFQUav8Ebs7BXeq2UO0ir7qMcr1Hr+GFbipm6nA3nEN cicBHTYUhaIDAjhwL3wzoXfzDJSvKFEzIuBmFv9zcGaQWqq5FbDPzbNMwjZL4ZpZ9wN5 NreGAz4LmzV8+8y+OH+qARNxtVGW4iT+eV5m0CCUkA0MRk/41DlOYdcHZjoqpXeavyJi W7DQ== X-Gm-Message-State: AJIora/8p0W3DpyonZtKA4KWoFsC/2Q+xuLuhZHyJT3X6G8C9442QMPS IvIT7iW6+G5kV0KXvqsaD6EKLQ== X-Google-Smtp-Source: AGRyM1vJrRABFv+Um9W+VY7dY1s+g55BsfMNsbio+5fYQj4/zIQK6olfXAORs7KW0GbN7wK+7Xjx+Q== X-Received: by 2002:a17:902:ab87:b0:162:26cf:bf7a with SMTP id f7-20020a170902ab8700b0016226cfbf7amr28637304plr.168.1655822466277; Tue, 21 Jun 2022 07:41:06 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id s17-20020a170902c65100b0016a091e993dsm8269986pls.42.2022.06.21.07.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jun 2022 07:41:05 -0700 (PDT) Date: Tue, 21 Jun 2022 14:41:02 +0000 From: Sean Christopherson To: "Huang, Shaoqin" Cc: Paolo Bonzini , Marc Zyngier , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Colton Lewis , Andrew Jones Subject: Re: [PATCH 2/3] KVM: selftests: Consolidate boilerplate code in get_ucall() Message-ID: References: <20220618001618.1840806-1-seanjc@google.com> <20220618001618.1840806-3-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Sun, Jun 19, 2022, Huang, Shaoqin wrote: > > > On 6/18/2022 8:16 AM, Sean Christopherson wrote: > > 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). > > It seems the get_ucall() returns the uc->cmd, the ucall_arch_get_ucall() > returns a host virtual address. Yep, get_ucall() then does the memcpy() from guest memory via that host virtual addres and returns the resulting ucall command. The intent is that the arch hooks are not to be called by common code.