Received: by 10.192.165.148 with SMTP id m20csp3557642imm; Mon, 30 Apr 2018 02:16:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoxrMV6RGlb28N/prEuVtJjXhhGA0ubxlktyvf9uJpTD5Ru0GZepTxsrG3s+KRfXqiGz+V9 X-Received: by 10.98.212.90 with SMTP id u26mr11240371pfl.166.1525079762689; Mon, 30 Apr 2018 02:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525079762; cv=none; d=google.com; s=arc-20160816; b=JeNcW4OVlc+vvF7zsZxUGHOFcu6RndqgHv0swQHxbNmpw89LEmu4Kl2U9CJdRxRSMh sJCUlx+ZuFShKRsTDlz0dTNeicFpjpbW+vHR0hFOhNdRyf+g8RcJBZ0rSNXoZY0r8gvM k6ZGExMLoxysYgMsp2MyS7fVK4rgSzGTNh9xqrI5smLTzGvC4ypCCii2lc/wNLXiOJ3E OdX06JSCbZcRSGhxq64OROKu3yvEQYKIqlVJyUUdvZVWXuiF9PAtIKbVaDzlPPfqWHGz mavpye/FlHnQvB74sXrYMR32GoTkl7Bidrcwt1i+ZKaWqiaELA0F+Q2kMan+hBywNpiO K1ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eCLXw8VUMBPaBbWTmEYLfgJ63v967pEAG3kcIpKKRfY=; b=DhYqU9a0InJHkoj+YVetHNgIncLO0NAsnz5yVSZFgd6Kn1GtKgaDpIzWDvIN6UEjTJ FSZ0T1R3186xtFbT3e3Qz1MpC7GJ4WULcpa0SCG0UKq6OhK6R5yq2LehKAvoMc37ni3E Go+uySYcNGnOVJtslgLNKSDkWTFJ1SSd59UFlhgCI/6CqIVsuflTx7Q05n6b443WDkql BSa48Sx3tmXJxY1iU7FymPq1smD4IPbJ2MJgOdVGfCeuFvZSZ7vtVlX1MKKUBCMLmIDg UdrNN174r3Ts7CqtJBibHwacsCh9OWAo8t+Jf3QGaR20/IfmDc/aZnlG52oa7xwC9H6a AyOA== 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 97-v6si7167430plb.383.2018.04.30.02.15.48; Mon, 30 Apr 2018 02:16:02 -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 S1752894AbeD3JH5 (ORCPT + 99 others); Mon, 30 Apr 2018 05:07:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44910 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752775AbeD3JHx (ORCPT ); Mon, 30 Apr 2018 05:07:53 -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 2ECB684250; Mon, 30 Apr 2018 09:07:53 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-57.ams2.redhat.com [10.36.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D1352024CA1; Mon, 30 Apr 2018 09:07:51 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, cdall@kernel.org, peter.maydell@linaro.org Cc: andre.przywara@arm.com, drjones@redhat.com, wei@redhat.com Subject: [PATCH v5 02/12] KVM: arm/arm64: Document KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION Date: Mon, 30 Apr 2018 11:07:34 +0200 Message-Id: <1525079264-25533-3-git-send-email-eric.auger@redhat.com> In-Reply-To: <1525079264-25533-1-git-send-email-eric.auger@redhat.com> References: <1525079264-25533-1-git-send-email-eric.auger@redhat.com> 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.2]); Mon, 30 Apr 2018 09:07:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 30 Apr 2018 09:07:53 +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 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 --- v4 -> v5: - Document read access - removed Peter's R-b v3 -> v4: - Added Peter's R-b --- Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 30 +++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt b/Documentation/virtual/kvm/devices/arm-vgic-v3.txt index 9293b45..dcb7504 100644 --- a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt +++ b/Documentation/virtual/kvm/devices/arm-vgic-v3.txt @@ -27,16 +27,42 @@ 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 attribute data pointed by kvm_device_attr.addr is a __u64 value: + 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. + - count encodes the number of redistributors in the region. Must be + greater than 0. + There are two 64K pages for each redistributor in the region and + redistributors are laid out contiguously within the region. Regions + are filled with redistributors in the index order. The sum of all + region count fields must be greater than or equal to the number of + VCPUs. Redistributor regions must be registered in the incremental + index order, starting from index 0. + The characteristics of a specific redistributor region can be read + by presetting the index field in the attr data. + 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. + Errors: -E2BIG: Address outside of addressable IPA range - -EINVAL: Incorrectly aligned address + -EINVAL: Incorrectly aligned address, bad redistributor region + count/index, mixed redistributor region attribute usage -EEXIST: Address already configured + -ENOENT: Attempt to read the characteristics of a non existing + redistributor region -ENXIO: The group or attribute is unknown/unsupported for this device or hardware support is missing. -EFAULT: Invalid user pointer for attr->addr. - KVM_DEV_ARM_VGIC_GRP_DIST_REGS KVM_DEV_ARM_VGIC_GRP_REDIST_REGS Attributes: -- 2.5.5