Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp998772rdd; Wed, 10 Jan 2024 05:58:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPETZ07U++biCGV8qopGPxPeCFRlei92/ktPcDw5AXW5HYqhIahLjK0//ES4C9EsEd4uTa X-Received: by 2002:a17:902:64d7:b0:1d4:7628:381c with SMTP id y23-20020a17090264d700b001d47628381cmr906605pli.3.1704895139023; Wed, 10 Jan 2024 05:58:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704895139; cv=none; d=google.com; s=arc-20160816; b=RSF7apn76Cp2xzLJeJnGP1+i4DA30NcF8uZh4ziFUcTQRO+5lWfE/RcknAOuufTEfX 6/wvDxZcRa/f3Mj5nWAq26nC+FOZa6gIQBCCfYJ/E20KebD5iBMDlOcSVdZH7FS7K8dQ 03A0EFb9DPGM6iXlE4FcH0tyylDQAAxB/hKSrY/9/iNLJeEEYc5+zP5lfM9aVIgwfGJs 8iBVhFWT20MbWf9m9s8V2fbL+4uovgB3s9AZgbEdrsxu97zSFD1DwiTYdhodIYFAQB8O SpnbVYNR8nufZiZ9A+GAZK7kbaSW10oGApiezCpBrdMlb4ckLPNjttjXx/yg7L8x5wgA S0UQ== ARC-Message-Signature: i=1; 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=9yJOVt2fYXAhGst0EbC8nRC+5WQ9DxreW7FkWtyA+mY=; fh=/bFbqBNeCIjTEWBCUfhdWjMuRymOVMzvQuJ6X3/hiV8=; b=K26WzrOEtid8G+iRLP+3tfLeLZMvpZzTDkEEm0ZCfUOtcj/8K9wE1/fYrJkzIZqpCK MMjFVnzsrM+pLvt4hgfrbYGi7zXAqL5Jqh0osFgOyqGGc43SUFctz5YrbzvYM4XNnwEZ 1RAgo4LARL8JHIZGOTs9ldbiKDVtBRLbD9kfzfUi6N707Q6VmMgFYtw8INQR+UsuPoOe w6MCMcuvOLkh8XMNe6MpxFqFH+Wd8bKyTZo5N/srZKVv93nOU5gvYg2DSDsiX6k6X1go IoljP9fhwPbryao8rS2NC0klM0A1uOQUUxC3aPNWTps3Usa2QRr81D+58T+g4eizwlCw DSZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Ws/erX7F"; spf=pass (google.com: domain of linux-kernel+bounces-22291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jb4-20020a170903258400b001d51f3c3181si3619072plb.40.2024.01.10.05.58.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 05:58:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Ws/erX7F"; spf=pass (google.com: domain of linux-kernel+bounces-22291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22291-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 9E9B4284B82 for ; Wed, 10 Jan 2024 13:58:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00279495DC; Wed, 10 Jan 2024 13:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Ws/erX7F" Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (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 DA56248CCE for ; Wed, 10 Jan 2024 13:58:47 +0000 (UTC) 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-f201.google.com with SMTP id d2e1a72fcca58-6d9b3242919so2319882b3a.1 for ; Wed, 10 Jan 2024 05:58:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704895127; x=1705499927; 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=9yJOVt2fYXAhGst0EbC8nRC+5WQ9DxreW7FkWtyA+mY=; b=Ws/erX7Ft1cpiAuJL/WVJJfxABEyB4OyTGGRT62vlNaRDg5EPxIkf1hIbJl391pNVi fT1Ps6WRREwrEd9yEaK25y63ADwzBBfUirwIJz4I/E19xsI4XUjevOmgS2GBoyh8nw4L b+ocsomOKN9gTWvphTNYa644E5MOP8D1RAiynvc4qFa+Z7r5imiHUVIVqt69vgNKdV8H iJaahpz/5b9Md4e9AwIfgjesyd49UqXVEPLZEOtBbk3Rt7ec/mjhumhVw9vOfwX9F3di ock+SFbqlHgf4c15F0NEl2OMrorZypmT14QriZq6QHgR52F3oaCzwbptcbbRKW6bv7W/ JLzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704895127; x=1705499927; 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=9yJOVt2fYXAhGst0EbC8nRC+5WQ9DxreW7FkWtyA+mY=; b=iXIp9+TEVKSOeA0uOHWoPLJ1Rs+Whs+MpU1lWvbbQW50fPzvSGIg5RDiMSA0shqd7S GsjtCZx2CRD+PxL8xflqETGDczOuIvsVropNluwk8E9gicdnS4+nOizInCbuQBgH79ux J6UUbKhigcBDi9Uk/lE+eh1RcJf2SYvgUFwoMzg5+8eeGh6cG6SyYXrd34NSdvxXbY+o TokbuW1lcdaKcVNkecLfxa8udohgtoFfTu6dBR6D6iWZSQjdzF+vzfnB6CJKR/Ox2IlE HMQmY+BQgDvweVBOYXUnlc5Vy3JYYOWrbSB1wKZgNEXCGzMlK0ouHLU1n21tjPcGzRiy 2JtA== X-Gm-Message-State: AOJu0YwIP6yDc3JGPZtopMqnCI4UuGWJQm9WJaR6Ns3a92u2zY7ItcZW phkYtKpHIV21BJxWW0Zah5WAVshSD8npMWPO7A== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:39a6:b0:6d9:b26d:d05d with SMTP id fi38-20020a056a0039a600b006d9b26dd05dmr86172pfb.6.1704895127164; Wed, 10 Jan 2024 05:58:47 -0800 (PST) Date: Wed, 10 Jan 2024 05:58:45 -0800 In-Reply-To: <20240110-a69620ca0ebce509dc54f025@orel> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240109230250.424295-1-seanjc@google.com> <20240109230250.424295-16-seanjc@google.com> <20240110-a69620ca0ebce509dc54f025@orel> Message-ID: Subject: Re: [PATCH v10 15/29] KVM: selftests: Add pmu.h and lib/pmu.c for common PMU assets From: Sean Christopherson To: Andrew Jones Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kan Liang , Dapeng Mi , Jim Mattson , Jinrong Liang , Aaron Lewis , Like Xu Content-Type: text/plain; charset="us-ascii" On Wed, Jan 10, 2024, Andrew Jones wrote: > On Tue, Jan 09, 2024 at 03:02:35PM -0800, Sean Christopherson wrote: > > From: Jinrong Liang > > > > Add a PMU library for x86 selftests to help eliminate open-coded event > > encodings, and to reduce the amount of copy+paste between PMU selftests. > > > > Use the new common macro definitions in the existing PMU event filter test. > > > > Cc: Aaron Lewis > > Suggested-by: Sean Christopherson > > Signed-off-by: Jinrong Liang > > Co-developed-by: Sean Christopherson > > Signed-off-by: Sean Christopherson > > --- > > tools/testing/selftests/kvm/Makefile | 1 + > > tools/testing/selftests/kvm/include/pmu.h | 97 ++++++++++++ > > tools/testing/selftests/kvm/lib/pmu.c | 31 ++++ > > Shouldn't these new files be > > tools/testing/selftests/kvm/include/x86_64/pmu.h > tools/testing/selftests/kvm/lib/x86_64/pmu.c /facepalm I'm glad at least one of us is paying attention. If no one objects to not sending yet another version, I'll squash the below when applying. -- diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index ab96fc80bfbd..ce58098d80fd 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -23,7 +23,6 @@ LIBKVM += lib/guest_modes.c LIBKVM += lib/io.c LIBKVM += lib/kvm_util.c LIBKVM += lib/memstress.c -LIBKVM += lib/pmu.c LIBKVM += lib/guest_sprintf.c LIBKVM += lib/rbtree.c LIBKVM += lib/sparsebit.c @@ -37,6 +36,7 @@ LIBKVM_x86_64 += lib/x86_64/apic.c LIBKVM_x86_64 += lib/x86_64/handlers.S LIBKVM_x86_64 += lib/x86_64/hyperv.c LIBKVM_x86_64 += lib/x86_64/memstress.c +LIBKVM_x86_64 += lib/x86_64/pmu.c LIBKVM_x86_64 += lib/x86_64/processor.c LIBKVM_x86_64 += lib/x86_64/svm.c LIBKVM_x86_64 += lib/x86_64/ucall.c diff --git a/tools/testing/selftests/kvm/include/pmu.h b/tools/testing/selftests/kvm/include/x86_64/pmu.h similarity index 100% rename from tools/testing/selftests/kvm/include/pmu.h rename to tools/testing/selftests/kvm/include/x86_64/pmu.h diff --git a/tools/testing/selftests/kvm/lib/pmu.c b/tools/testing/selftests/kvm/lib/x86_64/pmu.c similarity index 100% rename from tools/testing/selftests/kvm/lib/pmu.c rename to tools/testing/selftests/kvm/lib/x86_64/pmu.c