Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp689264oof; Tue, 25 Sep 2018 03:23:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV63YQiCbqQiKM/JEwDbGbaGnJwk4nMl0wa3uYZJjsR7N3mLjnxiWmS0UO+s0j/vYR4FtZry5 X-Received: by 2002:a63:d917:: with SMTP id r23-v6mr430131pgg.0.1537871018501; Tue, 25 Sep 2018 03:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537871018; cv=none; d=google.com; s=arc-20160816; b=XeiPGmZKklOd2BQZgbL8+hnfDwLzXmaTD6slgnCMa5z3vtK6PunkVY17vzmn5MixQ3 MYp/G+HGN9Zf//XZ85+QiEl4A8gTLprzl3NcbNMMhWzZeWwdKn29Cnd5qQ1qToyn6XeL CpItVPMJsqi5Dvj60sECOtZCMfnc3cB7RxfQt2T9maQQr/WvQsZVh2ja3NqP7QxNthRI Attw99A5BgDcYq7NlUETNltdJAs3qnhZl1bO0UPK1h3LFnByFj1/Fp8XXrwTzUKMBM6m YegSNCU+izicNBq+zKtIW4dBlYVlCq59nbrlIIb40tKZku/XlA2ot502S4CJe9/EhsDl EXvw== 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; bh=/Mm/hDEMUsTOV1QzXJwHUnm0WxDDxblIOvo59zV+hRE=; b=yBci79y0/oLteZ/kA/cKr6UXvCeKXi5NZC/OCyAoFiyKWMtXgkC1KxX3srV/dJwKH5 OJsdoqPe3lBBN7xJmeggw6xBmh5xGRvSBTDLJKzkjc9gZErf3w2cYsnEhAPqMQE7dzzG H2t051P9Duf2cKx1+YR6PYvsHmNfxXNLXV5ZY/fVjog+RkCpctUmjO/555vdlwt9iL7Y DvjVXAQLKz8RA2vhimvxVaQ3+PDMhS0y5LHl4Y6nazlxtet3PzVQe06XYzlMe1osTo39 dLTef+jiCP/P0JjvR9oY6Sj5AIrJ7q/Tz9ZnZN+DTkO6VUe0SK4qQG2H39VJoVUVqPha HTmw== 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 f8-v6si293366pln.512.2018.09.25.03.23.22; Tue, 25 Sep 2018 03:23:38 -0700 (PDT) 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 S1728126AbeIYQaJ (ORCPT + 99 others); Tue, 25 Sep 2018 12:30:09 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48478 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbeIYQaJ (ORCPT ); Tue, 25 Sep 2018 12:30:09 -0400 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 B122D80D; Tue, 25 Sep 2018 03:23:16 -0700 (PDT) Received: from [192.168.0.21] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5EB313F5B7; Tue, 25 Sep 2018 03:23:13 -0700 (PDT) Subject: Re: [PATCH v5 18/18] kvm: arm64: Allow tuning the physical address size for VM To: Auger Eric , linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, marc.zyngier@arm.com, cdall@kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com, will.deacon@arm.com, catalin.marinas@arm.com, james.morse@arm.com, dave.martin@arm.com, julien.grall@arm.com, linux-kernel@vger.kernel.org, Peter Maydel References: <20180917104144.19188-1-suzuki.poulose@arm.com> <20180917104144.19188-19-suzuki.poulose@arm.com> <552680a6-23e6-001c-416e-214d1e8276c6@redhat.com> From: Suzuki K Poulose Message-ID: <75c3abc2-6518-9a4b-ea1e-01619489d535@arm.com> Date: Tue, 25 Sep 2018 11:24:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <552680a6-23e6-001c-416e-214d1e8276c6@redhat.com> Content-Type: text/plain; charset=utf-8; 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 09/25/2018 11:00 AM, Auger Eric wrote: > Hi Suzuki, > On 9/17/18 12:41 PM, Suzuki K Poulose wrote: >> Allow specifying the physical address size limit for a new >> VM via the kvm_type argument for the KVM_CREATE_VM ioctl. This >> allows us to finalise the stage2 page table as early as possible >> and hence perform the right checks on the memory slots >> without complication. The size is ecnoded as Log2(PA_Size) in > encoded ... >> >> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt >> index c664064f76fb..f860251ff27c 100644 >> --- a/Documentation/virtual/kvm/api.txt >> +++ b/Documentation/virtual/kvm/api.txt >> @@ -122,6 +122,14 @@ the default trap & emulate implementation (which changes the virtual >> memory layout to fit in user mode), check KVM_CAP_MIPS_VZ and use the >> flag KVM_VM_MIPS_VZ. >> >> +To configure the physical address space size for a VM (IPA size) on arm64, >> +check KVM_CAP_ARM_VM_PHYS_SHIFT (which returns the maximum limit for the >> +IPA shift) and use KVM_VM_TYPE_ARM_PHYS_SHIFT(PHYS_SHIFT). Bits[7-0] of the >> +machine type has been reserved for specifying the PHYS_SHIFT. > are reserved to pass the PHYS_SHIFT? >> +The supported range is [32...IPA_LIMIT], where IPA_LIMIT could be > s/could be/is >> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h >> index 07548de5c988..2a6b29c446db 100644 >> --- a/include/uapi/linux/kvm.h >> +++ b/include/uapi/linux/kvm.h >> @@ -750,6 +750,15 @@ struct kvm_ppc_resize_hpt { >> >> #define KVM_S390_SIE_PAGE_OFFSET 1 >> >> +/* >> + * On arm64, machine type can be used to request the physical >> + * address size for the VM. Bits[7-0] has been reserved for the PA > s/has been reserved/are? Thanks for spotting, fixed all the above. Suzuki