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=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 D1D88C433E9 for ; Tue, 9 Feb 2021 10:00:37 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id DAFAC64E9A for ; Tue, 9 Feb 2021 10:00:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAFAC64E9A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 42D324B782; Tue, 9 Feb 2021 05:00:36 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4Vxa72-0y6bg; Tue, 9 Feb 2021 05:00:35 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 577034B783; Tue, 9 Feb 2021 05:00:35 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8F1404B781 for ; Tue, 9 Feb 2021 05:00:34 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N6UVWZpI2JqA for ; Tue, 9 Feb 2021 05:00:33 -0500 (EST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8004C4B73E for ; Tue, 9 Feb 2021 05:00:33 -0500 (EST) Received: by mail-wr1-f43.google.com with SMTP id b3so20854346wrj.5 for ; Tue, 09 Feb 2021 02:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qm0cSL/QtRytmHGpisi5xpuLYYaM91e4VtafX8yXdgA=; b=Qu2b01DvtGYXJeJxDXNNE1KeI4fwXHqTFP9NUINIClmyovM1EXyaAgdMtyphaqcPjz BW240oE/Ro+4mYQ1ho1diep6tj3gk7c8M0PWNQLRph+DujYRBkt+OZiYtke0CFce7jNu eWWChjHaBXyma6Xojt/HIqFpTZhtiIr0lUinDES0r/155umcLvlXYF1CdiDmsr5kDpdc 7+6EjCub+DdSxNlJS+ueD7dMv83ZN0AEi4wyB90rziN/G7o5cmaehpvfAuHpWq/wNyIT WjeOv5dbYzTilYNyXTp8Us0S0ITCiDcb8eVCd4CLm/L+uBwK1C5FbMuA2YsxK3110zzh ng/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qm0cSL/QtRytmHGpisi5xpuLYYaM91e4VtafX8yXdgA=; b=Rtx49z1t3oILuUspXUDULKrYWv/0RjsEfuAPjQBcUFNCmr2/F1/tNd1NSXw2HdQmJP 60j5MBGEnaEwsPCc0RJ53uzAjtydML8pbar+iDI6vX22VyOCx3iKQeeOM7G/LBXIGBeW tuxvBSEtF5i5uHm0pROpE9K9Hcc6dJ/rmmSA9c4pLjzYA9tIRQolrF+2woRHOSJbpEHI wrOj6HRh2onzFlbYd+PDHt0tDulc5YJp5WaJ7XBXj9AnOijN9StZpfvtZIUncdje+8u1 0zBZN/kiGF1bacjvd1KDpmN0tqObFYMMX0bY4zR0tx1v0sWy1TWxzqIk4YPwaSyXXHIA c3nQ== X-Gm-Message-State: AOAM530XEisBWuwGscHw5MnxKqTDPDsP8fKdTWZjFJX6xyZXAFpBkFNz sDWwa1Rqjs1cH5VJC3SQ2jEryg== X-Google-Smtp-Source: ABdhPJyXLvE+jYOfb0Dy90ik3YsfWn6xHnuNbVcZCVLQKV4b7h1RDaJQVeB4jpjHc7njZBq4PHZhFQ== X-Received: by 2002:a5d:43c2:: with SMTP id v2mr12217582wrr.81.1612864832295; Tue, 09 Feb 2021 02:00:32 -0800 (PST) Received: from google.com (230.69.233.35.bc.googleusercontent.com. [35.233.69.230]) by smtp.gmail.com with ESMTPSA id m6sm3113718wmq.13.2021.02.09.02.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 02:00:31 -0800 (PST) Date: Tue, 9 Feb 2021 10:00:29 +0000 From: Quentin Perret To: Will Deacon Subject: Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection Message-ID: References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-17-qperret@google.com> <20210203143709.GA18907@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: devicetree@vger.kernel.org, kernel-team@android.com, android-kvm@google.com, Catalin Marinas , Fuad Tabba , linux-kernel@vger.kernel.org, Rob Herring , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Frank Rowand , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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. Thanks, Quentin _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-4.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 2C6B0C433DB for ; Tue, 9 Feb 2021 10:01:53 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1BD564E54 for ; Tue, 9 Feb 2021 10:01:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1BD564E54 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Rfxng8/WoDyVCnydiyn18ZxdnVqgSEihVi+LC4PlG14=; b=K6OiiVZws6lg1yVtWQ1rnaSJR 6WwN4KuB//FF5jLW3M8cGRRNS6iyn0SpSZK4UbuvvJmR227xPmejkZ6ksYCHaqiTFLVUZwBtclC7e zAiPoy0NJvHVtNzlcjm3oJVPr7fl0bJrEjHlA+t/4dmN8Ij/z6Dq3jN5cOJGJ5RlpYf6y7lINqimB Tmv5nmrMFUlUdZKMrF408kG1RuNjX4HIL6fxoRc6nUELFir5VfNJcMnHiIc6BB20+T9ernk3VL6Ev Ui/9aHAlA9hCL/aFOjawIWs+4sZbMT+7rdXRH/6kIK9/aYtx4OL8VN6mhW7RPv7PNn8UZbO6YUrXE fvZoA17cA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9Pp3-0002N7-DK; Tue, 09 Feb 2021 10:00:41 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9Poy-0002KB-2k for linux-arm-kernel@lists.infradead.org; Tue, 09 Feb 2021 10:00:37 +0000 Received: by mail-wr1-x429.google.com with SMTP id r21so4629353wrr.9 for ; Tue, 09 Feb 2021 02:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qm0cSL/QtRytmHGpisi5xpuLYYaM91e4VtafX8yXdgA=; b=Qu2b01DvtGYXJeJxDXNNE1KeI4fwXHqTFP9NUINIClmyovM1EXyaAgdMtyphaqcPjz BW240oE/Ro+4mYQ1ho1diep6tj3gk7c8M0PWNQLRph+DujYRBkt+OZiYtke0CFce7jNu eWWChjHaBXyma6Xojt/HIqFpTZhtiIr0lUinDES0r/155umcLvlXYF1CdiDmsr5kDpdc 7+6EjCub+DdSxNlJS+ueD7dMv83ZN0AEi4wyB90rziN/G7o5cmaehpvfAuHpWq/wNyIT WjeOv5dbYzTilYNyXTp8Us0S0ITCiDcb8eVCd4CLm/L+uBwK1C5FbMuA2YsxK3110zzh ng/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qm0cSL/QtRytmHGpisi5xpuLYYaM91e4VtafX8yXdgA=; b=jnjmMVm3zJInFVovj3YKtjxgS8lRjw/G86d7ISk90hqRkQ0zsJp7gV3JBBSyF7+09R qmhw6SGGLmPLGSBosU67RN26Sd/g29QXmusCdMnGnkNd2oFMIIAltSAf9XhDfaig2j4I 6V0USg84b0pSAM8eHUqtnCuuVmcVGUMQLHbsaP6mFeYNuUlW7nOExipHljjGfEVGxP7I 0+cCz1dWLd7jDE+GKORyK4oSf8W+gjtCkyeu55/TpNmYrSCh/u/FWEsR0MV9xVSE2O2S FI6av6rJxApAQb7eR/0XCi9qNhFtnyPmRfK9bDHtXq1REyRsTCuIhtD7nIO4hRxX8FEl 4+5g== X-Gm-Message-State: AOAM531Q5eXyiGqVvT3B6b5xDvWqRFNe4pWeaJysWKttVKwnECynayNd gaXiXBo5/aA3XU223n+ZBbN3hQ== X-Google-Smtp-Source: ABdhPJyXLvE+jYOfb0Dy90ik3YsfWn6xHnuNbVcZCVLQKV4b7h1RDaJQVeB4jpjHc7njZBq4PHZhFQ== X-Received: by 2002:a5d:43c2:: with SMTP id v2mr12217582wrr.81.1612864832295; Tue, 09 Feb 2021 02:00:32 -0800 (PST) Received: from google.com (230.69.233.35.bc.googleusercontent.com. [35.233.69.230]) by smtp.gmail.com with ESMTPSA id m6sm3113718wmq.13.2021.02.09.02.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 02:00:31 -0800 (PST) Date: Tue, 9 Feb 2021 10:00:29 +0000 From: Quentin Perret To: Will Deacon Subject: Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection Message-ID: References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-17-qperret@google.com> <20210203143709.GA18907@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_050036_209391_34D2F730 X-CRM114-Status: GOOD ( 13.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, kernel-team@android.com, Suzuki K Poulose , android-kvm@google.com, Catalin Marinas , Fuad Tabba , linux-kernel@vger.kernel.org, Rob Herring , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , David Brazdil , Frank Rowand , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Thanks, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 9F853C433DB for ; Tue, 9 Feb 2021 10:03:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 531D464EBC for ; Tue, 9 Feb 2021 10:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbhBIKDS (ORCPT ); Tue, 9 Feb 2021 05:03:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbhBIKBP (ORCPT ); Tue, 9 Feb 2021 05:01:15 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD88DC061788 for ; Tue, 9 Feb 2021 02:00:33 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id g10so20895128wrx.1 for ; Tue, 09 Feb 2021 02:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qm0cSL/QtRytmHGpisi5xpuLYYaM91e4VtafX8yXdgA=; b=Qu2b01DvtGYXJeJxDXNNE1KeI4fwXHqTFP9NUINIClmyovM1EXyaAgdMtyphaqcPjz BW240oE/Ro+4mYQ1ho1diep6tj3gk7c8M0PWNQLRph+DujYRBkt+OZiYtke0CFce7jNu eWWChjHaBXyma6Xojt/HIqFpTZhtiIr0lUinDES0r/155umcLvlXYF1CdiDmsr5kDpdc 7+6EjCub+DdSxNlJS+ueD7dMv83ZN0AEi4wyB90rziN/G7o5cmaehpvfAuHpWq/wNyIT WjeOv5dbYzTilYNyXTp8Us0S0ITCiDcb8eVCd4CLm/L+uBwK1C5FbMuA2YsxK3110zzh ng/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qm0cSL/QtRytmHGpisi5xpuLYYaM91e4VtafX8yXdgA=; b=rloEj9CfuvxdzlAiGlGXNIJ8ZRJueLi1bu4ZrHuSZoO8gjVqD+TDexax7VJm/3gKsy 0mH6fm26cOqo1l3VD5FG/KrtD3xK6jgqlw4fhHQveA30h0S10AMRpKsR7Duw9XJhDQZ2 7u8L2xyD0oiQ0as+MgILC5bgYjqabQ4EEvAu6LQ9RLARKaGkxNYN6Ex7jwifPzK1vU8Z wH47DJVZc3DcE/LaNGHz75Y8SkppzgSf1Do1h6dC2MAGOBmFKP52ICWyHGSbC67RYdJ+ Sd3rj1fExpFH79aJ8UfXUfoKI7SF+L2Sh2W02IxVEIFQkZ9PK/CbLpj2jy9cz902EcrU PLQA== X-Gm-Message-State: AOAM533bMtVIWmc+TwiSruUqfEdFoq0WMzI3PbSRk3f3IoXd5ZTdNNvK rApe5t9xA/E19fg//xbebtTNyg== X-Google-Smtp-Source: ABdhPJyXLvE+jYOfb0Dy90ik3YsfWn6xHnuNbVcZCVLQKV4b7h1RDaJQVeB4jpjHc7njZBq4PHZhFQ== X-Received: by 2002:a5d:43c2:: with SMTP id v2mr12217582wrr.81.1612864832295; Tue, 09 Feb 2021 02:00:32 -0800 (PST) Received: from google.com (230.69.233.35.bc.googleusercontent.com. [35.233.69.230]) by smtp.gmail.com with ESMTPSA id m6sm3113718wmq.13.2021.02.09.02.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 02:00:31 -0800 (PST) Date: Tue, 9 Feb 2021 10:00:29 +0000 From: Quentin Perret To: Will Deacon 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: 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: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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. Thanks, Quentin