Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5487242imm; Tue, 18 Sep 2018 10:15:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZdWYY2qBIvmzEDO2i175QPKYUmvMooFQKvzK7aEfuh1Rq1JqSF0R+CgEs2fG90npZiTe8S X-Received: by 2002:a17:902:28a4:: with SMTP id f33-v6mr30572111plb.297.1537290954642; Tue, 18 Sep 2018 10:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537290954; cv=none; d=google.com; s=arc-20160816; b=UxhyiFmRY71wZdMEbgV0vO3KXwKGI3imnpEVFpBaHeNkD8AUmgn3RYJ2KEwa7PRCfk jLWLi3py6uDDFkSRYg5xExAWFMAd29TylELIDD4iaZKUwm3wuQhk190HoJYUXd3iQHDB 2I+yxCNgqO9IQ08zjKNbmVRFN+QSYIl/rGPGTnGcPjFkg2ERf+G07+++2luZHzk5JgjU 5qY27LXvp09c69GtbrKIVlncOROj4ZQlEA0O3XYRX+9bS/P3gUpz7Iw9Z9pKiTPidp1C JlsAgHlF/nEAGAxjlAglHLZLVMEmn1qelyMbbycAzslqof8Vu3e1s6UZ34K1Bv7OJjyh I9ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=7eEptge3oTBSJ5QRX9F/gUGuBpEGhLdp6vjStpCYLeE=; b=sfss4I033nD9DtHdeTx1h69TAp3oTQe41ZOo+Bvz0HbL06JHWIY9HUvia4qjW68A2i v2NWx6wAf0EP373a/UFIww9iMURJ/OAO6rtEeIs/u48S7vOg3lNNmUy4aZJd5QrYkDPV y7ZDyqmcabGzVgY0clrSm7CRHoiAbsT4Gw53eBnN6GRwZhzugZmVz3gfEeVjmTOUVkzd TVMPLj+a5L1XmUfeaHT7LS9e7L1zMpMChK1KeQuCllFGWQBoEgaQPk5znLXQnkPQQYRV hKtfi2ENQyZK8yOxhYjfFPl72n8897+Jy8jGLOA5Z8xiMA1waHXGt4uh2+gvrwlBEQOp gl5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ivc3wvvQ; 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 r6-v6si17554305pgp.591.2018.09.18.10.15.39; Tue, 18 Sep 2018 10:15:54 -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; dkim=pass header.i=@linaro.org header.s=google header.b=ivc3wvvQ; 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 S1730417AbeIRWs5 (ORCPT + 99 others); Tue, 18 Sep 2018 18:48:57 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:35265 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729037AbeIRWs5 (ORCPT ); Tue, 18 Sep 2018 18:48:57 -0400 Received: by mail-ot1-f68.google.com with SMTP id j9-v6so2796759otl.2 for ; Tue, 18 Sep 2018 10:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7eEptge3oTBSJ5QRX9F/gUGuBpEGhLdp6vjStpCYLeE=; b=ivc3wvvQ67zs27uqN/Hf9nuT8Hsmk5E3B0fwmfhSJUnT0TycdcMbl0pB4T6ZmM/dbT 2vlas/AXvNgvJm0ndJBiMMmtjj9oG0zlvYe1uAdiOenZuXOBkUkvRuhBH8qzPWsNkZFi xy4ko1TrUjDVeppGpQR/xoVZY/Sjtcstee6hs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7eEptge3oTBSJ5QRX9F/gUGuBpEGhLdp6vjStpCYLeE=; b=gd1mmHXa6TeVsWbUo5716kFeAEFNCTwG39ClsL+vopNhfH3O8z7Qdskm0MMgbdT+4M vThOsImqXhm7T1RiKjc3IqBxnG1wPwnOqSPDLCGpMrohpR4D542O+yNrR2WXyPYiYNd5 RFIzfDLFBIZ4ryv25SweznSb5/zHBSF51Ch7iMehv57I9L+yFCAHxc4COaczMaly+k/D qiIGE44fx6CSWkAzH+w+qQ2+/2TdeC9NFtCm9rbMdxG82D3fObaG2D96l2S+EQRil3PD 81ne2cNt/EfavhLetDVEeh1IkvL88ZLgrtUgTBwZeIcK7uU5Hxmnx3weu+ZSQoHcE/Up qVfw== X-Gm-Message-State: APzg51BBAuU0twFAVUsPLA/5zzUaTMbXaQAgUAs24J4FKRD9v0/8osWz onl/8SGxe5mZZS9SpUg1SMkLeXOnbWQihXyxuHxf9g== X-Received: by 2002:a9d:82f:: with SMTP id 44-v6mr16958236oty.377.1537290924554; Tue, 18 Sep 2018 10:15:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:20e3:0:0:0:0:0 with HTTP; Tue, 18 Sep 2018 10:15:04 -0700 (PDT) In-Reply-To: References: <20180917104144.19188-1-suzuki.poulose@arm.com> <20180917104144.19188-19-suzuki.poulose@arm.com> <218b64d5-741d-97ef-8aae-bc0a2ac3e56c@arm.com> From: Peter Maydell Date: Tue, 18 Sep 2018 18:15:04 +0100 Message-ID: Subject: Re: [PATCH v5 18/18] kvm: arm64: Allow tuning the physical address size for VM To: Suzuki K Poulose Cc: arm-mail-list , kvmarm@lists.cs.columbia.edu, kvm-devel , Marc Zyngier , Christoffer Dall , Eric Auger , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Will Deacon , Catalin Marinas , James Morse , Dave P Martin , julien.grall@arm.com, lkml - Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18 September 2018 at 17:27, Suzuki K Poulose wrote: > --- > > "On arm64, the physical address size for a VM (IPA Size limit) is limited > to 40bits by default. The limit can be configured if the host supports the > extension KVM_CAP_ARM_VM_IPA_SIZE. When supported, use > KVM_VM_TYPE_ARM_IPA_SIZE(IPA_Bits) to set the size in the machine type > identifier, where IPA_Bits is the maximum width of any physical > address used by the VM. The IPA_Bits is encoded in bits[7-0] of the > machine type identifier. > > e.g, to configure a guest to use 48bit physical address size : > > vm_fd = ioctl(dev_fd, KVM_CREATE_VM, KVM_VM_TYPE_ARM_IPA_SIZE(48)); > > The requested size (IPA_Bits) must be : > 0 - Implies default 40bits (for backward compatibility) > > or > > N - Implies N bits, where N is a positive integer such that 32 <= N <= > Host_IPA_Limit > > Host_IPA_Limit is the maximum possible value for IPA_Bits on the host and > is dependent on the CPU capability and the kernel configuration. The limit > can > be retrieved using KVM_CAP_ARM_VM_IPA_SIZE of the KVM_CHECK_EXTENSION > ioctl() at run-time. > > Please note that configuring the IPA size does not affect the capability > exposed by the guest CPUs in ID_AA64MMFR0_EL1[PARange]. It only affects > the guest to host physical address (stage2) translations setup by the host. > " Thanks, this is much clearer. The only bit I'm not sure about is that last paragraph -- if I ask for a VM with a 48 bit address space why don't we tell the guest that that's what it has ? thanks -- PMM