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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 E791CC3279B for ; Mon, 2 Jul 2018 13:31:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F684243FE for ; Mon, 2 Jul 2018 13:31:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F684243FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbeGBNbV (ORCPT ); Mon, 2 Jul 2018 09:31:21 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60482 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752140AbeGBNbS (ORCPT ); Mon, 2 Jul 2018 09:31:18 -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 D112618A; Mon, 2 Jul 2018 06:31:17 -0700 (PDT) Received: from [10.1.206.73] (en101.cambridge.arm.com [10.1.206.73]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4F9553F5AD; Mon, 2 Jul 2018 06:31:15 -0700 (PDT) Subject: Re: [PATCH v3 15/20] kvm: arm/arm64: Allow tuning the physical address size for VM To: Marc Zyngier , linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, cdall@kernel.org, eric.auger@redhat.com, julien.grall@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, punit.agrawal@arm.com, qemu-devel@nongnu.org, Peter Maydel , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1530270944-11351-1-git-send-email-suzuki.poulose@arm.com> <1530270944-11351-16-git-send-email-suzuki.poulose@arm.com> From: Suzuki K Poulose Message-ID: <8392ecb1-50ce-c448-54f7-bf3021ae508b@arm.com> Date: Mon, 2 Jul 2018 14:31:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: 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 02/07/18 14:13, Marc Zyngier wrote: > On 29/06/18 12:15, Suzuki K Poulose wrote: >> Allow specifying the physical address size for a new VM via >> the kvm_type argument for KVM_CREATE_VM ioctl. This allows >> us to finalise the stage2 page table format as early as possible >> and hence perform the right checks on the memory slots without >> complication. The size is encoded as Log2(PA_Size) in the bits[7:0] >> of the type field and can encode more information in the future if >> required. The IPA size is still capped at 40bits. > > Can't we relax this? There is no technical reason (AFAICS) not to allow > going down to 36bit IPA if the user has requested it. Sure, we can. > > If we run on a 36bit IPA system, the default would fail. But if the user > specified "please give me a 36bit IPA VM", we could satisfy that > requirement and allow them to run their stupidly small guest! Absolutely. I will fix this in the next version. Cheers Suzuki From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZyvM-0000ee-A7 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:31:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZyvH-0002VY-O0 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:31:24 -0400 Received: from foss.arm.com ([217.140.101.70]:39704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZyvH-0002Uy-Ii for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:31:19 -0400 References: <1530270944-11351-1-git-send-email-suzuki.poulose@arm.com> <1530270944-11351-16-git-send-email-suzuki.poulose@arm.com> From: Suzuki K Poulose Message-ID: <8392ecb1-50ce-c448-54f7-bf3021ae508b@arm.com> Date: Mon, 2 Jul 2018 14:31:13 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 15/20] kvm: arm/arm64: Allow tuning the physical address size for VM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marc Zyngier , linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, cdall@kernel.org, eric.auger@redhat.com, julien.grall@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, punit.agrawal@arm.com, qemu-devel@nongnu.org, Peter Maydel , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= On 02/07/18 14:13, Marc Zyngier wrote: > On 29/06/18 12:15, Suzuki K Poulose wrote: >> Allow specifying the physical address size for a new VM via >> the kvm_type argument for KVM_CREATE_VM ioctl. This allows >> us to finalise the stage2 page table format as early as possible >> and hence perform the right checks on the memory slots without >> complication. The size is encoded as Log2(PA_Size) in the bits[7:0] >> of the type field and can encode more information in the future if >> required. The IPA size is still capped at 40bits. > > Can't we relax this? There is no technical reason (AFAICS) not to allow > going down to 36bit IPA if the user has requested it. Sure, we can. > > If we run on a 36bit IPA system, the default would fail. But if the user > specified "please give me a 36bit IPA VM", we could satisfy that > requirement and allow them to run their stupidly small guest! Absolutely. I will fix this in the next version. Cheers Suzuki From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki.Poulose@arm.com (Suzuki K Poulose) Date: Mon, 2 Jul 2018 14:31:13 +0100 Subject: [PATCH v3 15/20] kvm: arm/arm64: Allow tuning the physical address size for VM In-Reply-To: References: <1530270944-11351-1-git-send-email-suzuki.poulose@arm.com> <1530270944-11351-16-git-send-email-suzuki.poulose@arm.com> Message-ID: <8392ecb1-50ce-c448-54f7-bf3021ae508b@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 02/07/18 14:13, Marc Zyngier wrote: > On 29/06/18 12:15, Suzuki K Poulose wrote: >> Allow specifying the physical address size for a new VM via >> the kvm_type argument for KVM_CREATE_VM ioctl. This allows >> us to finalise the stage2 page table format as early as possible >> and hence perform the right checks on the memory slots without >> complication. The size is encoded as Log2(PA_Size) in the bits[7:0] >> of the type field and can encode more information in the future if >> required. The IPA size is still capped at 40bits. > > Can't we relax this? There is no technical reason (AFAICS) not to allow > going down to 36bit IPA if the user has requested it. Sure, we can. > > If we run on a 36bit IPA system, the default would fail. But if the user > specified "please give me a 36bit IPA VM", we could satisfy that > requirement and allow them to run their stupidly small guest! Absolutely. I will fix this in the next version. Cheers Suzuki