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 X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AAC1C433E0 for ; Tue, 9 Feb 2021 12:24:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF70764EB9 for ; Tue, 9 Feb 2021 12:24:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229464AbhBIMXz (ORCPT ); Tue, 9 Feb 2021 07:23:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:56290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbhBIMXv (ORCPT ); Tue, 9 Feb 2021 07:23:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CFB4664EB4; Tue, 9 Feb 2021 12:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612873390; bh=L+CvYP2l7yxFcu390LciJ5wzeQ4zlYr5y+5yTYVenYA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LDSUx5Wy/6WXXiafzKEK/f2JAMCSwNDd8U9cvhpFPM6vk0Mg9SCYWzpf41Fw00BNT NuiGBA6Fxs4ZBiRYT7xF28QYktSPLVTV0Qu9MxT9SFh35axTZGqekyQrTtRkIhOFPC 2N8+Re1ScL4ZFotJE4gNLw/5KZo5FqGXIG6S8nyCGVQFwe46xsZbi275T6tRngYX5o 635JJP4Nh2sRTaUfygmLKAzzXF3EPHnWdUjwgzQL/tGfUYXzpHENg6mtfhmzfYCnCz aElTv+gkpGxAPFlb6u8nxWqDH9daBoPGppZZbCziF4YVldt+9Eev+4UKyrY9o5VhAo jPRrXPoki0DnQ== Date: Tue, 9 Feb 2021 12:23:04 +0000 From: Will Deacon To: Quentin Perret Cc: Catalin Marinas , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, android-kvm@google.com, linux-kernel@vger.kernel.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Fuad Tabba , Mark Rutland , David Brazdil Subject: Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection Message-ID: <20210209122303.GA27058@willie-the-truck> References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-17-qperret@google.com> <20210203143709.GA18907@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Feb 09, 2021 at 10:00:29AM +0000, Quentin Perret wrote: > On Thursday 04 Feb 2021 at 10:47:08 (+0000), Quentin Perret wrote: > > On Wednesday 03 Feb 2021 at 14:37:10 (+0000), Will Deacon wrote: > > > > +static void handle___pkvm_init(struct kvm_cpu_context *host_ctxt) > > > > +{ > > > > + DECLARE_REG(phys_addr_t, phys, host_ctxt, 1); > > > > + DECLARE_REG(unsigned long, size, host_ctxt, 2); > > > > + DECLARE_REG(unsigned long, nr_cpus, host_ctxt, 3); > > > > + DECLARE_REG(unsigned long *, per_cpu_base, host_ctxt, 4); > > > > + > > > > + cpu_reg(host_ctxt, 1) = __pkvm_init(phys, size, nr_cpus, per_cpu_base); > > > > > > __pkvm_init() doesn't return, so I think this assignment back into host_ctxt > > > is confusing. > > > > Very good point, I'll get rid of this. > > Actually not, I think I'll leave it like that. __pkvm_init can return an > error, which is why I did this in the first place And it is useful for > debugging to have it propagated back to the host. Good point, but please add a comment! Will