Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3125008ybl; Fri, 20 Dec 2019 04:21:49 -0800 (PST) X-Google-Smtp-Source: APXvYqx1XtlJp8uEKijqd0YxThxZAFbdCFc3irVZjXQnUimep7jvxH278aKRSxeEjICrw/ke0Qrr X-Received: by 2002:a9d:6211:: with SMTP id g17mr12002661otj.168.1576844509315; Fri, 20 Dec 2019 04:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576844509; cv=none; d=google.com; s=arc-20160816; b=rBVbp3QEIZQuC7VMF5wfFPTLxFgjinKzpnSf3JmbkPbTQK0Fc1hx5gbjBvyWwaocHN ZdsIZqR6DqHNhG0BtrsRNTygjpOoDcW49RaDwiZiAxzUoAevzHtxogYQJcucZ/DQTDu8 UqKuQ6g44dDt5TrL3ZbBihIeOoO2lC+zhubA2h0osBBEZ+I+HgtbWYx7eh91/Bnvx4cY 0a/pjpqcj8fZlaZjlYYZxbmsVu47pbD7Ys2d+t7SBqLfRGy9y5nc3+CL6pLGYbIEGpYD T0ieqxf8ZccfWmNeXkioBXkqMYsZEKwC+y6c23GR4j2XnHAf0Suomv/1K5ix5+GbGOWq Uo6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=nIVo2crlVc/txi8VIButrgzZivg7HgIELD3HSqFbFMs=; b=fwM/fdF6UfsO+GqQKwIhW8b3vb6NOxuWHkzohCUtvBRk7suVe5MkNG6Q8P2ciODqBE bx8zQtiPFcINxrUalci9TlNB7N4bvPucMzl3lckfhQ1zpuuxbW++QMcexjcRXs8aRhed WIj2fr0d9QQifbtf+H5skPl5R1s7hvVeTh8F/WbOLLg7iG+x4QagbWX+N+KLO9A2O6Ju dSK2jrDFsRhpSQU4nv0GIldq2v5G+ex3HE6qVxnr8bs8iV+GyeQV+P6WZP8VcVfYoDjk doB2PXDZWy3+mQ6E8oPrTgSFK5QnrUgiabamuvEpmcFlM2XgAWIDipLhFxnw/ZAg0hOR vG+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=crSTtJZ3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id m4si4993055otn.281.2019.12.20.04.21.37; Fri, 20 Dec 2019 04:21:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=crSTtJZ3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727369AbfLTMUy (ORCPT + 99 others); Fri, 20 Dec 2019 07:20:54 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:37073 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727211AbfLTMUy (ORCPT ); Fri, 20 Dec 2019 07:20:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576844453; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nIVo2crlVc/txi8VIButrgzZivg7HgIELD3HSqFbFMs=; b=crSTtJZ3qSuWo3CmlmEX84NAJP3zbQ8QEJ9khr1zVtc2wyGQ5u9Pl9qL9PQrw/1QM/rfJy AlXqEiqShI1pvyO2t0DhJOVzAr/VFk4kR4O6CeBu8R+kQd2P9ChcJrfwr5oN9dXEGVzlpZ KP1OZeHcIms2jjibVUtc5ELTbJ5auKo= 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-58-KjExN_K5PJeZFLWaH5Dnig-1; Fri, 20 Dec 2019 07:20:46 -0500 X-MC-Unique: KjExN_K5PJeZFLWaH5Dnig-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 45DE7801E66; Fri, 20 Dec 2019 12:20:45 +0000 (UTC) Received: from [10.36.116.117] (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 487485DA75; Fri, 20 Dec 2019 12:20:41 +0000 (UTC) Subject: Re: [PATCH] KVM: arm/arm64: vgic: Handle GICR_PENDBASER.PTZ filed as RAZ To: Zenghui Yu , maz@kernel.org Cc: andre.przywara@arm.com, linux-kernel@vger.kernel.org, wanghaibin.wang@huawei.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org References: <20191220111833.1422-1-yuzenghui@huawei.com> From: Auger Eric Message-ID: Date: Fri, 20 Dec 2019 13:20:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20191220111833.1422-1-yuzenghui@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 12/20/19 12:18 PM, Zenghui Yu wrote: > Although guest will hardly read and use the PTZ (Pending Table Zero) > bit in GICR_PENDBASER, let us emulate the architecture strictly. > As per IHI 0069E 9.11.30, PTZ field is WO, and reads as 0. > > Signed-off-by: Zenghui Yu nit s/filed/field in the commit title Eric > --- > > Noticed when checking all fields of GICR_PENDBASER register. > But _not_ sure whether it's worth a fix, as Linux never sets > the PTZ bit before enabling LPI (set GICR_CTLR_ENABLE_LPIS). > > And I wonder under which scenarios can this bit be written as 1. > It seems difficult for software to determine whether the pending > table contains all zeros when writing this bit. > > virt/kvm/arm/vgic/vgic-mmio-v3.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c > index 7dfd15dbb308..ebc218840fc2 100644 > --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c > +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c > @@ -414,8 +414,11 @@ static unsigned long vgic_mmio_read_pendbase(struct kvm_vcpu *vcpu, > gpa_t addr, unsigned int len) > { > struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; > + u64 value = vgic_cpu->pendbaser; > > - return extract_bytes(vgic_cpu->pendbaser, addr & 7, len); > + value &= ~GICR_PENDBASER_PTZ; > + > + return extract_bytes(value, addr & 7, len); > } > > static void vgic_mmio_write_pendbase(struct kvm_vcpu *vcpu, >