Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1952659pxu; Sun, 13 Dec 2020 08:37:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzs6vt2s/qhWfPHWo7T3UZ2ESLDsgxfl3/Z+qd7HmOawP8hME+8CtJD9En4Hd9kCIOaC57+ X-Received: by 2002:a17:906:660b:: with SMTP id b11mr19275458ejp.190.1607877461808; Sun, 13 Dec 2020 08:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607877461; cv=none; d=google.com; s=arc-20160816; b=Ay0ek5e5JUJ+eKQCiXvg2kriQK1b1ynHBvLgSo3MrAbxGxlNOuu0nuIxxrHPWmTy5i AfSJlT/s95YE5TWfQmbSfqkJqO3hAd+He8gB2h1snMFnRVfTEZjE9FTbbNcKWYVO0B+H yW1yJlW19J6ipU3vaQE3x1j6ZXT7lmBMHe/Va+jVo5xa6F+XF1WVKYgx1XfaK8zy0xz5 d6j43H3Dsv06l5Quaak+OOhOYRfcgszvLvd1gMysk2/XYuPTzkPOkkJsGj/ffUub+RXJ mMre5v3UW/xFHH5hBfMaAkahTniCKlj1CnfwCpukJktG05XxDmfOvrkTahw3OJQOcMWb OyzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dRab5lNNMKQ4h1Cgpx6Hakf/XLGnhqOfT0II2ep+iVg=; b=CStKMbswezGkwarjmo/ll1XaIYv3Ya3Mgfg0k06uwi/A7u3XXnoZZa1GPrgsnFd8JB 2g+J/cCIEuyYp36a1078fqdfoMfV0y9AqHA6Y7/1vLj2HZfp6jH59wJcihVRfkvP+/Dp o300Gb7ejU/6Je5F2fymQaWcepZ4qi9NUGIKlkitOQTCrt2kUacb2nMLFmt71padHgqM CpOeULQjcUrVYbi/XNGnT1iwfYOtJlYFt/sf/GvnkNFlbn/avJOeXNLosDwFkSsE46Gb igzTNwlNC6IeOCTaqffM6dVOMuNeGzH0AQJIjp8ei0fG2HbD8DE8CrRuk1wLU18ADSq7 07Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ghD0tYUp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si8076281ejr.608.2020.12.13.08.37.18; Sun, 13 Dec 2020 08:37:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ghD0tYUp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407760AbgLLSwT (ORCPT + 99 others); Sat, 12 Dec 2020 13:52:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46870 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407747AbgLLSwI (ORCPT ); Sat, 12 Dec 2020 13:52:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607799042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dRab5lNNMKQ4h1Cgpx6Hakf/XLGnhqOfT0II2ep+iVg=; b=ghD0tYUptf2OKfzRBQZkYJNS+9iJStx0b2/7dHV61961XmFsFKhKgPoSaufFsXEwQCebqH 0IP3CJYNrSkDGQ4yFfrPOyyOKBAjcRv6hlPJgFV7H3mc9YDeRGe80lZ6XA/FxdXJ61DHPE MP+tJ4aeao1aAmYpUaAvMcY3uzmQzlE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-t6d4hLZmPU6fcwpA_jTt0Q-1; Sat, 12 Dec 2020 13:50:40 -0500 X-MC-Unique: t6d4hLZmPU6fcwpA_jTt0Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2936107ACF5; Sat, 12 Dec 2020 18:50:38 +0000 (UTC) Received: from laptop.redhat.com (ovpn-115-41.ams2.redhat.com [10.36.115.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA21F1F069; Sat, 12 Dec 2020 18:50:35 +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, maz@kernel.org, drjones@redhat.com Cc: alexandru.elisei@arm.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, shuah@kernel.org, pbonzini@redhat.com Subject: [PATCH 4/9] KVM: arm/arm64: vgic: Reset base address on kvm_vgic_dist_destroy() Date: Sat, 12 Dec 2020 19:50:05 +0100 Message-Id: <20201212185010.26579-5-eric.auger@redhat.com> In-Reply-To: <20201212185010.26579-1-eric.auger@redhat.com> References: <20201212185010.26579-1-eric.auger@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On vgic_dist_destroy(), the addresses are not reset. However for kvm selftest purpose this would allow to continue the test execution even after a failure when running KVM_RUN. So let's reset the base addresses. Signed-off-by: Eric Auger --- arch/arm64/kvm/vgic/vgic-init.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 32e32d67a127..6147bed56b1b 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -335,14 +335,16 @@ static void kvm_vgic_dist_destroy(struct kvm *kvm) kfree(dist->spis); dist->spis = NULL; dist->nr_spis = 0; + dist->vgic_dist_base = VGIC_ADDR_UNDEF; - if (kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) { + if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) { list_for_each_entry_safe(rdreg, next, &dist->rd_regions, list) { list_del(&rdreg->list); kfree(rdreg); } INIT_LIST_HEAD(&dist->rd_regions); - } + } else + kvm->arch.vgic.vgic_cpu_base = VGIC_ADDR_UNDEF; if (vgic_has_its(kvm)) vgic_lpi_translation_cache_destroy(kvm); @@ -362,6 +364,7 @@ void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu) vgic_flush_pending_lpis(vcpu); INIT_LIST_HEAD(&vgic_cpu->ap_list_head); + vgic_cpu->rd_iodev.base_addr = VGIC_ADDR_UNDEF; } /* To be called with kvm->lock held */ -- 2.21.3