Received: by 10.192.165.148 with SMTP id m20csp4876674imm; Tue, 24 Apr 2018 09:48:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx49TkjjCLVAsnBfRfkaZPjKoMTLLJERxH7A19w4qbh5MMoPBoRsNCSnRI+EwUapbsdk8ynoY X-Received: by 2002:a17:902:8f94:: with SMTP id z20-v6mr25750660plo.174.1524588512031; Tue, 24 Apr 2018 09:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524588511; cv=none; d=google.com; s=arc-20160816; b=D3sMWiuU5d5jBRYXToeBlDGTchpbmwUShb1WjXfH0/valfV/i00ZCx/jyG8qcmRWK5 BBgC0ED5+RGojXEiVNrIzvSNXAcuuKq+ogfeIsgki/FyfIjkjy0YJkUXFWjiP3vSsg++ e8Vzlal/ptG2ItErozU6HsXVemIUVg2vbuT263tMwzjIxWyZTmRFI+wQgnWcYYpFdFzA aynA69ktC/HD2FSJkaz6jr0yUXHzAoXGo9y5hN55IC+Dotypne85Ew1Jtcqf6Vax/GQF YxVS/S6QWyqn+7DeTlxW5qX3T+QmcAgFzr4HD00+8mNP54tivGy5FWl+WO4Rwy6BfKV/ 0jnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=WfabHVVc6wucz2avX48i3FXd3OdHPKsnu65h2Aiulls=; b=1BJaKk1vBkz0ZpKLYKzRZ21xu6TKrcCkAwW5TmNL1XGXyLRCYgnz/uJrHAPbt4KYDf 9/TH9N39vtIEkjyqyZQmFSs7zGj/vW7Ceynf5qaoSaQY2QvGlYIECET+qvIC7/y9dQRU P/Pt+1ijkdeXWaG0r7j3iJVScAtVNvA39TdNHSkaAXCqLeU1zmnu1CScIIz2fMQuCBgi TWj0CYT725TlKYluTaVJPURPJXKq5+Oc0CRz5TaIbEzgTC6pEXWLZVBg1RitGPHB3wZG 2SdqgASd4fGH26o7HPtDL/0jp7jk34+YfuB2eeX6NT3EjNyLt3xd5bokp3xVQfPPjd8h AmTQ== 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 h185si13903139pfe.169.2018.04.24.09.48.17; Tue, 24 Apr 2018 09:48:31 -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 S1751483AbeDXQqz (ORCPT + 99 others); Tue, 24 Apr 2018 12:46:55 -0400 Received: from foss.arm.com ([217.140.101.70]:56954 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbeDXQqw (ORCPT ); Tue, 24 Apr 2018 12:46:52 -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 C9B501435; Tue, 24 Apr 2018 09:46:51 -0700 (PDT) Received: from localhost (unknown [10.37.9.94]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C6F03F25D; Tue, 24 Apr 2018 09:46:50 -0700 (PDT) Date: Tue, 24 Apr 2018 18:46:49 +0200 From: Christoffer Dall To: Eric Auger Cc: eric.auger.pro@gmail.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, andre.przywara@arm.com, drjones@redhat.com, wei@redhat.com Subject: Re: [PATCH v3 02/12] KVM: arm/arm64: Document KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION Message-ID: <20180424164649.GA4533@C02W217FHV2R.local> References: <1523607658-9166-1-git-send-email-eric.auger@redhat.com> <1523607658-9166-3-git-send-email-eric.auger@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523607658-9166-3-git-send-email-eric.auger@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 13, 2018 at 10:20:48AM +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 | 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 I'm not entirely sure I understand the purpose of the index field. Isn't a redistributor region identified uniquely by its base address? Otherwise this looks good. Thanks, -Christoffer > + - 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 >