From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3B94C433F5 for ; Thu, 7 Oct 2021 13:51:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E0D661056 for ; Thu, 7 Oct 2021 13:51:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9E0D661056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qCcQ3g5MsBCWcSabTFNSUvX1N6ZKLWyDQlAchxeFHLY=; b=JNlgZilESyIcoB L8yN3U2Kv6X1+vNHjyzo+ZWBYzT3TkoZIRpFhMl1LW1XdAOxZxuYsps+YBXY7B518/Cu2Fgu9SmXE kZx7+NpByD8qW+6aIITKyKV8JaeotkBIJ+tt8Kg/8FYuypFZmbW+U3tH6ziwQWdxs+Ewd/oWoQeT8 Z0SfrIJuLGBWSMhqyKqvv99sJmS1H8XfCr+StdOCLIP/2Og+FG1i++JvwgpI28jKwJQYNHZ0k4Z4Y IFLqkoB+azBLgYPNBexiO3sG69OIXPSVFSpoeu49SiKlH4YNFpqb2eznK0QMeDBqn1DpxC9ZdqNnK oHc/U+BaJjWdFUxnuxnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYTmB-00HWYe-Lz; Thu, 07 Oct 2021 13:49:35 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYTm7-00HWY0-Ds for linux-arm-kernel@lists.infradead.org; Thu, 07 Oct 2021 13:49:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633614568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YV63mS4RpYRoGQSZMwqbE1CRZKLm8qRI0uKOruLtURg=; b=i81V86cXVmYstB2kUR6CDyvShggvjV+7y5CE6LT9OIcmWvuTDK99twXtdTY6o7oYef704f MXD7s+eTSe3DahlsMXm7UoqsZd7BlODiWOzYPlba5Rm1r4gJO2/8PsXTYjSbOmGevmZu0j /Gv5mvJ8LRa2UGqM5SnJgimlvqfmH+A= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-qCoNHgAMPl2qZ6Tpov5tqA-1; Thu, 07 Oct 2021 09:49:27 -0400 X-MC-Unique: qCoNHgAMPl2qZ6Tpov5tqA-1 Received: by mail-qv1-f69.google.com with SMTP id 4-20020a05621420a400b003831d93e2b5so3733296qvd.12 for ; Thu, 07 Oct 2021 06:49:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YV63mS4RpYRoGQSZMwqbE1CRZKLm8qRI0uKOruLtURg=; b=Ky3aIesTt9uENZMIQhIRSSfNZEHtQ4icEwPXeb0JZVYfJd4TNBnJ23eK4T+bfH/R98 WPgT5D7xQeiywBjB6HK7YaAxW150fUDsaE1ngdSu+aY30HEzc7i+A3ygAQFjZA0XDOaj wAOAx3F7nTpRbPENifmLxii5hBX/80zl+dMkv4Mrp1pgZctXK8VeP2Xa5p4glFbR3nDF Qjy2b/DOaHOuRLdr1NnSkhBFgJjtob9Bqr3g+Wpx9+rojT8j+TyXrtrdEwB6rH9VPjWD BZFmZeQTZDNnoF/HUbayfEP/WJVLklqzKOPuCyAxUGhIXcOyXghTuSl/Ny43WABriy3o 6Gkw== X-Gm-Message-State: AOAM531y/aHKxvpaohbBt8dMaYQ1vuXvPkJIdjAhXCiLx3DXhWTRE6XK f8utgXLkpT+Czoc7tJzDBaW2p0j22sD1IHpi5Jq+vCBCPxST791k4fJziYoRR7NK9CgiZsBCkZl FMzVrCI3ROilTeMO00UGYoMqbnewLbGPPsxY= X-Received: by 2002:a05:6214:a4d:: with SMTP id ee13mr4121151qvb.6.1633614567252; Thu, 07 Oct 2021 06:49:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfq2RpXF9UQXSj5gVtwkRFV+YzKin4ZaeJ2Zs5710CY4R+6CVe48FzPtRwNTqzbSzHN22NJA== X-Received: by 2002:a05:6214:a4d:: with SMTP id ee13mr4121130qvb.6.1633614567050; Thu, 07 Oct 2021 06:49:27 -0700 (PDT) Received: from gator (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id n123sm633770qke.36.2021.10.07.06.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 06:49:26 -0700 (PDT) Date: Thu, 7 Oct 2021 15:49:22 +0200 From: Andrew Jones To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, will@kernel.org, qperret@google.com, dbrazdil@google.com, Steven Price , Fuad Tabba , Srivatsa Vaddagiri , Shanker R Donthineni , James Morse , Suzuki K Poulose , Alexandru Elisei , kernel-team@android.com Subject: Re: [PATCH v2 06/16] KVM: arm64: Force a full unmap on vpcu reinit Message-ID: <20211007134922.sg3b3egpwc2izbi2@gator> References: <20211004174849.2831548-1-maz@kernel.org> <20211004174849.2831548-7-maz@kernel.org> MIME-Version: 1.0 In-Reply-To: <20211004174849.2831548-7-maz@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211007_064931_588373_2175D2BC X-CRM114-Status: GOOD ( 20.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 04, 2021 at 06:48:39PM +0100, Marc Zyngier wrote: > As we now keep information in the S2PT, we must be careful not > to keep it across a VM reboot, which could otherwise lead to > interesting problems. > > Make sure that the S2 is completely discarded on reset of > a vcpu, and remove the flag that enforces the MMIO check. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/psci.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/arm64/kvm/psci.c b/arch/arm64/kvm/psci.c > index 74c47d420253..6c9cb041f764 100644 > --- a/arch/arm64/kvm/psci.c > +++ b/arch/arm64/kvm/psci.c > @@ -12,6 +12,7 @@ > > #include > #include > +#include > > #include > #include > @@ -180,6 +181,13 @@ static void kvm_prepare_system_event(struct kvm_vcpu *vcpu, u32 type) > tmp->arch.power_off = true; > kvm_make_all_cpus_request(vcpu->kvm, KVM_REQ_SLEEP); > > + /* > + * If the MMIO guard was enabled, we pay the price of a full > + * unmap to get back to a sane state (and clear the flag). > + */ > + if (test_and_clear_bit(KVM_ARCH_FLAG_MMIO_GUARD, &vcpu->kvm->arch.flags)) > + stage2_unmap_vm(vcpu->kvm); > + > memset(&vcpu->run->system_event, 0, sizeof(vcpu->run->system_event)); > vcpu->run->system_event.type = type; > vcpu->run->exit_reason = KVM_EXIT_SYSTEM_EVENT; > -- > 2.30.2 > Reviewed-by: Andrew Jones _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel