Received: by 10.192.165.148 with SMTP id m20csp775812imm; Fri, 27 Apr 2018 07:20:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqLrolhPqE/2RCEmFpHUAtlucpsEuLKuDpGzzUq7zfrRCsTZmZ0xvRFDOaM5Qh9d3eHZNW6 X-Received: by 10.98.163.21 with SMTP id s21mr2430414pfe.168.1524838855096; Fri, 27 Apr 2018 07:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838855; cv=none; d=google.com; s=arc-20160816; b=V8jxJ/ojBuTj3WZbn3fCU2Ojd7rz6ee7W6Kc/M6voBPbaMbmAGkZVRG5CMW/qoaap4 RHIw2XPCZ2y2NNRAvnL49QE0qBYOzUN6nI60fAwahNPJfrAYN5F3ghoq2eDpXJ4E7Qnt CQDK29FEBl6zVuPZgWkT+RWdOoS9bQSw0EQKQFTefIV4msADyGa68TdZH4gGEXVzya9z HJNg7q3+DcV4XaGiTD7b2+SRlY4DKQEMBjquGg+hi1096xsDBDaDl5uLSYfENVVTvkzE 90BXQKjSYKGyDnMPTDbr6n3LXCJk1nYCuAKFZW9KGBKTbCeef1kQHjE02Ab8OpvAAEU2 ntyQ== 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=BsVnCqWAOKla4K2x3bcnysq9fW5pKSKgTyDO8i7/R/A=; b=KjWl+R09xFQrscUS4GZ1ikOwWqcxPuAoFA/H832fkD2vSI7OdiqKJOBcml3H75Rv10 giS2eTEBA1xUbKnkVBH8Ryia1pcwKvy/KrLhPKZi+ltvpny9h7tIC6L3boYWFplydmea wCqjMby2D6L6Qw7DpeqknyUtX1xnJRTi6EEcCNyLLBCQhzZKsUSxJhF9ZRE5YSXMlJzd xSGVRlQ0HKR84XlFwqfWmA4BgWIb+DfqZLe3qmvSSTjaAW2QuusAWwjODETQnlmuJNJu d9PfP6TovLSJZPXH3W7qiUQCmbz9+UK5UgahsY5sHpf8CpcGs8EaDnCZYkqALvVtVirO 9fww== 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 v7-v6si1287867pgr.443.2018.04.27.07.20.40; Fri, 27 Apr 2018 07:20:55 -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 S935419AbeD0OPW (ORCPT + 99 others); Fri, 27 Apr 2018 10:15:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43676 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935250AbeD0OPS (ORCPT ); Fri, 27 Apr 2018 10:15:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0ABE381A32CD; Fri, 27 Apr 2018 14:15:18 +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 5A48FAB581; Fri, 27 Apr 2018 14:15:16 +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 v4 02/12] KVM: arm/arm64: Document KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION Date: Fri, 27 Apr 2018 16:14:55 +0200 Message-Id: <1524838505-3823-3-git-send-email-eric.auger@redhat.com> In-Reply-To: <1524838505-3823-1-git-send-email-eric.auger@redhat.com> References: <1524838505-3823-1-git-send-email-eric.auger@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 27 Apr 2018 14:15:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 27 Apr 2018 14:15:18 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 Reviewed-by: Peter Maydell --- v3 -> v4: - Added Peter's R-b --- Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 25 ++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt b/Documentation/virtual/kvm/devices/arm-vgic-v3.txt index 9293b45..cbc4328 100644 --- a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt +++ b/Documentation/virtual/kvm/devices/arm-vgic-v3.txt @@ -27,9 +27,32 @@ 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. + - 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. + 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 -ENXIO: The group or attribute is unknown/unsupported for this device or hardware support is missing. -- 2.5.5