Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1155750rdb; Fri, 2 Feb 2024 16:15:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCOOReu2R2JBd1AgErUtp3iRm/sO2CjDzcLJkvd7CDoefnxQfUpmlNiLqW350E7JcuzmTY X-Received: by 2002:a17:902:680d:b0:1d9:7228:b345 with SMTP id h13-20020a170902680d00b001d97228b345mr2971767plk.2.1706919302753; Fri, 02 Feb 2024 16:15:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706919302; cv=pass; d=google.com; s=arc-20160816; b=LOXRmfkCygYIkJ3R+2MRkmfS0o0TGfzJAEQJj50oZVRxJPzJ3exm+ENhOlxxcfAsnh Kqz1LriHGIYHEmCZ8Alf8Z9gEHxbweJvf2XkbBvF8OLaMt/Vuc3lImpFky5BE3QNzf6j bsgSEN6MaVUVD6d0v22CHip4N+ZmMHjVFB8S/L0wYS6zVNdgH7NWERfNJPMAInYRaoub LZ7fm3+rjmAWlf4iCKdllumfEduucxwbNs3I9RX2ZZ/FfQMO1ujidhI9ohqB6HPrFo3b Cwsge7T5+xntVWLQXyxuKIkIeGss3iIkLxRR/06qxAf7E48YgoUcH1OQZe+RWG1IlNSe VGEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=CXBUPXpWgAm5r1Pnwblz/7nmofC0KqBjONaFx44tX7w=; fh=IhIwVRF11HAKvyFuTjrARiHt0UHGkJMZbPmsnh/XfFk=; b=yZWwXF8BgDsTT2NhhTHu7l3Riu7Uuc4QBNJ5tlRtlx3AbZ7gM/VvzLReYwZ13u3Gvd clZhci2EK2Mq18FLXrID6n33UTnSnGpdZBXBiNGEgfgOnaMBVX7NeSIfJUx7J7BsRjo1 n1/X+V41s1FAOpDhdKfw3l5xH9nNFdfEjEL2eKwjz05eT2ro2VE7KZ5+52v0skGYsyJk U8xng4mTPskM4JfASPIf9NeenOgoeK5RhW3sIc4QGolwfhQaTxLY/wAwJzYcsyziKdLR VnmutHlGlUnPelJBSnkBVn+nRxvXrEkA6BqYdt1OgJMsoT/kZDH5PgXj9oBHKMppIk8y RLrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ua01M4jw; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-50759-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCWRXsdrVULWOYDqxlHE5FSKB/SzFiWv8PLZfiYSHBqXokLzbTPeqNSKjeyKlSd374JlleTs/Az0+Yn2Z10B5v9ecb5dNOa6oo5/9SGaJQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u18-20020a170902e21200b001d8f9b3ed79si2422447plb.86.2024.02.02.16.15.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 16:15:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50759-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ua01M4jw; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-50759-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C411B28D64B for ; Sat, 3 Feb 2024 00:14:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 340F76127; Sat, 3 Feb 2024 00:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ua01M4jw" Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EEA1468F for ; Sat, 3 Feb 2024 00:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706919127; cv=none; b=mdBEA5OakOQbIsPUSgQOZTN76r1xYmWWbgLnY4AMgbdEQcvyr/3hNjE2oB2hqdE3ReBMAiy91IYnX4MYSHNl5hVcUYPFfVZ+EUF3Pt47USEPkzzKqDcirOdBsifelHU6okJAZ/E3Xn5PfS48zlqhRWRQ2W4SbxEkyiQ5raUiOho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706919127; c=relaxed/simple; bh=Q1o0DofRcMLTLWDBsn9giV1FxN9HMwZqB6JfLff9xJw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WYZ4rl4Ck9BIxra/V4gCkLN6DhNSEsVgw9hL1QDgYNy81O7UAWZV3Nw5LRC7XMs94ZWmWcAeUBjV733Vwx75eNnXPoSf6shTuHbJzKfJm32e+B6PduxOJe+wMpWMrG/TQbXnHinxrCDEpxw40829Yw52ggUfHFcV2FHcpAzyeaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ua01M4jw; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-6de2116e7c2so2429713b3a.1 for ; Fri, 02 Feb 2024 16:12:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706919125; x=1707523925; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=CXBUPXpWgAm5r1Pnwblz/7nmofC0KqBjONaFx44tX7w=; b=ua01M4jwGIW06XAqfJ55qP01Y0fI+E4x+oVxmSkh+0wX8EL3Qr3iQNOvKxaSPwGu+C AW7a5nGXh1s77c5p18hIwh1i5biLUmAWZ4FTU10p5BP97XHQgZg5aAKHxLnASFUCJd81 wDX3rePJRwQ81EloYsTWIHPACum+u+d2Qi85V0ukxUiXq5WnTOJqr7UxCONVA571eUTw mzxwx+XGrtmQKMpkFe1m1L3t9TKTm1WG07qltU0/Mo9W6NybiTwe5loiM2kSg5nllzw0 rCoq06LLuEpIYAfnXTK1PqOdWrTTttFlZTmmM83FdZ2pMBp9NjzHX/+06r89nmeGakYc iw4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706919125; x=1707523925; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CXBUPXpWgAm5r1Pnwblz/7nmofC0KqBjONaFx44tX7w=; b=qUWHP9Ne3G/QJn6KyKSE21Va9S7aSZ93lzg2hHmHB0Zj4PK9sgpwU/Gw45hEdB2lb6 z2migAmMfbFo+jR10EbvM/oA5WE3ERbmLWcu/FCqxbw4VfAisvbfWTXUqt1l9MEVOOz1 sttWAPNteV/q5ZGWntmYnAvPpsMxTr2jZV9qazZRU15V13ERJE0R7kgiAfV5EFrfnW3S YkOFBTkW59rE4AJE0FvJo51XaedecsiVh/8JELJuE/UYzfsRWTNvGiI3mAL+Ew/yZWbE rBZ6umZXibT2BYCCXcYFtd8MyC9XpR2TGRzNgTIpyJoDM4dLFLPfFNlWzOfzLDZx08/P zZ/w== X-Gm-Message-State: AOJu0YwJsiyycPd8+2yDifDoxqOMN3sIEWZcrshrm2Qlc5LWSpZFU7Cb q93/trCEzW0ws/alxiLxRUT+Nhx5Tsd6FaKMj/dFzVzO4fcdzbPKcyEhEOHFQ6n3f72wfXf9JxX CIg== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:1744:b0:6e0:2755:e56 with SMTP id j4-20020a056a00174400b006e027550e56mr19680pfc.3.1706919125499; Fri, 02 Feb 2024 16:12:05 -0800 (PST) Date: Fri, 2 Feb 2024 16:11:29 -0800 In-Reply-To: <20240123221220.3911317-1-mizhang@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240123221220.3911317-1-mizhang@google.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog Message-ID: <170691180776.332020.3187581586977661860.b4-ty@google.com> Subject: Re: [PATCH] KVM: x86/pmu: Fix type length error when reading pmu->fixed_ctr_ctrl From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Mingwei Zhang Cc: "H. Peter Anvin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Tue, 23 Jan 2024 22:12:20 +0000, Mingwei Zhang wrote: > Fix type length error since pmu->fixed_ctr_ctrl is u64 but the local > variable old_fixed_ctr_ctrl is u8. Truncating the value leads to > information loss at runtime. This leads to incorrect value in old_ctrl > retrieved from each field of old_fixed_ctr_ctrl and causes incorrect code > execution within the for loop of reprogram_fixed_counters(). So fix this > type to u64. > > [...] Applied to kvm-x86 fixes. I'll let it stew in -next for a few days before sending a pull request to Paolo. Thanks! [1/1] KVM: x86/pmu: Fix type length error when reading pmu->fixed_ctr_ctrl https://github.com/kvm-x86/linux/commit/05519c86d699 -- https://github.com/kvm-x86/linux/tree/next