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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6D75C433FE for ; Tue, 18 Oct 2022 16:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=95m698TzHTGZJOxq/M1yBeUMzv0uG99jIzr0B6oxeTE=; b=bCMZJxSG+9KBnp XLj2GQrzDczyZ0GAomxbezn+G6/opf4LCTYag1FMnauc+avGI0gwa3ky/Ep+eP60ye+3fZ9SeqXZm VCzS6U1vT3Tc2wzqAk1I2GQZ6YeficViP3lK0qmXp7SUU/SZ5ib+eJ11KBRC/wpQQ72XyHCpd9+KA s86Qnq4oBv7XVy28j60L0Q/qFoXsJBofW+X+FVu+d+plVn8jV8sX5Lxr348RckwddOl7LpA8i+mi3 5rdZ50mEnlCgpxbwyzc14nzh8AN2fgNHooO1Ld5KBEt8kw1PpNXRLrQ0W/fccqD1fGpQB4snSplBs /mH5fmrifcQvaMFZgo0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okpLE-008wUx-8P; Tue, 18 Oct 2022 16:21:20 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okpLB-008wUO-J2 for linux-arm-kernel@lists.infradead.org; Tue, 18 Oct 2022 16:21:18 +0000 Received: by mail-ej1-x629.google.com with SMTP id d26so33490773eje.10 for ; Tue, 18 Oct 2022 09:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DMD6KRfAh8gLsTdSq1azk8KGRzliZHblOOH99fliBBo=; b=eBasbqc45ny3TsN5xHvPYR0nIt0QFeQUPu9c7yPZZOds5097P3BJ2iGt4wRvIS9tEs MQXUQQUsNjgY0fpAODB0YF3wYff2bSXANslnUInSERSXgNnTuN5AIVlIdXP/iz/aI3X+ GpQJ3Rs0eYEM+gfkzYqhYJfC46Px/ETHHCZsR7P0im57GjJyGQG1iBRY1b88haggOhOg 1qBG96EWS/D8Vm75+m1lJZ3sDzKcFMccO7Dwzdyd0eOs+FHM9TASIL+jgiicEDBZuNhV RwL9DybM9+ce3O9iDMzolgdPgxOhI5kXqeP1WGQ70AQkXlbD5KDc5OFbEUaBjCOtaGYE zozg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DMD6KRfAh8gLsTdSq1azk8KGRzliZHblOOH99fliBBo=; b=GNL3VGmhHJiPSwslRUmpAGzJAS3pBvpqoZQxVlN5VoNtJjwr2OdCzKigKICTKH0bEW RlJTreQ+Mra+DOp6C/sOEtVloSWhCzcJ8iMXhtK/Jmp6gRa/RnjmK/Ptoau/80Cn+7b8 1K9AGr5gcjYs82W0SCdiWCwpwijpPExFyikROObuKur4nP8sh86Rm7EL0HBYBTLXDa38 nu00CWYmkNogirrSKVstv1CfUwzl+ugA14BuvNGzT/ycOBvKNf4SKqQ6qN9zXtq3GpCh p9b1wlbelVo9uNKQxG8f/cdiUjBmmXfkYQUictUHrWpakxPnQk5qmsCiVhxO3lh+bdy3 Vg8A== X-Gm-Message-State: ACrzQf0YPwJgyckyYdAkq3/O5iW07HLC6BgkLFiRCFFxHJtlVp3MPUSY E8c2T6KE3j1wuZxOREiwqFEtWg== X-Google-Smtp-Source: AMsMyM4R1wfcxR2Oe0g2nQCwfd6EAIfKtbPVegiEAjUE+BZ0OMN8V8O7plKwhNwKvZQiCe6VCI2RRA== X-Received: by 2002:a17:906:8a4b:b0:78d:d475:ff74 with SMTP id gx11-20020a1709068a4b00b0078dd475ff74mr2983068ejc.131.1666110074863; Tue, 18 Oct 2022 09:21:14 -0700 (PDT) Received: from google.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id fy19-20020a170906b7d300b00781dbdb292asm7716920ejb.155.2022.10.18.09.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 09:21:14 -0700 (PDT) Date: Tue, 18 Oct 2022 16:21:11 +0000 From: Quentin Perret To: Will Deacon Cc: kvmarm@lists.linux.dev, Sean Christopherson , Vincent Donnefort , Alexandru Elisei , Catalin Marinas , James Morse , Chao Peng , Suzuki K Poulose , Mark Rutland , Fuad Tabba , Oliver Upton , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 12/25] KVM: arm64: Add infrastructure to create and track pKVM instances at EL2 Message-ID: References: <20221017115209.2099-1-will@kernel.org> <20221017115209.2099-13-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221017115209.2099-13-will@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221018_092117_644207_1B854C78 X-CRM114-Status: GOOD ( 15.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Monday 17 Oct 2022 at 12:51:56 (+0100), Will Deacon wrote: > +struct pkvm_hyp_vm { > + struct kvm kvm; > + > + /* Backpointer to the host's (untrusted) KVM instance. */ > + struct kvm *host_kvm; > + > + /* > + * Total amount of memory donated by the host for maintaining > + * this 'struct pkvm_hyp_vm' in the hypervisor. > + */ > + size_t donated_memory_size; I think you could get rid of that member. IIUC, all you need to re-compute it in the teardown path is the number of created vCPUs on the host, which we should have safely stored in pkvm_hyp_vm::kvm::created_vcpus. > + /* The guest's stage-2 page-table managed by the hypervisor. */ > + struct kvm_pgtable pgt; > + > + /* > + * The number of vcpus initialized and ready to run. > + * Modifying this is protected by 'vm_table_lock'. > + */ > + unsigned int nr_vcpus; > + > + /* Array of the hyp vCPU structures for this VM. */ > + struct pkvm_hyp_vcpu *vcpus[]; > +}; Cheers, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel