Received: by 10.192.165.148 with SMTP id m20csp3841858imm; Mon, 30 Apr 2018 07:19:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOKqg6FN69g3D/Qy+wghtPDTyACS4emNzLeEkwNJI/RRmGTlouwRnfuUknX6dYUSKpzgSu X-Received: by 10.167.133.206 with SMTP id z14mr12144238pfn.2.1525097969846; Mon, 30 Apr 2018 07:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525097969; cv=none; d=google.com; s=arc-20160816; b=itwfOv46O07CiLnYLMEWXXCVdGDFa1qKQuOAbxAwkGHtaRpxWtZsFrdv9OcHyc9IHQ BH/5yRY4gr3c5ErS/H8C9l50TVLAMKD56Lv9WOTn0XX9FBsoHgmi9+ZNncmIfrNL+k84 1gZ2eKCqq+pCd/sjAUgQD6kuIPuJwgLaWZHzLfvi8g7Xo9xMFVyCYq9C7VoF7pVFN+R4 hkdJbQUqXDj54Dv068NaPH1ukiHnXWeyTqenodDsqFs65WEAYLZGDhX2tnImQIR9+xuN 7HXkQbxXQfAog8uQFUjWMKf2zvcyNKm8vR7aQFMFadc18tXnILMRs2rjRLdlCeyOfwvs waiA== 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=JrpcbGCfnB6vpO6E+kFuIgamOX/AF5bKipXG0BBt1rg=; b=KTudLzTaCYmoXBVivYg55iM+t8JHzkhg7rct7NJRPe6DbXiLQPvjFycq+/rmRNcexm /Lsu36QJJ/G5cs6Y/sYNYuk5dEGCjTjokGrLlovoMyyrefKBwe+1ZgvpMWze/GDeHnh+ 05UQwCOXFkj0UA2ImBai5OcmdX6pNGM42gAj0aRPk4/v7MdpPgpnbJyY+Z27AxQIPLZS A8vY9/VabNZrozRNOVCm9RIxBGu3Oq0CVzYFN+PV9ey15QIJYMgnUrKpjQ6fpMPjNUNy 4B1MNXo0scpz3djah2r8/3nzdWjdBMATP9Sm1SUFhOpPCsDkEJTd5d6PZVzy2oU/AG/g NU7w== 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 f123si7380517pfa.364.2018.04.30.07.19.15; Mon, 30 Apr 2018 07:19:29 -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 S1754224AbeD3OTD (ORCPT + 99 others); Mon, 30 Apr 2018 10:19:03 -0400 Received: from foss.arm.com ([217.140.101.70]:37158 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752868AbeD3OTC (ORCPT ); Mon, 30 Apr 2018 10:19:02 -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 E07F015BF; Mon, 30 Apr 2018 07:19:01 -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 52A353F587; Mon, 30 Apr 2018 07:18:59 -0700 (PDT) Subject: Re: [kvmtool PATCH 21/17] kvmtool: arm: Add support for creating VM with PA size To: Julien Grall , 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> <21da5232-5be6-7d48-a5a6-2d89f3c0f682@arm.com> From: Suzuki K Poulose Message-ID: <8b109c65-59b5-f49e-abe4-73f305d81b87@arm.com> Date: Mon, 30 Apr 2018 15:18:57 +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: <21da5232-5be6-7d48-a5a6-2d89f3c0f682@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/04/18 15:17, Julien Grall wrote: > 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. Good catch. I will fix it. Cheers Suzuki