From patchwork Mon Mar 6 11:34:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 9605855 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 66396602B4 for ; Mon, 6 Mar 2017 11:45:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 419C628236 for ; Mon, 6 Mar 2017 11:45:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34D3E28305; Mon, 6 Mar 2017 11:45:40 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C02BA28236 for ; Mon, 6 Mar 2017 11:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9U5vsJG0StAXj63oHXMpZpQ6Urys32U39tioFKFNzsQ=; b=conHZN5krpiDNVDbCXuDbiZXhv DEwNfV0xCNHQ1hgkUqg68tCNLEv+BXtrH7SAjE3HVh0d4A9wgT+vnemaZoWngx3dUkv69XoHefPoL Xc5MU3dtPOH0wJOYf+rNE4fqclaJbd+PgRmReZUsAfkH/i0DUkM/I623Wyc5MiCnGc8N0YoT4Gxqu LUO+TQ9ykIu+bHhHPLYJTcmPK2HQsvreiaxMM/JG+/7yfNXSHCi8nsfsH9kZHlkG4zNFA/IlQSTYi nbdk0mySw0HTWiq9vidDsxUdqhVWr+iHNEXrx3Zj8jRdVr7PJqJLZWtJwhR6rFz6CyMEOmnsKuWsl ctjOtiIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ckr55-0003BY-9q; Mon, 06 Mar 2017 11:45:35 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ckr2h-0000Af-Ku for linux-arm-kernel@bombadil.infradead.org; Mon, 06 Mar 2017 11:43:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aZ6I4nd3aRzAbD+OEBl0AJJPh/34LNWJtS13qLPPfcQ=; b=gjzhswaD6FYvG/wEBOEF7MBz2 pGE3ILzKWTvOOUjY6vLRpekZBdsN3HOtD7iEav/EZJ2eTaMARhABFmh3YcHqYprddwfYdo3+dCn10 +2uXmC43/nBLh2ggBIqzBVlrzVL6MxdAUxu+0cK8J6zAVvyvX6+lHGUn7FCrZsAJv0d1KfeyB2Zga cND10DIn3A4a73GFt0zudjPerIylPcKL2DZ8UvkKsRo3xq7wF6lwIOphwpbKdNiGipIUKv9LxLKjy A05fn572Gd+ck9ZIM8MPD2ks8De7Rh1eY0vTpXBaqjhhQUkcxXRGT/4VOE+PRxoO4mrphok0Smwta DPXFIpzOA==; Received: from mx1.redhat.com ([209.132.183.28]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ckqvq-0003N6-FX for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2017 11:36:04 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C2E1C054C4A; Mon, 6 Mar 2017 11:35:21 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-100.ams2.redhat.com [10.36.116.100]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v26BYbnY002618; Mon, 6 Mar 2017 06:35:17 -0500 From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, marc.zyngier@arm.com, christoffer.dall@linaro.org, vijayak@caviumnetworks.com, Vijaya.Kumar@cavium.com, peter.maydell@linaro.org, linux-arm-kernel@lists.infradead.org, drjones@redhat.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Subject: [PATCH v3 09/19] KVM: arm64: ITS: Interpret MAPD ITT_addr field Date: Mon, 6 Mar 2017 12:34:24 +0100 Message-Id: <1488800074-21991-10-git-send-email-eric.auger@redhat.com> In-Reply-To: <1488800074-21991-1-git-send-email-eric.auger@redhat.com> References: <1488800074-21991-1-git-send-email-eric.auger@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 06 Mar 2017 11:35:21 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170306_113602_659895_395596D3 X-CRM114-Status: GOOD ( 13.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andre.przywara@arm.com, pbonzini@redhat.com, dgilbert@redhat.com, quintela@redhat.com, Prasun.Kapoor@cavium.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Up to now the MAPD ITT_addr had been ignored. We will need it for save/restore. Let's record it in the its_device struct. Signed-off-by: Eric Auger --- virt/kvm/arm/vgic/vgic-its.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index 56bcd92..694023f 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -99,6 +99,7 @@ struct its_device { /* the head for the list of ITTEs */ struct list_head itt_head; + gpa_t itt_addr; u32 nb_eventid_bits; u32 device_id; }; @@ -562,6 +563,7 @@ static u64 its_cmd_mask_field(u64 *its_cmd, int word, int shift, int size) #define its_cmd_get_collection(cmd) its_cmd_mask_field(cmd, 2, 0, 16) #define its_cmd_get_target_addr(cmd) its_cmd_mask_field(cmd, 2, 16, 32) #define its_cmd_get_validbit(cmd) its_cmd_mask_field(cmd, 2, 63, 1) +#define its_cmd_get_ittaddr(cmd) its_cmd_mask_field(cmd, 2, 8, 44) #define its_cmd_get_size(cmd) its_cmd_mask_field(cmd, 1, 0, 5) /* @@ -832,6 +834,7 @@ static int vgic_its_cmd_handle_mapd(struct kvm *kvm, struct vgic_its *its, u32 device_id = its_cmd_get_deviceid(its_cmd); bool valid = its_cmd_get_validbit(its_cmd); size_t size = its_cmd_get_size(its_cmd); + gpa_t itt_addr = its_cmd_get_ittaddr(its_cmd); struct its_device *device; if (!vgic_its_check_id(its, its->baser_device_table, device_id)) @@ -862,6 +865,7 @@ static int vgic_its_cmd_handle_mapd(struct kvm *kvm, struct vgic_its *its, return -ENOMEM; device->device_id = device_id; + device->itt_addr = itt_addr << 8; device->nb_eventid_bits = size + 1; INIT_LIST_HEAD(&device->itt_head);