From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 6C1D81FE44D for ; Thu, 9 Jan 2025 19:48:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736452115; cv=none; b=MdjLVHmrZP1WZ9hyaqoEaxykSHcuVxnAuCiyRgOd7F3XXIuqGG5bENbihdhqo4oLUY+sP7tojrlXjhITrGSpRA7aBTcVoVXT6tsxW6GXtKIajxw02BJbMEuSJEm2LshFMP2eJY6fgylCfwGnANHoIxmLMZGSI+yVj1weL/19znc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736452115; c=relaxed/simple; bh=PrFEaEU7DDCl4he6jOcyQtK457MKdnxMIh7aWoIbbEE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tSBRkO28aK0x1YNbX2wMdu7yMsH+5FqM2OmAdKfw5GwoU1w3PaP+70CuIi3yeu1bUSHZfkiaZwKxfaKb9Pkb15GSY2q9peXwepzfIKklcyyEdX8vidVdXzS4gkB8v7lvxNn/pbwHcaJ/5ZbaW05JT3/1dx7n7AS11PmbhXwhPds= 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=K3q9Uu6d; arc=none smtp.client-ip=209.85.216.74 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="K3q9Uu6d" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2ef9204f898so2188778a91.2 for ; Thu, 09 Jan 2025 11:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736452114; x=1737056914; 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=DtNoMkgEfRqjn0GoMRLYiLeDG4/kOjxv1c8ix0/Uo/Q=; b=K3q9Uu6dCXbmcTv6yyOsAGkH2JbMTweuELZANPsBYMl+QhxVsakiAQqKDPzOI6ePtn TCS+2YQ42ITMzpzeqgp+I+LArYxZRB4W65UffOuWQsawnP4EZzsdnt9uDTo4nZXWDBXc oBzlqAS6jLye+AvernsdnTR+yxA+sHNAPerJPUjiag8Ff/gpHcgtCKgKS6VLxCsjf02e qApnadCHcWdbHA8asCmgDEoa2+8r30iRfis88gfVVUbWmIeTB4tD1ASiiqaYBCV3PZOM 5JUklrALxsL83wIMykLvBOMIK/u4fCllNquuNAPqyHtd30lMU0cJFScKhtUtSb2ExZUC Txcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736452114; x=1737056914; 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=DtNoMkgEfRqjn0GoMRLYiLeDG4/kOjxv1c8ix0/Uo/Q=; b=qo/wDrpRMk/aAyt1OqfqvGzLQ94Aw+pPzTjeXTjV0EN5xaMHwQw6X/bkKAR5CLc9L5 CFQQL+gGK6BBHle216f3vHtlc/KpEglFQHSatOKqt9pZhlXygdEsZ+4KuWVM95jhC87E iaYga1G2kEJS/LmaGfp9WUG8CmBuImhVaVwDzuFK3Cetxljk/2/nSLfi/cuI995YPEze 7zOXTi2gyX1Pum0ikvHIPUfpFc2pubQY9zq9Dh04kuASMfmaSBjABg29PnaKBTRCq6uJ wpUXbMTj5Pqi0OrMa/A8PBGe4/S6cxgtEY15LAfFr/FLc/deHNBhezn6TDzMYACPt2md Mj1Q== X-Forwarded-Encrypted: i=1; AJvYcCX4UgwEiWiwKQFcK3WftOWhRxSi1aP5lQqZ3Wx3Q1OuR4HBAA2Blven9qbonvAKCjTO12/EINmA3qr/x0I=@vger.kernel.org X-Gm-Message-State: AOJu0Yye3JHJK6N3KZyXDuVhbUlPIsngkedsbmMibHi0t21j4ixbKKIE ggN9fYIZ5rDGrbv6nJNQ8w0Z+XNSw81K3kriJiKvvkPrlIM5qjI7OzNl0rRQsZwfVmiLlBP11pk 2Qw== X-Google-Smtp-Source: AGHT+IGQsYeXCTLoQtv4zUeKKUd67KMOBJssqkUIj3hvgSqGZyfbB6lhOhAReCaRc5UAnOKDVlHxinf8YUY= X-Received: from pjbsl13.prod.google.com ([2002:a17:90b:2e0d:b0:2ef:85ba:108f]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1f8a:b0:2ee:c9d8:d01a with SMTP id 98e67ed59e1d1-2f548f33b54mr11852213a91.11.1736452113738; Thu, 09 Jan 2025 11:48:33 -0800 (PST) Date: Thu, 9 Jan 2025 11:47:13 -0800 In-Reply-To: <20241220013906.3518334-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241220013906.3518334-1-seanjc@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <173645122896.885867.13450184481916964756.b4-ty@google.com> Subject: Re: [PATCH 0/8] KVM: selftests: Binary stats fixes and infra updates From: Sean Christopherson To: Sean Christopherson , Marc Zyngier , Oliver Upton , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Paolo Bonzini Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Thu, 19 Dec 2024 17:38:58 -0800, Sean Christopherson wrote: > Fix a handful of bugs in the binary stats infrastructure, expand support > to vCPU-scoped stats, enumerate all KVM stats in selftests, and use the > enumerated stats to assert at compile-time that {vm,vcpu}_get_stat() is > getting a stat that actually exists. > > Most of the bugs are benign, and AFAICT, none actually cause problems in > the current code base. The worst of the bugs is lack of validation that > the requested stat actually exists, which is quite annoying if someone > fat fingers a stat name, tries to get a vCPU stat on a VM FD, etc. > > [...] Applied 1-7 to kvm-x86 selftests (x86 wants to build tests on the vCPU-scoped stats infrastructure). I'll hold off on the compile-time assertions stuff until there's consensus that we want to go that route for all architectures (not at all urgent). [1/8] KVM: selftests: Fix mostly theoretical leak of VM's binary stats FD https://github.com/kvm-x86/linux/commit/b68ec5b6869f [2/8] KVM: selftests: Close VM's binary stats FD when releasing VM https://github.com/kvm-x86/linux/commit/a59768d6cb64 [3/8] KVM: selftests: Assert that __vm_get_stat() actually finds a stat https://github.com/kvm-x86/linux/commit/52ef723593fe [4/8] KVM: selftests: Macrofy vm_get_stat() to auto-generate stat name string https://github.com/kvm-x86/linux/commit/7884da344973 [5/8] KVM: selftests: Add struct and helpers to wrap binary stats cache https://github.com/kvm-x86/linux/commit/384544c026f6 [6/8] KVM: selftests: Get VM's binary stats FD when opening VM https://github.com/kvm-x86/linux/commit/6d22ccb1c309 [7/8] KVM: selftests: Add infrastructure for getting vCPU binary stats https://github.com/kvm-x86/linux/commit/60d432517838 [8/8] KVM: selftests: Add compile-time assertions to guard against stats typos not applied -- https://github.com/kvm-x86/linux/tree/next