Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp412900ybb; Fri, 20 Mar 2020 01:13:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvBy8unUq7temzIHDF9qczU6ev9YvEF4frcS1hIz14ykFD3+D9QV+PHxKvG83PJeoN6Rigp X-Received: by 2002:a05:6830:1d58:: with SMTP id p24mr5763394oth.194.1584692010510; Fri, 20 Mar 2020 01:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584692010; cv=none; d=google.com; s=arc-20160816; b=Am5gswBD6U4nnpCvpIrtFSb7/GKLCW83l6XHSocsVJrXMQy9wuFWqhF9DdPatn0+K6 fGzSsAYv6JA74gKJv/sVWBGeUGVttnmCYRAb+f1JgfzmZSYBAEEJqrBZkmUcZ5QQQ8Jy 2NCg82rBoQiOdQMdI9IENND1ixYh+yhSrUMXsf1JTCngFInu4mUUMjpzs29AmPG7zFon r9yjE/cmE69JpUPLlo34Jp5REoZup8aBm8nZGqt8MDHUBJJoiBHwHgK7IYIIhIYb3jCn f4t7a9Uz++/MmHbNTybAHmGF6WZQ8HhzAhCxvOp+a9k5qLulHZfXJVkaqocsyDhbuUU5 HjQQ== 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=8MAqyKfJ2pHFLOBo7NW3E2Ykhz/QSuq5efa4hJ0jsIk=; b=Gs/FXoK3GgceGMizyNNtyAiSjHZ4AnHjf7pD35WNpfALZ8vq8sQ9xYSx0ai7N7PMsS wRwFTM+wN7t085j6W4yDa+l7oT0dKpw17zXxSyi6372tsH3fVpogG6j1dh+wIM5L1tTn nCJ0f+MP7EnBwTpu2426mcMB2NfPJY1WPTTEKFFPyHuScikB6yaAS5F+WUzoDGwvxy5N OVikfvfen1K6xXLVy6c15qypoFbzI9fROfX+uepo32d6L2uFTYX/iBShlB1b/8L/u0wP suMRcKszU5ZMUzDUYS84sHf0cDSqMKuGFkNMg67UYeEJ3ez3pDSdfhQj41za9SHx4BFf jFJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gNtKi/k9"; 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 x13si2524087otk.230.2020.03.20.01.13.18; Fri, 20 Mar 2020 01:13:30 -0700 (PDT) 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="gNtKi/k9"; 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 S1726697AbgCTINA (ORCPT + 99 others); Fri, 20 Mar 2020 04:13:00 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:26465 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbgCTIM7 (ORCPT ); Fri, 20 Mar 2020 04:12:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584691978; 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=8MAqyKfJ2pHFLOBo7NW3E2Ykhz/QSuq5efa4hJ0jsIk=; b=gNtKi/k9K+67e5lA1VjEJaHE4B5WIEC5FmSGGwZisqnlfP9DZJzNJvdmJTnl6PAP2R4yXJ +79Rv2u86jRBHhRETXKUW9qZDybWsJGVJInGDex5zBqpSI+zzd+dNT1sVvHH9HTiepBOSd KueihLgrp2ISrFZxpVJ3GtlpfIkMy9s= 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-343-tyaOxDRDOMaZqNnRvGlzAA-1; Fri, 20 Mar 2020 04:12:54 -0400 X-MC-Unique: tyaOxDRDOMaZqNnRvGlzAA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B401018B9FC1; Fri, 20 Mar 2020 08:12:52 +0000 (UTC) Received: from [10.36.113.142] (ovpn-113-142.ams2.redhat.com [10.36.113.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C90F66EF9D; Fri, 20 Mar 2020 08:12:49 +0000 (UTC) Subject: Re: [PATCH v5 22/23] KVM: arm64: GICv4.1: Allow non-trapping WFI when using HW SGIs To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lorenzo Pieralisi , Jason Cooper , Robert Richter , Thomas Gleixner , Zenghui Yu , James Morse , Julien Thierry , Suzuki K Poulose References: <20200304203330.4967-1-maz@kernel.org> <20200304203330.4967-23-maz@kernel.org> From: Auger Eric Message-ID: <01014c0e-0151-302c-2a7a-fc60f63fba27@redhat.com> Date: Fri, 20 Mar 2020 09:12:48 +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: <20200304203330.4967-23-maz@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 3/4/20 9:33 PM, Marc Zyngier wrote: > Just like for VLPIs, it is beneficial to avoid trapping on WFI when the > vcpu is using the GICv4.1 SGIs. > > Add such a check to vcpu_clear_wfx_traps(). > > Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger Thanks Eric > --- > arch/arm64/include/asm/kvm_emulate.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h > index f658dda12364..a30b4eec7cb4 100644 > --- a/arch/arm64/include/asm/kvm_emulate.h > +++ b/arch/arm64/include/asm/kvm_emulate.h > @@ -89,7 +89,8 @@ static inline unsigned long *vcpu_hcr(struct kvm_vcpu *vcpu) > static inline void vcpu_clear_wfx_traps(struct kvm_vcpu *vcpu) > { > vcpu->arch.hcr_el2 &= ~HCR_TWE; > - if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count)) > + if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count) || > + vcpu->kvm->arch.vgic.nassgireq) > vcpu->arch.hcr_el2 &= ~HCR_TWI; > else > vcpu->arch.hcr_el2 |= HCR_TWI; >