From mboxrd@z Thu Jan 1 00:00:00 1970 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 2C19741A929 for ; Tue, 14 Jul 2026 18:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784054588; cv=none; b=OFnF/iFpsaGsRA6z5yQFIwK4qi+9K3OZMquf3bdXtMsIVZPjYCfrmmy2wQL8ATAmBxq7IgEAebOt6JEQdeHQk8nCJtuw16iBklolT1dawCQloWUVNu7U/zctw07175i6+IuopvASzOcnNF4hGGfVi26TvF1ZgD0UfNMHGIT5svY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784054588; c=relaxed/simple; bh=Y3nB/YWKgse6fE4CYr8dGPQclxUSNIMISmiDxbWmKWo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=KKWVYo5/E21Cx4f/I0CcleYXEinxoQgKwM1L1KhRY/VIIyHFWDUw16PV31fgKDReqlzh+pB01P4RxmteQ1yhDdatjPG1i2xQKB8GbUpYv0TCsbk+ylDQ0GVJ5DgsoFRGxHmoZTWDTwWPYbxQRoordPgBii7mOOrNdIbp0PZF+ns= 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=QWXf1FZ+; arc=none smtp.client-ip=209.85.210.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="QWXf1FZ+" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-8486ffba174so7688975b3a.1 for ; Tue, 14 Jul 2026 11:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784054577; x=1784659377; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=sgiWf1c5WxAndJDe6W3Ef5+DmyX9WQWvy7zVaNhvy+4=; b=QWXf1FZ+B3p2u2LNBXrfgwQ5gglqoRLbNzGa4ojNz1ywM27H2OCnq0zJgSvPOSVUVl rATQbIXi94frTuJo1uo/xEp1khcY+GHNPyuvpYx8+Pf22yvDE8Vc+Qd4KrCPpHZu8n6s Nt614CtKbJyFEsaB36ZC1o9yDrGRe8/sCV+dtit0gbfsKcjlbnfCMo5ack7XtH85du+P Jk/HZij6NVagTAvqyflOHsE8rwI928mvMVp4h+igJcc3srYNfHQ+pCM9ryzB8l3YNkNL Nzs/rxgo4mjppPI3P44SvNTM+MA3n4Rr3aQjjw2r4TJ3sP3WMOTc92qF8tkTiZcshoJ4 ZWVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784054577; x=1784659377; h=content-type: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:content-type; bh=sgiWf1c5WxAndJDe6W3Ef5+DmyX9WQWvy7zVaNhvy+4=; b=PxV/TtdhD2uRB0PYWjqaCAVsk4R2O4icV6NiGgZS6tQctqgHlMsT+H27cpTfD+0Ok0 z1TpyZWSNYstqtxxHO+Uv+Z+9t3DxNmYgV8HL7rO5rRlWS4tR61mu0XnsuHbqavoTHPe 4/XCds4Vo8X9KXZrTLmOlZN9qT5D6De+TS+jk2prBYsFaZAFsK9apc0vEJ23vORQK83L RJ3wzwRmEwCj1bo6V2Eg5jxp7FoUxWcim7XFLGGQVoRnBXzVPCyc6X+wqHUEuwmfSFJI oXF3VK57dZvOPGILFDtP1UpgI3OqmnVJKfDawRtGyzt1poKML3/SR5+2yGgUxhlQVk/p Fktw== X-Forwarded-Encrypted: i=1; AHgh+Rp8pXCmieiFL9RJQpEeiFl8qHgUpSPjDargE84xz2uxo4yL8NdSIyBGDGHVnRmumRYomowLqrq6zEAGrKo=@vger.kernel.org X-Gm-Message-State: AOJu0YxZfVR8SpOev0rT8rPqlO7zaRS+oCVsVKmI6H8bhRNzboKtRyHK 0YuhLsPpOkN5zrs8f6sAoFdEI4mqvzSyY2JUvmx/37kk9KJcHobRsMC40TsN6Yqiv1XSjX66JJC 6CatYqA== X-Received: from pfx27.prod.google.com ([2002:a05:6a00:a45b:b0:848:5415:1869]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3e01:b0:846:2f3c:3f66 with SMTP id d2e1a72fcca58-84a5585047dmr3493128b3a.60.1784054576849; Tue, 14 Jul 2026 11:42:56 -0700 (PDT) Date: Tue, 14 Jul 2026 11:41:03 -0700 In-Reply-To: <20260609075748.612704-1-binbin.wu@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260609075748.612704-1-binbin.wu@linux.intel.com> X-Mailer: git-send-email 2.55.0.141.g00534a21ce-goog Message-ID: <178405421131.3138286.344633568989606466.b4-ty@google.com> Subject: Re: [PATCH] KVM: x86: Fix emulated CPUID features being applied to wrong sub-leaf From: Sean Christopherson To: Sean Christopherson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Binbin Wu Cc: pbonzini@redhat.com, rick.p.edgecombe@intel.com, xiaoyao.li@intel.com, chao.gao@intel.com, kai.huang@intel.com Content-Type: text/plain; charset="utf-8" On Tue, 09 Jun 2026 15:57:48 +0800, Binbin Wu wrote: > Pass the CPUID index into cpuid_func_emulated() and return no emulated > features for indexed CPUID leaves with a non-zero index. > > KVM currently emulates CPUID features only for index 0, but > kvm_vcpu_after_set_cpuid() looks up emulated features by function alone. > As a result, reverse_cpuid[] entries that share a function but use a > non-zero index, e.g. CPUID.7.1:ECX, can inherit emulated features that > belong to index 0. For example, RDPID, which is CPUID.7.0:ECX[22], can > be incorrectly OR'd into CPUID.7.1:ECX. > > [...] Applied to kvm-x86 misc, thanks! [1/1] KVM: x86: Fix emulated CPUID features being applied to wrong sub-leaf https://github.com/kvm-x86/linux/commit/8835a24a5608 -- https://github.com/kvm-x86/linux/tree/next