Received: by 10.223.176.5 with SMTP id f5csp381623wra; Fri, 9 Feb 2018 00:13:51 -0800 (PST) X-Google-Smtp-Source: AH8x225nlZHeaeBpyE3tTJgO+gGJHZfNoHNd5ZXJE9QaLeDoOVPUlRIghUQRijiEw89PIbf1uL7Y X-Received: by 2002:a17:902:930a:: with SMTP id bc10-v6mr1791743plb.19.1518164030983; Fri, 09 Feb 2018 00:13:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518164030; cv=none; d=google.com; s=arc-20160816; b=vbA3Q+sDpZSOVdV2a61UTaDFMUAi7ZpYgBExewtz+QTcD766XX+hPe36S7x9BKMgkZ Zoy2EQx1UQazSNlGZXWoGJJcDKdyzdbJN8BW7yurDRSF6gYKDehMP+72k1lv3LQah2Om 8b6cRMsKQlDJMRLDLGQmLc4PqK4QIffwQmozYanQPGNpcn7MiOCL05N4jboxVG0HYN6f Vf00Zv13M1OqaycrBSbjhsPpZVbAwDOGd+ysdiRol255RBzPOmw9aTPiIjJ+olfawFpm FNmT204dQDFlLLRlIV33+M7JysvrdIivRl21frj/31hvt+yFEopOEi+I94zWJK7aqYhJ QL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=EXvRIsbzOehrfqCQ7Bp/A5HTTRlBdkOIeJ/Ia0HsPmg=; b=vav1fHNs6AK8IHffqoCgV/Za13hIkl3jyWcYORk/L5qpzN+G0XcF+DdXP46xgm9i/8 xBzxEMxdJxz5byJAKatUby6alEnKATwlXtkklcziY0frxPKLFQt4GDNT6CwcO+clzxRR IO3mNK8URTZpq4hQNRP2yWhWBZ6u360L+BexKkkgKQc/37pBMNJqG+MIXs8vE8JDEr8B tgJsMs2IyDiKxgSNlUMe6NQO6zsCr3lMsB8uD9FcHa6/tX0Kml65DmjbJwgKezFFeKv4 sp7q59f3I+vAt8+tUT/WoTEN6Hz5kOyfgbW4kCSCi3OBrjL6uYOZmz/004FxPct+sDsH n/4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I43ssgIh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p10si1326493pfh.246.2018.02.09.00.13.37; Fri, 09 Feb 2018 00:13:50 -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; dkim=pass header.i=@linaro.org header.s=google header.b=I43ssgIh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbeBIIMs (ORCPT + 99 others); Fri, 9 Feb 2018 03:12:48 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55449 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbeBIIMq (ORCPT ); Fri, 9 Feb 2018 03:12:46 -0500 Received: by mail-wm0-f67.google.com with SMTP id 143so13795240wma.5 for ; Fri, 09 Feb 2018 00:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EXvRIsbzOehrfqCQ7Bp/A5HTTRlBdkOIeJ/Ia0HsPmg=; b=I43ssgIhV+eK5tpRxx/QFuO33/mT3JR59zaKZoA4u7AJIeSO2RmAGA2W91C6uBhPg3 nqwEy8pryx345peUFXpzstzmXG1jIl5oPOeYbA8opKVFUiYwsxHQSlpb3H6u1L9b76bE 5ayuqb3YkBPoXFB71GpUYi1jqD6Yr5Hc4pbD4= 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:user-agent; bh=EXvRIsbzOehrfqCQ7Bp/A5HTTRlBdkOIeJ/Ia0HsPmg=; b=SINB3uEbB/1fJWmUspiifB9CnWf5Xz6M5MwTy7GaCYVJGvQv4K4W3CjSg22YODOzi6 4AC6ikpmR0a8yB30ajkLBiQYGsplonACXFYiCfdJVdlOSsdSLX6BBSiMro3LeOkuKw8a xTkFIfNtKnGG11yDZKB0b0bucfuokG7jKdzz0Qdi7U/DppOAjyD4xr2paomMNuPc2kfL mG4hVrOwoXyFnDlnomgwCb405rOgEVSwLeHfBo8HrdhUxIROtaAznpiKKgP42oQr0d81 eWmtKn1y5qLayVRgR1myb2rCiC5NJqmq/URJ2I8WOMBlobEtugBcmGLZmuwWZAfLun92 5qUQ== X-Gm-Message-State: APf1xPAXmIypupL8W/HpRt5q8eyhfbc9K/ooT2S6VsYoKSDJMbPa7lLK JfD6Atee2e6zuwMjfh+50V6wug== X-Received: by 10.80.205.140 with SMTP id p12mr2537887edi.169.1518163965773; Fri, 09 Feb 2018 00:12:45 -0800 (PST) Received: from localhost (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id h9sm962515edk.80.2018.02.09.00.12.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 00:12:44 -0800 (PST) Date: Fri, 9 Feb 2018 09:12:44 +0100 From: Christoffer Dall To: Suzuki K Poulose 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 Subject: Re: [PATCH v1 14/16] kvm: arm64: Switch to per VM IPA Message-ID: <20180209081244.GB7339@cbox> References: <20180109190414.4017-1-suzuki.poulose@arm.com> <20180109190414.4017-15-suzuki.poulose@arm.com> <20180208110035.GG29286@cbox> <94aae952-d6c0-0a69-955f-81885ddb2f06@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94aae952-d6c0-0a69-955f-81885ddb2f06@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 08, 2018 at 05:22:29PM +0000, Suzuki K Poulose wrote: > 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. It got stuck in my drafts folder somehow, hopefully you received it now. > > We could. I thought this gives a bit more clarity on what changes per-VM. > Since there's a performance issue involved, I think it's cleaner to just calculate the vtcr once per VM and store it. Thanks, -Christoffer