mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zenghui Yu <yuzenghui@huawei.com>
To: Eric Auger <eric.auger@redhat.com>, <eric.auger.pro@gmail.com>,
	<maz@kernel.org>, <linux-kernel@vger.kernel.org>,
	<kvmarm@lists.cs.columbia.edu>
Subject: Re: [PATCH] KVM: arm/arm64: vgic-its: Fix restoration of unmapped collections
Date: Fri, 13 Dec 2019 18:53:53 +0800	[thread overview]
Message-ID: <d36b75e7-bd83-e501-3bd4-76bf0489c5ce@huawei.com> (raw)
In-Reply-To: <20191213094237.19627-1-eric.auger@redhat.com>

Hi Eric,

On 2019/12/13 17:42, Eric Auger wrote:
> Saving/restoring an unmapped collection is a valid scenario. For
> example this happens if a MAPTI command was sent, featuring an
> unmapped collection. At the moment the CTE fails to be restored.
> Only compare against the number of online vcpus if the rdist
> base is set.

Have you actually seen a problem and this patch fixed it? To be honest,
I'm surprised to find that we can map a LPI to an unmapped collection ;)
(and prevent it to be delivered to vcpu with an INT_UNMAPPED_INTERRUPT
error, until someone had actually mapped the collection).
After a quick glance of spec (MAPTI), just as you said, this is valid.

If Marc has no objection to this fix, please add

Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>


Thanks,
Zenghui

> 
> Cc: stable@vger.kernel.org # v4.11+
> Fixes: ea1ad53e1e31a ("KVM: arm64: vgic-its: Collection table save/restore")
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> ---
>   virt/kvm/arm/vgic/vgic-its.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
> index 98c7360d9fb7..17920d1b350a 100644
> --- a/virt/kvm/arm/vgic/vgic-its.c
> +++ b/virt/kvm/arm/vgic/vgic-its.c
> @@ -2475,7 +2475,8 @@ static int vgic_its_restore_cte(struct vgic_its *its, gpa_t gpa, int esz)
>   	target_addr = (u32)(val >> KVM_ITS_CTE_RDBASE_SHIFT);
>   	coll_id = val & KVM_ITS_CTE_ICID_MASK;
>   
> -	if (target_addr >= atomic_read(&kvm->online_vcpus))
> +	if (target_addr != COLLECTION_NOT_MAPPED &&
> +	    target_addr >= atomic_read(&kvm->online_vcpus))
>   		return -EINVAL;
>   
>   	collection = find_collection(its, coll_id);
> 


  parent reply	other threads:[~2019-12-13 10:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13  9:42 Eric Auger
2019-12-13 10:43 ` Marc Zyngier
2019-12-13 10:55   ` Auger Eric
2019-12-13 10:53 ` Zenghui Yu [this message]
2019-12-13 11:06   ` Auger Eric
2019-12-13 11:28   ` Marc Zyngier
2019-12-13 14:22     ` Zenghui Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d36b75e7-bd83-e501-3bd4-76bf0489c5ce@huawei.com \
    --to=yuzenghui@huawei.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®