Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp490847yba; Wed, 15 May 2019 05:05:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqws0DoewfaY06A9qhLb8NMmD0cjtSFy2tBZrdI2ro8/j+CAnVl1D8ABLCwPg4FbkYu4/2Da X-Received: by 2002:a65:57ce:: with SMTP id q14mr29906120pgr.109.1557921911876; Wed, 15 May 2019 05:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557921911; cv=none; d=google.com; s=arc-20160816; b=FEopHZrIbzFoZQ/ukSXSr0+Lh/TTHcBYPsb1ClDmw/1cN8gXb2Sbbodiifi3Z8pyei HBvVRoTLpk7qWwYyUrsa0FitZTbn/j8OWnfp5FkD62DctKUlBr3yZ1//Ir+JsT1v5D9w UUUtarPcQxuGOMBb285KoJx0YlAn8H34UDeZ1yUJBnN85P9JDwR35kEEB4+3+LQbopBG c/2ozZu7AbVVMFKvCpY5jNc8/w2eor3FDx6RkOutZVogboYh51ZYCuw0ev0941ZO72MX ul3icG34IFbSZHHz2TppYSu29lhlBw0WSHIqXlC4FdZ1kAKZuWCo4TXEOacdn/+IUWP1 id4Q== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MiUf0nd8ShyNmWLz9q46smS/k6jCVVJp9glaDew3UL8=; b=DkiWc6q3q5t5mQJi2hSapikJ8TqqOCRWVuLMPqEEDE4EtR1ejVRy7b5g3OChRf1N8Q POgAFWlQY22nb3kc/CArlJgpY/rLDxRv7Gi5+t5VFUFrpvMSrSP24DSmsgcNId98m6mW GmwJCBMK08xPmfUYD7o9IRe+15HED3Txqjh9KZbD7LYv3eMak0RpHN22JRo+70sIQqnJ tB62ieQ5eG7mxkdSgbAX4TS2MeoPIQdYrjQOn88nx+TfM4CyH/liiVNs7FzGUlCW6BNB k0I0Q5AEo3ckRSSRN1N9GmP8xN6YIDPaPWRYP/PVfKJMDTYcRjycSU0zopCJ8Usb3N8a RgVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nGtvYzan; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si1642815pgi.335.2019.05.15.05.04.56; Wed, 15 May 2019 05:05:11 -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=@kernel.org header.s=default header.b=nGtvYzan; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730052AbfEOLN5 (ORCPT + 99 others); Wed, 15 May 2019 07:13:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:49712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728897AbfEOLNw (ORCPT ); Wed, 15 May 2019 07:13:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D63012084E; Wed, 15 May 2019 11:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918832; bh=Lngxvj9aDcojAtm97Ea3iz5LdfpXYW2n78C2GqWzHoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nGtvYzanUyjK9W8+uFm8uoUMreR6gJUYJu39RPcr6TtkWK3vzcRueoJ7tL1yUqdQD DOfpUzFPeZC8kfOXeEEYXOmr7xEt1WCZ+F1N1ZI7DQzQytINMBXg7Vi8gEtXgMt3DV m/C1QQcYCmzUCcI+gQ1n0QCOvZii6BgBjU1uqeZ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitaly Kuznetsov , Paolo Bonzini , Sasha Levin Subject: [PATCH 4.9 17/51] KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing Date: Wed, 15 May 2019 12:55:52 +0200 Message-Id: <20190515090622.715265324@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090616.669619870@linuxfoundation.org> References: <20190515090616.669619870@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 7a223e06b1a411cef6c4cd7a9b9a33c8d225b10e ] In __apic_accept_irq() interface trig_mode is int and actually on some code paths it is set above u8: kvm_apic_set_irq() extracts it from 'struct kvm_lapic_irq' where trig_mode is u16. This is done on purpose as e.g. kvm_set_msi_irq() sets it to (1 << 15) & e->msi.data kvm_apic_local_deliver sets it to reg & (1 << 15). Fix the immediate issue by making 'tm' into u16. We may also want to adjust __apic_accept_irq() interface and use proper sizes for vector, level, trig_mode but this is not urgent. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/trace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index 0a6cc6754ec5a..ea618b713b6f2 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h @@ -434,13 +434,13 @@ TRACE_EVENT(kvm_apic_ipi, ); TRACE_EVENT(kvm_apic_accept_irq, - TP_PROTO(__u32 apicid, __u16 dm, __u8 tm, __u8 vec), + TP_PROTO(__u32 apicid, __u16 dm, __u16 tm, __u8 vec), TP_ARGS(apicid, dm, tm, vec), TP_STRUCT__entry( __field( __u32, apicid ) __field( __u16, dm ) - __field( __u8, tm ) + __field( __u16, tm ) __field( __u8, vec ) ), -- 2.20.1