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=-0.5 required=3.0 tests=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 EE402C47254 for ; Tue, 5 May 2020 17:24:02 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 79F29206FA for ; Tue, 5 May 2020 17:24:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="EkW9V00O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79F29206FA 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 F029D4B259; Tue, 5 May 2020 13:24:01 -0400 (EDT) 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 km3Thg4-tCND; Tue, 5 May 2020 13:24:01 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0129B4B273; Tue, 5 May 2020 13:24:01 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9CB354B259 for ; Tue, 5 May 2020 13:23:59 -0400 (EDT) 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 aSO-gKkuxKsb for ; Tue, 5 May 2020 13:23:58 -0400 (EDT) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 7C43E4B208 for ; Tue, 5 May 2020 13:23:57 -0400 (EDT) Received: by mail-wr1-f68.google.com with SMTP id h9so3741689wrt.0 for ; Tue, 05 May 2020 10:23:57 -0700 (PDT) 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=NP9OIn8aZdjTBigvGWGYSxvnTPBy4fLFwfAKc1uTAGA=; b=EkW9V00OjSI1/ZNXcCO2ShjrxSwU48K+ycq1QjcEjdt3BdAlSmprqkST87DvkZHvW6 ZST12Yx3Rb0hndsh0l00CBau1Cf/oUxPDSegLM2wOvjW1oZ3mmLe0HrIFVwsaRMHLtrL y3EQDmTJY3lxI8pEKjhAA6jzzy6MwcCmS+GPtwseWuLaLEnXfYr7xFTByvjD01hW8yUn S12b0kRAP1CFSiKlwbTKv522AqxGPAVXHH8FQa97RDrW6lN1ipc+585tSMIzHup4aeoq bLHoC1L2d8tR/2XjckmTJfAB2Ip64/EXbwM+aGRIlTpnRSysscymNoa3RnH8fsebos5U 2lXQ== 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=NP9OIn8aZdjTBigvGWGYSxvnTPBy4fLFwfAKc1uTAGA=; b=ixk/2hRTu8pv0k3ftj77d9PmDZJ7gEueBPhdRKq0ZXFZquTt6CGlc/W4Y+2cJtX1Yp KfjGxpkKdQKuLIWsrmg7PuyxWNSdnTZCJ98+7Uum3j1DuOmfNYFwfLjUTqHqq/Vplrnx zQaqBiS8MLcagqj68Ezp532UrHPZL9RQaDW3Wo8r3UCyQVjW+fbiCx7eEbYNuJFbE11U Hk54ye0479GfW9DaEyvWs9od4SffVIDaA5hyxjGX9azvJ6mNddo9jF1gLtKLKnni4Ijl eK5wISwq+uF8MPDVvBBpEp58CIyqm6gszpFvWEnyknztIod3Pw4sMxRqkWp/3zeCZnnt 8P9A== X-Gm-Message-State: AGi0PuZKt29dwWVYObEwMWufnOj8Niy7yVlY3zL9YR0pcB5phy6JLDJ/ cSBUp6X1zd6uVac8M5ZcV0917g== X-Google-Smtp-Source: APiQypL5oOSXK6EB6pTmE0GvhZKkN9bomyS/0POUiPH8tnXR5GIsMN5uQyBtW82Y8w+DwA9j1QGpNQ== X-Received: by 2002:adf:fcc8:: with SMTP id f8mr4780563wrs.230.1588699436552; Tue, 05 May 2020 10:23:56 -0700 (PDT) Received: from google.com ([2a00:79e0:d:109:355c:447d:ad3d:ac5c]) by smtp.gmail.com with ESMTPSA id t67sm5496003wmg.40.2020.05.05.10.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 10:23:55 -0700 (PDT) Date: Tue, 5 May 2020 18:23:51 +0100 From: Andrew Scull To: Marc Zyngier Subject: Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm Message-ID: <20200505172351.GD237572@google.com> References: <20200422120050.3693593-1-maz@kernel.org> <20200422120050.3693593-4-maz@kernel.org> <20200505152648.GA237572@google.com> <86pnbitka5.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <86pnbitka5.wl-maz@kernel.org> Cc: kvm@vger.kernel.org, Andre Przywara , kvmarm@lists.cs.columbia.edu, George Cherian , "Zengtao \(B\)" , Catalin Marinas , Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org 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 > > > + /* VTCR_EL2 value for this VM */ > > > + u64 vtcr; > > > > VTCR seems quite strongly tied to the MMU config. Is it not controlled > > independently for the nested MMUs and so remains in this struct? > > This particular instance of VTCR_EL2 is the host's version. Which > means it describes the virtual HW for the EL1 guest. It constraints, > among other things, the number of IPA bits for the guest, for example, > and is configured by the VMM. > > Once you start nesting, each vcpu has its own VTCR_EL2 which is still > constrained by the main one (no nested guest can have a T0SZ bigger > than the value imposed by userspace for this guest as a whole). > > Does it make sense? It does up to my ignorance of the spec in this regard. Simliar to James's question, should `vtcr` live inside the mmu struct with the top level `kvm::mmu` field containing the host's version and the nested mmus containing the nested version of vtcr to be applied to the vCPU? I didn't noticed there being a vtcr for the nested version in the ~90-patch series so maybe that just isn't something that needs thinking about? _______________________________________________ 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=-0.7 required=3.0 tests=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 6BDECC47259 for ; Tue, 5 May 2020 17:24:02 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 41DF2206FA for ; Tue, 5 May 2020 17:24:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lqXwFz9k"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="EkW9V00O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41DF2206FA 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+infradead-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=bombadil.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=GkG/xbG9WuRInf7SgVWTJYA6mcOrtB/1mPO0w1ZW5gA=; b=lqXwFz9keWQ6C7 uP4+1I5nHqh61oNUcZ8M+Dm+BHxZWNkuikc7BrF50wQz/A2fiH/6N8vO52D1hKGihTMLTu93ADnQB NmVmULjkCb5X3OpMhgrcQoudGO+bjqMQowzazOybeLwllCN2TzPOiU+pAj0IAVvrdbtNw3SGhPAgo e+4rQgCPR93yHqepJpUntQBjKkPUAUE+ucpEBXUQ7h9NzrFtc+sopqIgI9e6d4x8JUbJba+HSMRW7 WzJVP+LSbTdhM7p1jCNRsIuhZhFP9Z9SZFbGbdIYoj6qWkxtnDHVBjzZRmv/U49zmUGhKeraGLduX BdtzvaL6bVsH3RrgZcVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jW1IX-0005GW-QI; Tue, 05 May 2020 17:24:01 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jW1IU-0005Fn-Sy for linux-arm-kernel@lists.infradead.org; Tue, 05 May 2020 17:24:00 +0000 Received: by mail-wr1-x443.google.com with SMTP id x17so3713743wrt.5 for ; Tue, 05 May 2020 10:23:57 -0700 (PDT) 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=NP9OIn8aZdjTBigvGWGYSxvnTPBy4fLFwfAKc1uTAGA=; b=EkW9V00OjSI1/ZNXcCO2ShjrxSwU48K+ycq1QjcEjdt3BdAlSmprqkST87DvkZHvW6 ZST12Yx3Rb0hndsh0l00CBau1Cf/oUxPDSegLM2wOvjW1oZ3mmLe0HrIFVwsaRMHLtrL y3EQDmTJY3lxI8pEKjhAA6jzzy6MwcCmS+GPtwseWuLaLEnXfYr7xFTByvjD01hW8yUn S12b0kRAP1CFSiKlwbTKv522AqxGPAVXHH8FQa97RDrW6lN1ipc+585tSMIzHup4aeoq bLHoC1L2d8tR/2XjckmTJfAB2Ip64/EXbwM+aGRIlTpnRSysscymNoa3RnH8fsebos5U 2lXQ== 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=NP9OIn8aZdjTBigvGWGYSxvnTPBy4fLFwfAKc1uTAGA=; b=VVD8uDIfaU3Sgixm9TPueW4XdlVxmnpQdkjrV8R78bLF2cPMK2Mt3nabGaC2DCyuPf kt1EGayZhRdBIZlvnZxbkZeBoIFqu4qKl4Z8CCMXW/z2XKOR37BjAuUhQf4ewxv4xpSS O1jEOxMIyHknnlnscbkuzy0PjrubC1cEsaJJ2TdZA+aag/3576Esr3aM8QmxlDWBBErS /mVAgXqtiKJ0QqZE30HVmiPVWSWG+rFhTesYXaMfXa/yZyTgF+E8dJBoixBeReyIDFRq V+TBmXYmH0w4oIKpRCGdrQX3TBb+4GKSidc2fHlNSkRAeaERYXwkHJimici4c6hb5BRu UJbA== X-Gm-Message-State: AGi0Pua2rVl19H3fza7J0Cap5WtgxsFsksuE/1eKPRpNbnlNI2smCglq kjWwrpJeeNioe3yVZ5pQnVlbd3NceBqwWQ== X-Google-Smtp-Source: APiQypL5oOSXK6EB6pTmE0GvhZKkN9bomyS/0POUiPH8tnXR5GIsMN5uQyBtW82Y8w+DwA9j1QGpNQ== X-Received: by 2002:adf:fcc8:: with SMTP id f8mr4780563wrs.230.1588699436552; Tue, 05 May 2020 10:23:56 -0700 (PDT) Received: from google.com ([2a00:79e0:d:109:355c:447d:ad3d:ac5c]) by smtp.gmail.com with ESMTPSA id t67sm5496003wmg.40.2020.05.05.10.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 10:23:55 -0700 (PDT) Date: Tue, 5 May 2020 18:23:51 +0100 From: Andrew Scull To: Marc Zyngier Subject: Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm Message-ID: <20200505172351.GD237572@google.com> References: <20200422120050.3693593-1-maz@kernel.org> <20200422120050.3693593-4-maz@kernel.org> <20200505152648.GA237572@google.com> <86pnbitka5.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <86pnbitka5.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200505_102358_961892_CF9E7A27 X-CRM114-Status: GOOD ( 14.10 ) 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: kvm@vger.kernel.org, Andre Przywara , kvmarm@lists.cs.columbia.edu, George Cherian , "Zengtao \(B\)" , Catalin Marinas , Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org > > > + /* VTCR_EL2 value for this VM */ > > > + u64 vtcr; > > > > VTCR seems quite strongly tied to the MMU config. Is it not controlled > > independently for the nested MMUs and so remains in this struct? > > This particular instance of VTCR_EL2 is the host's version. Which > means it describes the virtual HW for the EL1 guest. It constraints, > among other things, the number of IPA bits for the guest, for example, > and is configured by the VMM. > > Once you start nesting, each vcpu has its own VTCR_EL2 which is still > constrained by the main one (no nested guest can have a T0SZ bigger > than the value imposed by userspace for this guest as a whole). > > Does it make sense? It does up to my ignorance of the spec in this regard. Simliar to James's question, should `vtcr` live inside the mmu struct with the top level `kvm::mmu` field containing the host's version and the nested mmus containing the nested version of vtcr to be applied to the vCPU? I didn't noticed there being a vtcr for the nested version in the ~90-patch series so maybe that just isn't something that needs thinking about? _______________________________________________ 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=-8.4 required=3.0 tests=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 0678CC47254 for ; Tue, 5 May 2020 17:24:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFA11206FA for ; Tue, 5 May 2020 17:23:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EkW9V00O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729857AbgEERX6 (ORCPT ); Tue, 5 May 2020 13:23:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726350AbgEERX6 (ORCPT ); Tue, 5 May 2020 13:23:58 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F2A8C061A0F for ; Tue, 5 May 2020 10:23:58 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id k1so3715438wrx.4 for ; Tue, 05 May 2020 10:23:57 -0700 (PDT) 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=NP9OIn8aZdjTBigvGWGYSxvnTPBy4fLFwfAKc1uTAGA=; b=EkW9V00OjSI1/ZNXcCO2ShjrxSwU48K+ycq1QjcEjdt3BdAlSmprqkST87DvkZHvW6 ZST12Yx3Rb0hndsh0l00CBau1Cf/oUxPDSegLM2wOvjW1oZ3mmLe0HrIFVwsaRMHLtrL y3EQDmTJY3lxI8pEKjhAA6jzzy6MwcCmS+GPtwseWuLaLEnXfYr7xFTByvjD01hW8yUn S12b0kRAP1CFSiKlwbTKv522AqxGPAVXHH8FQa97RDrW6lN1ipc+585tSMIzHup4aeoq bLHoC1L2d8tR/2XjckmTJfAB2Ip64/EXbwM+aGRIlTpnRSysscymNoa3RnH8fsebos5U 2lXQ== 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=NP9OIn8aZdjTBigvGWGYSxvnTPBy4fLFwfAKc1uTAGA=; b=m5Fttnb0iLOd+E5GmlEs/TnYelpgFaC2EVmaFLnsCEOmDcO1ThGFmynLroEbchtZvg itJvfMQfN668ufqUUXR4XJNXR47ArrfyrtbAXN7MZm4ZuXZvFn9Dz4cGJgVDqEXMzMJ1 K/VoFlFtekXuWPCFKXGnO56OLyau4DFLfniGgqFi+wWJs9lofWmZDu+9sIDUzClSHrvo Rf+vrodiHjeq/JOKPm3UzetDiP4WLU101VKXR7XPUONuIgzHpPG+2IUZUnbGAVfs9S6K hKCWZFldZB1oiEdoOMrsuVJbyFyaHu8mis7JyU+6E3AQu1upSypeoEGdkhsBQr9RQANd tUmg== X-Gm-Message-State: AGi0PubX5MajJHGT7c5vtssMUm1HiS/vCeCZ59knWHOmRNZbQLzOwHPm FRleorJ+qdjUN9pBlpUggTtztQ== X-Google-Smtp-Source: APiQypL5oOSXK6EB6pTmE0GvhZKkN9bomyS/0POUiPH8tnXR5GIsMN5uQyBtW82Y8w+DwA9j1QGpNQ== X-Received: by 2002:adf:fcc8:: with SMTP id f8mr4780563wrs.230.1588699436552; Tue, 05 May 2020 10:23:56 -0700 (PDT) Received: from google.com ([2a00:79e0:d:109:355c:447d:ad3d:ac5c]) by smtp.gmail.com with ESMTPSA id t67sm5496003wmg.40.2020.05.05.10.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 10:23:55 -0700 (PDT) Date: Tue, 5 May 2020 18:23:51 +0100 From: Andrew Scull To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Will Deacon , Andre Przywara , Dave Martin , George Cherian , "Zengtao (B)" , Catalin Marinas Subject: Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm Message-ID: <20200505172351.GD237572@google.com> References: <20200422120050.3693593-1-maz@kernel.org> <20200422120050.3693593-4-maz@kernel.org> <20200505152648.GA237572@google.com> <86pnbitka5.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86pnbitka5.wl-maz@kernel.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org > > > + /* VTCR_EL2 value for this VM */ > > > + u64 vtcr; > > > > VTCR seems quite strongly tied to the MMU config. Is it not controlled > > independently for the nested MMUs and so remains in this struct? > > This particular instance of VTCR_EL2 is the host's version. Which > means it describes the virtual HW for the EL1 guest. It constraints, > among other things, the number of IPA bits for the guest, for example, > and is configured by the VMM. > > Once you start nesting, each vcpu has its own VTCR_EL2 which is still > constrained by the main one (no nested guest can have a T0SZ bigger > than the value imposed by userspace for this guest as a whole). > > Does it make sense? It does up to my ignorance of the spec in this regard. Simliar to James's question, should `vtcr` live inside the mmu struct with the top level `kvm::mmu` field containing the host's version and the nested mmus containing the nested version of vtcr to be applied to the vCPU? I didn't noticed there being a vtcr for the nested version in the ~90-patch series so maybe that just isn't something that needs thinking about?