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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAC28C04E53 for ; Wed, 15 May 2019 12:05:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB1DA20657 for ; Wed, 15 May 2019 12:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557921946; bh=J+NAxvkDak5mBXRbfG7zbAzO+rFlbb67MBQ+RR8k4wI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cn+5QZsE9RxWm6tEswu/mUO32vt8dkFoG+VK5ajCqgydRyW9F9+FM3hFv1imQAzuV 9/ZSJiL+Krl/5Pk0RoyoTvQ6p/vGX+dkRIsP6+/yLPE+2RzMzs2nJ5zxxmSKrF1E4l OONwBkeCv/nPI585l3Ky1PAInqah4U4t6aHmq3Yc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729463AbfEOLKs (ORCPT ); Wed, 15 May 2019 07:10:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:44862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729457AbfEOLKq (ORCPT ); Wed, 15 May 2019 07:10:46 -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 D0DBB20862; Wed, 15 May 2019 11:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918645; bh=J+NAxvkDak5mBXRbfG7zbAzO+rFlbb67MBQ+RR8k4wI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i7xCWoTLVrR8w8WC89yc1nqAz+cuxovVBFnzrtGMJ59cEudEc9eJQtaowJ0TAEG/k ETY5EkCLg24d+3SCFU8VovVllqRZycGvSAcWAWPcrlNNB9DRdC/VlqlKFKUQEqtU2V rTgNdJnl0y/2iyNmNe77Oz4jVY6FOe8OsDwDm5nM= 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.4 168/266] KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing Date: Wed, 15 May 2019 12:54:35 +0200 Message-Id: <20190515090728.603369013@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 ab9ae67a80e44..0ec94c6b47576 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