Received: by 10.223.176.5 with SMTP id f5csp2165303wra; Thu, 8 Feb 2018 09:25:31 -0800 (PST) X-Google-Smtp-Source: AH8x2252y8aEiXmw3rf2lcXkGpMnibPYHprfpwnY3IoNhtDY2uZVjsKjsqEvEyce5bzSFq4PR4yd X-Received: by 10.101.85.76 with SMTP id t12mr1103376pgr.60.1518110731519; Thu, 08 Feb 2018 09:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518110731; cv=none; d=google.com; s=arc-20160816; b=et48ysuaaQlsbnuxqeykQAzUYFxozPZqMvyMj1ZchgcXrhcFRP1ckHYjR1xnp8RYyR 1zn/PBxgXKB2uR+h3o/dWdtC7hpyNnQa5laGdVqbbEkf+Ze1DcLIKpwAKzlbYt1VMmJc XOuzDS5i9VE3o3+7lxtjABEKyxqYbLCyGUG3usbx41cuh764jCwCRg5hP2afpnU0XsCW dB+uUunBEJvnuovNzbRFsvBOwkdjailetswRPJkn2V6dA/hp6EHQFqtFhYbjjNe7ef8j FbRj9uScb0bcz73ASmLjVBvyYZDMfRDTmdbml8QbjqshvSHGclu0+xhMXLDixaepSOp2 Miqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=nJcWlROBVvw3j0vthvRedbL8QPqyY/4fh/v+kmiqRF8=; b=iaz9fqwDmK2mMGT9xnxd63F/IQPujnYvbyNdF85UHBbmHvWvuSYN5I4aXWFfQuoaAW JMCdffuxuNQ1dBztM8COYmmMCO44Na69W7sRZjlr7O3vxiiW8tKMbhBZXDiEMAaWDfhQ Zco/qYvvYy6rKcCM2E6Vw0hMMwLONo+7fY0b2m8pE3lJq5GDUMSL+oDwA6LHM2VMYbAt OfaQ6RNFxTRrUheHvTyDXUAv/s/fvypgzoYguuqhH5byavLWICdG11rDwjOzYdYZh7DQ uq+ASdS+8Qzg6yhAZbqFWoO0bKH3Ynt+FAGlHf4JX2jKcxk6OGWT9FcTX3PQjv7skneP tW3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60-v6si235655plc.444.2018.02.08.09.25.15; Thu, 08 Feb 2018 09:25:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752387AbeBHRWe (ORCPT + 99 others); Thu, 8 Feb 2018 12:22:34 -0500 Received: from foss.arm.com ([217.140.101.70]:37844 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752322AbeBHRWd (ORCPT ); Thu, 8 Feb 2018 12:22:33 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2969B80D; Thu, 8 Feb 2018 09:22:33 -0800 (PST) Received: from [10.1.206.28] (e107814-lin.cambridge.arm.com [10.1.206.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC2653F24D; Thu, 8 Feb 2018 09:22:30 -0800 (PST) Subject: Re: [PATCH v1 14/16] kvm: arm64: Switch to per VM IPA To: Christoffer Dall Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, kristina.martsenko@arm.com, peter.maydell@linaro.org, pbonzini@redhat.com, rkrcmar@redhat.com, will.deacon@arm.com, ard.biesheuvel@linaro.org, mark.rutland@arm.com, catalin.marinas@arm.com, Christoffer Dall References: <20180109190414.4017-1-suzuki.poulose@arm.com> <20180109190414.4017-15-suzuki.poulose@arm.com> <20180208110035.GG29286@cbox> From: Suzuki K Poulose Message-ID: <94aae952-d6c0-0a69-955f-81885ddb2f06@arm.com> Date: Thu, 8 Feb 2018 17:22:29 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180208110035.GG29286@cbox> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/02/18 11:00, Christoffer Dall wrote: > On Tue, Jan 09, 2018 at 07:04:09PM +0000, Suzuki K Poulose wrote: >> Now that we can manage the stage2 page table per VM, switch the >> configuration details to per VM instance. We keep track of the >> IPA bits, number of page table levels and the VTCR bits (which >> depends on the IPA and the number of levels). >> >> Cc: Marc Zyngier >> Cc: Christoffer Dall >> Signed-off-by: Suzuki K Poulose >> --- >> arch/arm/include/asm/kvm_mmu.h | 1 + >> arch/arm64/include/asm/kvm_host.h | 12 ++++++++++++ >> arch/arm64/include/asm/kvm_mmu.h | 22 ++++++++++++++++++++-- >> arch/arm64/include/asm/stage2_pgtable.h | 1 - >> arch/arm64/kvm/hyp/switch.c | 3 +-- >> virt/kvm/arm/arm.c | 2 +- >> 6 files changed, 35 insertions(+), 6 deletions(-) >> >> diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h >> index 440c80589453..dd592fe45660 100644 >> --- a/arch/arm/include/asm/kvm_mmu.h >> +++ b/arch/arm/include/asm/kvm_mmu.h >> @@ -48,6 +48,7 @@ >> #define kvm_vttbr_baddr_mask(kvm) VTTBR_BADDR_MASK >> >> #define stage2_pgd_size(kvm) (PTRS_PER_S2_PGD * sizeof(pgd_t)) >> +#define kvm_init_stage2_config(kvm) do { } while (0) >> int create_hyp_mappings(void *from, void *to, pgprot_t prot); >> int create_hyp_io_mappings(void *from, void *to, phys_addr_t); >> void free_hyp_pgds(void); >> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h >> index 9a9ddeb33c84..1e66e5ab3dde 100644 >> --- a/arch/arm64/include/asm/kvm_host.h >> +++ b/arch/arm64/include/asm/kvm_host.h >> @@ -64,6 +64,18 @@ struct kvm_arch { >> /* VTTBR value associated with above pgd and vmid */ >> u64 vttbr; >> >> + /* Private bits of VTCR_EL2 for this VM */ >> + u64 vtcr_private; > > As to my comments in the previous patch, why isn't this simply u64 vtcr; nit: I haven't received your response to the previous patch. We could. I thought this gives a bit more clarity on what changes per-VM. Thanks Suzuki