From patchwork Tue May 9 10:44:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9717615 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 5EEE7603F8 for ; Tue, 9 May 2017 10:53:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D5FF27FAC for ; Tue, 9 May 2017 10:53:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41C90283F2; Tue, 9 May 2017 10:53:37 +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 E5DAB2833C for ; Tue, 9 May 2017 10:53:36 +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=WalvcTvkn5ZpYGhapvTuiycnCTDRdTFGNelLf3SC8NQ=; b=Zssv11XhjD2BZ0/WG/1ofjLODr C+phPmvnBQi3BX26UVzV++SBj49ArJZ3Ig+Dv3Oi7loDXV0Ic3b47kuTTbr31VRu58HDVbMITgBce xMiGDTHEC3KMj2w7PpVui2MvqVYbUG6OKVNm6jWo242nyJJn/WtHQnDDf0iiVskElIVIPWYNHFi+S gn44bPWNoqtjUbyyt6dqPVzHiJ8ieaaBY6U2uBYy58iZl3f+nPKuHruiob7zFEGULVEXepclaahlS YAgcStUjFZZHEUxwqZqWvGhPNHugo9moVqRUE9w8cP/knpXviBes+HgamhlyG0C1ZFdJpeAMBcwkt wcTbZGxw==; 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 1d82ls-0004FQ-Hc; Tue, 09 May 2017 10:53:36 +0000 Received: from mail-qk0-x233.google.com ([2607:f8b0:400d:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d82eI-0002qm-AC for linux-arm-kernel@lists.infradead.org; Tue, 09 May 2017 10:45:51 +0000 Received: by mail-qk0-x233.google.com with SMTP id k74so75279936qke.1 for ; Tue, 09 May 2017 03:45:26 -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=ueMGpm6/stX/5g9oEXKL9lB8HBtuccx8e4IZbiPOJ5E=; b=H/PLk2CEpmnNT0SDV9w5tbtx9PJlyXTGoOlEcVAXjpQMbFjjE8KyfTtcNoPsyVHPLj 3OZjfzkCMaIarLCSyTCvwW6mThdTaK0rmr797MV+Aej4G4I66YfjaHHT2XVJ6kc6SLp5 21GtPaPb+WNad0/o/mK6dmsZpd/W6oqJ6E1D0= 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=ueMGpm6/stX/5g9oEXKL9lB8HBtuccx8e4IZbiPOJ5E=; b=gybMHe85fJCr+m1ptTTc6FLAEoPLNbdfc3w352VtHkEaRvldwswTqhp9lKxvz+9QZM QeIqpk5pvZ7kgwditg5I62bV2xwHxPR8L5+kUXyjhn0H+kTRgQTUy/uurK4niZf4jlYJ yCvrLkBszhYA6AiV3sDJZefeZtUMsiUPbsCiKp03bl4pHNRE5zLnlWK/VKuvu0oLeNa/ 0t+wW3TDjiyxRXuCyG3JF51nyFU3XWKNkab00j+5XYVyhGrWB2Yc+F28ahUi+sGzt50u 21inHuP6KXb9t66tSkVN5ShPaDej9IM/zKfP0kiLLZnsU2fRHyB7XzjYVhW04xQO/Vf9 gjrg== X-Gm-Message-State: AODbwcBB+p349hjIa+Bde7pEBxYxIh9kRwDvm4LdEWd6MLw7IXiWiSVc ngO6hUJthV9h8Oya X-Received: by 10.80.168.102 with SMTP id j93mr11172576edc.32.1494326726170; Tue, 09 May 2017 03:45:26 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id o30sm2331510edc.42.2017.05.09.03.45.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 May 2017 03:45:25 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 14/37] KVM: arm64: vgic-its: Interpret MAPD ITT_addr field Date: Tue, 9 May 2017 12:44:43 +0200 Message-Id: <20170509104506.30929-15-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170509104506.30929-1-cdall@linaro.org> References: <20170509104506.30929-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170509_034546_978328_9F98BE96 X-CRM114-Status: GOOD ( 10.94 ) 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: Marc Zyngier , Eric Auger , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 From: Eric Auger 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 Reviewed-by: Christoffer Dall Reviewed-by: Marc Zyngier --- 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 031f6ab..7b95b73 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -104,6 +104,7 @@ struct its_device { /* the head for the list of ITTEs */ struct list_head itt_head; u32 num_eventid_bits; + gpa_t itt_addr; u32 device_id; }; @@ -602,6 +603,7 @@ static u64 its_cmd_mask_field(u64 *its_cmd, int word, int shift, int size) #define its_cmd_get_id(cmd) its_cmd_mask_field(cmd, 1, 0, 32) #define its_cmd_get_physical_id(cmd) its_cmd_mask_field(cmd, 1, 32, 32) #define its_cmd_get_collection(cmd) its_cmd_mask_field(cmd, 2, 0, 16) +#define its_cmd_get_ittaddr(cmd) (its_cmd_mask_field(cmd, 2, 8, 44) << 8) #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) @@ -873,6 +875,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); u8 num_eventid_bits = 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)) @@ -904,6 +907,7 @@ static int vgic_its_cmd_handle_mapd(struct kvm *kvm, struct vgic_its *its, device->device_id = device_id; device->num_eventid_bits = num_eventid_bits; + device->itt_addr = itt_addr; INIT_LIST_HEAD(&device->itt_head);