From patchwork Tue Mar 21 11:05:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9636391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33350602D6 for ; Tue, 21 Mar 2017 11:06:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34CAE28329 for ; Tue, 21 Mar 2017 11:06:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2958228356; Tue, 21 Mar 2017 11:06:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CE7028329 for ; Tue, 21 Mar 2017 11:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756978AbdCULFo (ORCPT ); Tue, 21 Mar 2017 07:05:44 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37940 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755348AbdCULFg (ORCPT ); Tue, 21 Mar 2017 07:05:36 -0400 Received: by mail-wm0-f47.google.com with SMTP id t189so9531830wmt.1 for ; Tue, 21 Mar 2017 04:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DyI9+px9hX8B3bTU9+TYBUx7FI3wv7vtEe0qWAm1NRA=; b=El389jpHYPniCwn5YO2OFXR0xrq5AsPAOGVYZe7BnSprYw/+BTGEzyjTHVIvZXITqD wLOUSOxNRg6c0I2/8J1+W7ANbqTlfnvYO0njlATfcdsKbmyaYMxfmAZeyD6P6q7pa2ik kCdBgWfFxko87R6otVBg9wRUfmC1kQVDmgpDU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DyI9+px9hX8B3bTU9+TYBUx7FI3wv7vtEe0qWAm1NRA=; b=tOjTSEUqnIIG2sOthiWDEfaWrK5Ebr8NM3L8QqlA1qmvq9Ta53Nxt9+s5/ppmZA/8f Aus5BqAPjjOC745/WlVGoZYTSt3RE0Rv55/mwuzYFvVZekL6y7AFji8ZMVYlaHxOjkJx HkZMKdl5+QHrfFvodHHHNDVvv0aGxbOMIWBX99ItjMh/IGog/S0gLhPjtke6wz2/e9Gi c25I4RzvbkO2oYWt+hmQbwQNJ9JxRQJPqhhlj4X5irfhU0Dy4mUC8jcrD9f9AXvg4Ax/ vCYRm+eWwcDX9dkzHSjhg3OgUEHqm2sC6XgRNRq4xjzMyR65UnA+3nc8lQSt7jRzr0D2 0pdw== X-Gm-Message-State: AFeK/H3nrpdvp30DzTYc9bHhLCQUrfIwMQI+YWy/YNYLNgEy6hmYRTycFONxvnfWQiDu4Ka/ X-Received: by 10.28.0.136 with SMTP id 130mr2302161wma.126.1490094334912; Tue, 21 Mar 2017 04:05:34 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id f48sm24358252wrf.17.2017.03.21.04.05.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Mar 2017 04:05:34 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Eric Auger , Vijaya.Kumar@cavium.com, Christoffer Dall Subject: [PATCH 1/5] KVM: arm/arm64: Clarify GICC_PMR export format Date: Tue, 21 Mar 2017 12:05:26 +0100 Message-Id: <20170321110530.15857-2-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170321110530.15857-1-cdall@linaro.org> References: <20170321110530.15857-1-cdall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We are exporting the format of the priority field as it's stored in the GICH_VMCR.VMPriMask field using the lower five bits when accessing register state using the GICC_PMR offset. This is unfortunate, but it's ABI already, so we simply have to make it clear. Signed-off-by: Christoffer Dall --- Documentation/virtual/kvm/devices/arm-vgic.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/virtual/kvm/devices/arm-vgic.txt b/Documentation/virtual/kvm/devices/arm-vgic.txt index 76e61c8..975a904 100644 --- a/Documentation/virtual/kvm/devices/arm-vgic.txt +++ b/Documentation/virtual/kvm/devices/arm-vgic.txt @@ -83,6 +83,12 @@ Groups: Bits for undefined preemption levels are RAZ/WI. + For historical reasons we export the GICC_PMR register in the format of the + GICH_VMCR.VMPriMask field in the lower 5 bits of a word, meaning that + userspace must always use the lower 5 bits to communicate with the KVM + device and must shift the value left by 3 places to obtain the actual + priority mask level. + Limitations: - Priorities are not implemented, and registers are RAZ/WI - Currently only implemented for KVM_DEV_TYPE_ARM_VGIC_V2.