Received: by 10.192.165.156 with SMTP id m28csp2118202imm; Thu, 12 Apr 2018 08:55:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx49I/55CyeTYGNZxnxWWxQXXZY3fRLwYlbxOsneS4CZG8TCdq10VGodmxgTnFsadIjsonctv X-Received: by 10.98.7.83 with SMTP id b80mr8181332pfd.133.1523548500135; Thu, 12 Apr 2018 08:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523548500; cv=none; d=google.com; s=arc-20160816; b=paA6SUOasq3+RqWEzYg953Oi+BjMWDaGYKhLANCHkAve6XP3RqOTKAWCzoyhTLSjm/ TDmnObRrzig3u47qwULf1P36g3y1WI2DPUFIlLj7A5X7TGf4lGVCfRmOXLSsRx9XLl9W tb95R4u91w385OvH3djcn+TIC6Q3U1dXaEHO2XmFTMMfrlvlj0sJ49rPco9tK29+jF2l WLamXosWejF1cDJKDuHkZDqF42n+cwYxT5j+GJBWURGhW7ezfe/CVxvmCLYvNM6d1613 d+Hu2bU9SWO1qCLY1jv1T9CSBBTQXXxt8Vpy/K0JQTx0M+weGYuiWf1TDfXRSep/IWpU wB+w== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=CB08cRdTg18tkPmwmGmikZnNWES7PcKMzN0/vbg/LDo=; b=DH88SLwLPLBpEMuHOj45knhQNMUGB2K/vktxzfGQKloFIS2puHkaGWWUYpdS+0PQ0x XYu4How5kh3DNr37JftUzMv7hljmAx3Cbc7WLgJ5gEqesHqmY3cFobtQTFllfgJGCuFT DbhkZRjfkgZDq74iizCrENcK6riTS1ZPQoc5JUGv7YtFA1wiS5BxZ6WZUKBpafPzziKs 8++U7gHatG5W4B5Py454AxRT+NXghgkN9yYg25FJhMlqhRnMFCq5U34ORsS9gxGALM4Q b9tDJUAraNvAqzzjOfh5oVqv+FzX2Uv6oH78TT0JIlJwZ98GqKjLiO28N6JFds9kibPX 2Iuw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si680415pgt.827.2018.04.12.08.54.22; Thu, 12 Apr 2018 08:55:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752962AbeDLPvY (ORCPT + 99 others); Thu, 12 Apr 2018 11:51:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43234 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752761AbeDLPvX (ORCPT ); Thu, 12 Apr 2018 11:51:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 977F3412C31C; Thu, 12 Apr 2018 15:51:22 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-192.ams2.redhat.com [10.36.116.192]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B19FD2023227; Thu, 12 Apr 2018 15:51:20 +0000 (UTC) Subject: Re: [RFC v2 02/12] KVM: arm/arm64: Document KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION To: Christoffer Dall References: <1522159456-10419-1-git-send-email-eric.auger@redhat.com> <1522159456-10419-3-git-send-email-eric.auger@redhat.com> <20180409213852.GJ10904@cbox> Cc: eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, peter.maydell@linaro.org, andre.przywara@arm.com, drjones@redhat.com, wei@redhat.com From: Auger Eric Message-ID: Date: Thu, 12 Apr 2018 17:51:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20180409213852.GJ10904@cbox> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 12 Apr 2018 15:51:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 12 Apr 2018 15:51:22 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eric.auger@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoffer, > Hi Eric, > > On Tue, Mar 27, 2018 at 04:04:06PM +0200, Eric Auger wrote: >> We introduce a new KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attribute in >> KVM_DEV_ARM_VGIC_GRP_ADDR group. It allows userspace to provide the >> base address and size of a redistributor region >> >> Compared to KVM_VGIC_V3_ADDR_TYPE_REDIST, this new attribute allows >> to declare several separate redistributor regions. >> >> So the whole redist space does not need to be contiguous anymore. >> >> Signed-off-by: Eric Auger >> --- >> Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 18 ++++++++++++++++++ >> 1 file changed, 18 insertions(+) >> >> diff --git a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt b/Documentation/virtual/kvm/devices/arm-vgic-v3.txt >> index 9293b45..0ded904 100644 >> --- a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt >> +++ b/Documentation/virtual/kvm/devices/arm-vgic-v3.txt >> @@ -27,6 +27,24 @@ Groups: >> VCPU and all of the redistributor pages are contiguous. >> Only valid for KVM_DEV_TYPE_ARM_VGIC_V3. >> This address needs to be 64K aligned. >> + >> + KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION (rw, 64-bit) >> + The attr field of kvm_device_attr encodes 3 values: >> + bits: | 63 .... 52 | 51 .... 16 | 15 - 12 |11 - 0 >> + values: | count | base | flags | index >> + - index encodes the unique redistributor region index >> + - flags: reserved for future use, currently 0 >> + - base field encodes bits [51:16] of the guest physical base address >> + of the first redistributor in the region. There are two 64K pages >> + for each VCPU and all of the redistributor pages are contiguous > > should this be two 64K pages for the number of redistributors in this > region as specified by count ? yes it is, I will reword. > >> + within the redistributor region. >> + - count encodes the number of redistributors in the region. > > I assume it's implied that the user must register a total number of > redistributors across all the regions that matches the number of vcpus, > and that otherwise something bad happens? Yes the regions registered by the userspace must be large enough to assign all the vcpu redistributors. Otherwise an error is produced on first vcpu run (on map_resources). At that time the number of vcpu is frozen and we can perform the check. Thanks Eric > >> + Only valid for KVM_DEV_TYPE_ARM_VGIC_V3. >> + >> + It is invalid to mix calls with KVM_VGIC_V3_ADDR_TYPE_REDIST and >> + KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attributes. When attempted an >> + -EINVAL error is returned. >> + >> Errors: >> -E2BIG: Address outside of addressable IPA range >> -EINVAL: Incorrectly aligned address >> -- >> 2.5.5 >> > > Thanks, > -Christoffer >