From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.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 3A33C299AA3 for ; Thu, 8 Jan 2026 17:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767892016; cv=none; b=Z7xXk09ZQ22nQIPjTnf4bUS7zce9JK6LsKaZkRVQ/WJB5Qwa+gSAA0g+wPTyHGIVvniJeuc66UodscWd/alF9NHWLMMCdyHgfTj/vaa62yykllcf0PIsMOEK6kYdDmJEcH1u/BhEjY8CPBy6WkZrrlbG7lQUFjVHPJpvztnODdA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767892016; c=relaxed/simple; bh=muPI2Cu8xaoBPojdhtEq4FRkVwa4sSdm2P6NIFiW0v8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XiRP1H3joC327+JSJrVo4nhcRLA/cV9KVNZNw9ud41YBRMUTBSs8y+TMtuBcDfGCqXABhdVReqI918ftmeZqHFEc1YbjcJgKdk3A9gZrtUcWtsNbNDjH/nJt6NL8G08RooyisITBohk2+YToEQ5d4/FhnkKE+7wIeNRtojVck0Y= 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=qQsQvaeW; arc=none smtp.client-ip=209.85.215.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qQsQvaeW" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c52ebdd2d43so726917a12.0 for ; Thu, 08 Jan 2026 09:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1767892014; x=1768496814; 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=QVefpuP8UR/7XkjLDjyyzWv1Aal+G6i/DuibP933gXc=; b=qQsQvaeWIxRi51/8rPUejYCrwYJsv67H9KdtSk8kBnmRahLnMSYloKHB1MT4s4ICzP UkuRwinoZs62Z4R9sHR/tpX/lWW89XXafme+uqBvN4Vy5JeZqa/Y16r0cvXLBf7izPzZ 3N3lpUmeGR6tz8XSwrKJ9frN+x1n0m0/K/GollOsKizUqb3KH8QzpwX6Jsdlxw5QVf57 vaIpelGFlfOdtjdOw25ZvxhXxpbdAXKrcr3hEKFwpiTzAT7MV3K6PCaI+OtY/lGTFdal aUt181hnBwx0yFyuhFPb9esBnb3AMUAbkY8WDkNcgldV5e9hmNJnVdJ7UnAQenAl7hGS 0dOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767892014; x=1768496814; 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=QVefpuP8UR/7XkjLDjyyzWv1Aal+G6i/DuibP933gXc=; b=WxS92rTPHjeoXzqCyiaJXPuQF9qQqZTDVYLLjnCJWhWrRWCDJluJuF3RCFDeequ4RS Fy6J9v7Xgx5yHqnXkN8qi1Bkg3B7Mj//UzJmU/ypOPAk6l0h05DlIKUVVgje1xTSU+8V HMOKsO+HSYwXKOBeG6iN/u2KZH/1ghTcxbhABuC/WZPxRFh9lPBGMA+IRvnqUCnruSvW PLCfqbEtRM4ZouDGVFamKelAg9gwHgwFxCa1EqOUXeSYleJ/XH5dY4jMQoIT6mnKLYMs 4Bog47LmqmuL0mzp82LnEKS8e17sTqpcwoB/UeReimLmwEMYHV8lO44c0CcAMa11sICT oBkA== X-Forwarded-Encrypted: i=1; AJvYcCXsT7quMNS/h8brCPIO8JzoMI/OODNfpBQJ1IJZbGOEYhKDOzNQwgcnbEyxixIAp+59Z002YeZAZeRRTi0=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2ZnDOZvAeeFw279g6X0Fw7JHotnBoAxWhFGgzENxUWxC7Li3b j6qggk2Ldo1tmAnWCR6Re3Z53QFoz4nRu8utw9pN4PkiwgYyiuOURiyXzw2qzUr4q+ElfdmwGml D0QHp8g== X-Google-Smtp-Source: AGHT+IFQl0ff8pn8KbqQ/lIIr11/3kfrRynmb0Zf119br04GQv3Ng0sDtXyGq7Ap5LK8lMqpSMFAhy6uy/E= X-Received: from plhz2.prod.google.com ([2002:a17:902:d9c2:b0:258:dc43:b015]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:3d86:b0:334:8a8e:6576 with SMTP id adf61e73a8af0-3898f91d311mr6362674637.29.1767892014507; Thu, 08 Jan 2026 09:06:54 -0800 (PST) Date: Thu, 8 Jan 2026 09:06:52 -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: <20260107204546.570403-1-seanjc@google.com> Message-ID: Subject: Re: [PATCH] KVM: SVM: Fix an off-by-one typo in the comment for enabling AVIC by default From: Sean Christopherson To: Naveen N Rao Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, Jan 08, 2026, Naveen N Rao wrote: > On Wed, Jan 07, 2026 at 12:45:46PM -0800, Sean Christopherson wrote: > > Fix a goof in the comment that documents KVM's logic for enabling AVIC by > > default to reference Zen5+ as family 0x1A (Zen5), not family 0x19 (Zen4). > > The code is correct (checks for _greater_ than 0x19), only the comment is > > flawed. > > I had thought that the comment was correct and that you wanted to > reference Zen4 there. That is: > family 0x19 (Zen4) and later (Zen5+), > > Though family 0x19 also includes Zen3 :/ > > I think it would be better to update the code as well, just so it is > easier to correlate the comment and the code? > > if (avic == AVIC_AUTO_MODE) > avic = boot_cpu_has(X86_FEATURE_X2AVIC) && > - (boot_cpu_data.x86 > 0x19 || cpu_feature_enabled(X86_FEATURE_ZEN4)); > + (cpu_feature_enabled(X86_FEATURE_ZEN4) || boot_cpu_data.x86 >= 0x1A); This thought crossed my mind as well. I'll send a v2 with this, I especially like the idea of swapping the ordering so that the checks are "ascending".