Received: by 10.192.165.148 with SMTP id m20csp3840039imm; Mon, 30 Apr 2018 07:17:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqavtm3gOsGwX+Sg63uOsveAi+YyvC6JCZ1irwGd1fugUE4dor5xFF0vHMz/S1zHhO2m9n+ X-Received: by 10.98.159.202 with SMTP id v71mr12181130pfk.233.1525097859192; Mon, 30 Apr 2018 07:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525097859; cv=none; d=google.com; s=arc-20160816; b=xSZy0Ot7bmIC4u2SquJVepTMXzL0T+DQfpX59u+jvodCF8WoTCn4aH9T0KmV7CVj9a SFKV4jemnxMdb8LIVuOSp4+7Bt4kzjl9qp7Mo1l6q2HXrE1F7IQbIjaUxL/qaZ2jbrD0 3vjoMaVby33/XXTvEqJFSB1TFGEQXOmVVtsGEarPf4IVyQeNbnOE7SXrpYhyY0Sr5EM2 RmzoQbF6yiHemdLKSLK6qbVEfrzchJc40JEu7U8HiqDYLMpoDxaO8c7Y73dRFzh8hGP2 FlFzYEWUzXFCL9oNZLSmwNoct8Kmc0GnZjNC3Ek/zrSJlwAtAyqFECK1rq5UnEcxxG7D ms5A== 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=FI4kkjekYwWNyo6/JephE0koj4hje+eyRI83AtvdzS8=; b=jjup34UTfaKCkLKjOwtDLBHXOd/Ewrf8/SWZGdXhTYyAd3xSgzoR6c2h8qbbkKCsWQ xfoIQ1K2wrHfqu/h8R2BpG+6gp6BqRFcHMJvnDrPLK+0i5ezaCY4RslSSX1K98XWV8Lu dPNlBCVRToJpezpYyBsljzOKP5B4ce7zDDt0kVgagDxGtg3C7qJ84uCEgStgbRIlBghD 8+WobjwYx/Hw6Iy6tHcMR6g4Dc41fbqZV0QzGCtuQRlfpWF3s1uPrBPVAPF/TdT/5HqT VWUvFyiFP4yyccA4qbiRu52D971qt6Oy9aceMVIcFdLge1Y7S5MFd0WhuDB50Vc290Fo IzBQ== 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 r14si7319386pfh.211.2018.04.30.07.17.24; Mon, 30 Apr 2018 07:17:39 -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 S1754217AbeD3ORG (ORCPT + 99 others); Mon, 30 Apr 2018 10:17:06 -0400 Received: from foss.arm.com ([217.140.101.70]:37116 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754056AbeD3ORF (ORCPT ); Mon, 30 Apr 2018 10:17:05 -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 999E415BF; Mon, 30 Apr 2018 07:17:04 -0700 (PDT) Received: from [10.1.206.53] (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A8E4A3F587; Mon, 30 Apr 2018 07:17:02 -0700 (PDT) Subject: Re: [kvmtool PATCH 21/17] kvmtool: arm: Add support for creating VM with PA size To: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Cc: ard.biesheuvel@linaro.org, kvm@vger.kernel.org, marc.zyngier@arm.com, catalin.marinas@arm.com, punit.agrawal@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, kristina.martsenko@arm.com, pbonzini@redhat.com, kvmarm@lists.cs.columbia.edu References: <1522156531-28348-1-git-send-email-suzuki.poulose@arm.com> <1522156531-28348-22-git-send-email-suzuki.poulose@arm.com> From: Julien Grall Message-ID: <21da5232-5be6-7d48-a5a6-2d89f3c0f682@arm.com> Date: Mon, 30 Apr 2018 15:17:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522156531-28348-22-git-send-email-suzuki.poulose@arm.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 Hi, On 27/03/18 14:15, Suzuki K Poulose wrote: > diff --git a/arm/kvm.c b/arm/kvm.c > index 5701d41..a9a9140 100644 > --- a/arm/kvm.c > +++ b/arm/kvm.c > @@ -11,6 +11,8 @@ > #include > #include > > +unsigned long kvm_arm_type; > + > struct kvm_ext kvm_req_ext[] = { > { DEFINE_KVM_EXT(KVM_CAP_IRQCHIP) }, > { DEFINE_KVM_EXT(KVM_CAP_ONE_REG) }, > @@ -18,6 +20,25 @@ struct kvm_ext kvm_req_ext[] = { > { 0, 0 }, > }; > > +#ifndef KVM_ARM_GET_MAX_VM_PHYS_SHIFT > +#define KVM_ARM_GET_MAX_VM_PHYS_SHIFT _IO(KVMIO, 0x0a) > +#endif > + > +void kvm__arch_init_hyp(struct kvm *kvm) > +{ > + unsigned max_ipa; > + > + max_ipa = ioctl(kvm->sys_fd, KVM_ARM_GET_MAX_VM_PHYS_SHIFT); > + if (max_ipa < 0) Another issues spotted while doing some testing. This will always be false because max_ipa is unsigned. I think we want to turn max_ipa to signed. Cheers, -- Julien Grall