From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.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 6505B1F7085 for ; Tue, 21 Jan 2025 20:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737493017; cv=none; b=ZREwfwx2rtEEYVOoCbnsZHqtlG+pb4N+sn4DL6RJjD1fKAFD19nV7fEwbSgFpAyp5dWqefOTpmvCKMoaV61616cMSbbiZaP1VUxYq2JNN96pl4iCU3zQkoOOMyuaWKxsdz5mnfImrtKQUd+c4dtvONX0adIrDUAUwVjyu4AGYFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737493017; c=relaxed/simple; bh=oUeI4xqiwKehrm14csxiidLnNyGQ54ADBOT0ioMFNH0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tq7/84+5tRZ0BXLwD4a5xym9CDeYAWrxO5O+2JhNZ9Aowgc7bPGmbdHGan2Qm/eI2YQs7wv+ZgrVNLue1RDSaHmT44q6hhDiKaQCpYnImucfcMEydzAqsukljB2MKm9W5ZflcFVnSTWUB4kRS9SIVaGJAfdIIGauy4y3AtDHAYU= 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=kHPndlNE; arc=none smtp.client-ip=209.85.214.201 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="kHPndlNE" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-21655569152so114578065ad.2 for ; Tue, 21 Jan 2025 12:56:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737493015; x=1738097815; 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=FPmPdXxg4qDDFjuISJwDdAIVLc44OyHMr66SXY5pv74=; b=kHPndlNEfWXUCZ0isYHUdZwFTgmeO2TUXOEgt361wZVAwhd5PNyig8m04rzDj9OJgy 3vmk6tLCYoLfAtKC7cbgBWjb/pP3Boecb6NqIvJoREGT1c/eGzeuHh4vXLey0ACWdMoa od2wmbim3Bw+8ziZMH/d1rJlrg4jZljwkz63qBPqyIFodbiIGYho3wkLhP/6BlC1DlQj zuGzdsBYGL8pSyD4BCh1tkkWQqODtsVFt7qie7rOjrUE1npcvtSg+SHBEFQNBUMYnhCl Xg1NwxFJHB4bCKTl4NVgy53pajIIQIJrmslDISKB3XXDCmVrczGfOahIEtS5w+6qyzo+ xf5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737493015; x=1738097815; 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=FPmPdXxg4qDDFjuISJwDdAIVLc44OyHMr66SXY5pv74=; b=HE0SlQENHy0R8pkqSiKp0sP8h+VcZ7ONiZBVCHJmbSVPd9C7P9MJ/MXC/TGQ1SeCOw KaGMqV9PhbGzjVp0nd+65dIqk21DzTFHio8CFOCcumLuEMIoNq3gtLqMkna+oJbcclJX l4EVduwnIO5w1Hn3P1lRS8KuMgN/Qi2qenQU1eQHuvCaFOLaVeZazNGqLx1N/qHwOP1r QV077eNfhyc1cIigaGATm6Qx8tBeqIWENkfH3KkSDY7kbYpcUDi3RxaibfDqpYkT9Bi6 rkv7yd6OG7tUEkzoL/ZvgW3atI27dhHVH18lUAlRB5Be5Z87+rnFgYvKkhT0iQTjllog m0CA== X-Forwarded-Encrypted: i=1; AJvYcCWozg8mLGgqkeQ+5YeOiC8t8+tMGPsIvEO27Ane9jApC/ie4bBvX1nIVRxwcv133wzAw8sjnzdWbuMNc+U=@vger.kernel.org X-Gm-Message-State: AOJu0YzQSMf0yR87ZSybCPycKPgpVvD8JTEv6rBaHEpLNnFcx4YTxEUP Ok4pZuWX0juA+llnARcR5BNarClzadUQWmrLkTRHa+ltx4euuHGkRN0lSPL9NfHDrPGvUZievyS VaQ== X-Google-Smtp-Source: AGHT+IFdrRQcFubciantcwlkp+b6rBGHmd4snduv+064ENHS/VQS3HzU5edUM2r89L0j7KTtpRdHOth+VXE= X-Received: from pfwo10.prod.google.com ([2002:a05:6a00:1bca:b0:72d:b2a2:bed7]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:258e:b0:1e0:d632:b9e0 with SMTP id adf61e73a8af0-1eb21481d85mr30143462637.13.1737493015514; Tue, 21 Jan 2025 12:56:55 -0800 (PST) Date: Tue, 21 Jan 2025 12:56:54 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH v2 3/6] KVM: x86: selftests: Set up AMD VM in pmu_counters_test From: Sean Christopherson To: Colton Lewis Cc: kvm@vger.kernel.org, mizhang@google.com, ljr.kernel@gmail.com, jmattson@google.com, aaronlewis@google.com, pbonzini@redhat.com, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Mon, Jan 20, 2025, Colton Lewis wrote: > > > +static void test_core_counters(void) > > > +{ > > > + uint8_t nr_counters = nr_core_counters(); > > > + bool core_ext = kvm_cpu_has(X86_FEATURE_PERF_CTR_EXT_CORE); > > > + bool perfmon_v2 = kvm_cpu_has(X86_FEATURE_PERFMON_V2); > > > + struct kvm_vcpu *vcpu; > > > + struct kvm_vm *vm; > > > + > > > + for (uint8_t ce = 0; ce <= core_ext; ce++) { > > > Kernel style is to not declared variables inside for-loops. > > I ran it through checkpatch and it didn't complain. ... > > > + vcpu_set_cpuid_property( > > > Google3! (Never, ever wrap immediately after the opening paranethesis). > > Checkpatch didn't complain. Checkpatch is a perl script, not sentient AI. It's nothing more than a tool to help detect common goofs, typos, egregious flaws, etc. The absense of checkpatch warnings/errors does not mean a patch has no issues. Coding style in particular is quite subjective and prone to "exceptions to the rule", which makes is especially hard to "enforce" via checkpatch. As explained in Documentation/process/4.Coding.rst, what matters most is consistency: A code base as large as the kernel requires some uniformity of code to make it possible for developers to quickly understand any part of it. So there is no longer room for strangely-formatted code. https://www.kernel.org/doc/html/v5.0/process/4.Coding.html#coding-style