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 AE6C32B2DA for ; Fri, 13 Jun 2025 00:18:24 +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=1749773907; cv=none; b=dvuAPwchBf2+BPCyXZPFJvNW4k+yQJ1oeTeI0bRKKmzPMMTTSZdX58gyKu+dgKmIoGyUmgZxhvesXGY7otEyLAa4eYKmcTsMkRjuMQjbNf6ONJMm3pqBrinqsAE4389VgDFA0X/FqsfL/asLUmuN8CRV9v/k1TmEuL8wRiMQRuQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749773907; c=relaxed/simple; bh=5i/Kz9zGPQ4r2PwKaFldoSkJCG5Brxf1/boOz8euMfE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=a1bPIToksg2OnmrjEJ2Y9eTWqZRGCodbz8cRYD62Qx4eQKyd1eTBClQB2R72/ontg/MBUSTfPDGeYU/YOvIBv8N0Q8mVYdkCTgfL899B5OH+fd23KAwsu1cOwzRblw0m5J5y5mXWg1tpeOrwtPWPWXXNwEiLXYWKKj/KNdT6/rw= 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=v0bVswyv; 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="v0bVswyv" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2358ddcb1e3so19974755ad.3 for ; Thu, 12 Jun 2025 17:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1749773904; x=1750378704; 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=H43IbeUL3QFdvA9+BVZkV6ea988HyH6lrK+/f8SpcHA=; b=v0bVswyv2MwfI6R407WGrzE/AeLvfGDRbjiW8fslXmdOoexLf9lMuJ+HH4GSdVuckF 3DbtCOi1S02wFPJ0DmTyp/j9ch2bKyHuvXNRm0gMRb33am55qwXQ1ilGAhEHl30gnkUg sX11YyrGsLY1n+SU59vwItsg7BS7C4vrABjkBUvaHfNHI2slynFjSDJpq3fE/0V2YhKv bqgnt6nVwYxE+yUfa44qNKJ2Wof+Lic9pVLZqgmhfIU0rKMA2Gl0LlHZH06Ik5RsFY4F 5WdmxaTce9pGLTH7IXsihmkNrDpWsXoe2SbiYNYbhoF4N+Xbl45yQGPUP3RodtlWXr5h oXkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749773904; x=1750378704; 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=H43IbeUL3QFdvA9+BVZkV6ea988HyH6lrK+/f8SpcHA=; b=NK678MRjYjfjIoM++o5Rl1AHN8R5FkWh7QBwHzaJexehSDvUWFPxCiS+CGwLMEe2KP JU9R9lbKrGd+a/gGYU+dtEI9RQLz5dr8DLn6XN5E9mvEKyUlTeE6icjVyYmxxuZEGNY5 MUHcvvHgj4O2iaReWrfNIokXs76OSJVA63Njd8Hsi3vaUPlkR+V5fdxlkbYgnkZoRHn1 zqR7UI9gP/MTZ9IKTXfKsdkRAbc1BBVgFsZKiWM3ruR1NEh+/vvL5QPq78PSvBxYbVrj womw3staZgMrkIfWddscibCm6NvfnXNYFUSwL/3A7kkm5QkyounpDe6plrW7X7S0VWlO G8vQ== X-Forwarded-Encrypted: i=1; AJvYcCXEZvESuyanE0DLpBlS/J3vt/0lNNVaXnSDl9VncarP/3MY3PSj9Gpgif3UKiNUUyDYc6ICzmRsm9rR@vger.kernel.org X-Gm-Message-State: AOJu0YweRfxq9krXTVAZEjbRfwpw8nYxFO1ithezjl6VTAir2m3CYE4O tcDZq8CcaQuN6ckf/SND7Yu5XiOKVGmMb8VWK8Dz/UelmkWp/hqSa5ZtnTU0gBvX0bFRRGqVi1F lT8IB5g== X-Google-Smtp-Source: AGHT+IFztzIN+LhXHtkHmf4/zD8JypbwgxvzBHTruUdV5ogDCnmgwrGuDq/b/wwTYKI3W48kBDJVSoH+wA0= X-Received: from pgbfy15.prod.google.com ([2002:a05:6a02:2a8f:b0:b2e:c15e:3eb7]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2352:b0:234:ef42:5d5b with SMTP id d9443c01a7336-2365d8a170amr13173945ad.16.1749773903965; Thu, 12 Jun 2025 17:18:23 -0700 (PDT) Date: Thu, 12 Jun 2025 17:18:22 -0700 In-Reply-To: <20250612214849.3950094-3-sohil.mehta@intel.com> Precedence: bulk X-Mailing-List: linux-edac@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250612214849.3950094-1-sohil.mehta@intel.com> <20250612214849.3950094-3-sohil.mehta@intel.com> Message-ID: Subject: Re: [PATCH v7 02/10] x86/fred: Pass event data to the NMI entry point from KVM From: Sean Christopherson To: Sohil Mehta Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Xin Li , "H . Peter Anvin" , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , Adrian Hunter , Kan Liang , Tony Luck , Zhang Rui , Steven Rostedt , Andrew Cooper , "Kirill A . Shutemov" , Jacob Pan , Andi Kleen , Kai Huang , Sandipan Das , linux-perf-users@vger.kernel.org, linux-edac@vger.kernel.org, kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-trace-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, Jun 12, 2025, Sohil Mehta wrote: > Extend the FRED NMI entry point from KVM to take an extra argument to > allow KVM to invoke the FRED event dispatch framework with event data. > > This API is used to pass the NMI-source bitmap for NMI-induced VM exits. > Read the VMCS exit qualification field to get the NMI-source information > and store it as event data precisely in the format expected by the FRED > event framework. > > Read the VMCS exit qualification unconditionally since almost all > upcoming CPUs are expected to enable FRED and NMI-source together. In > the rare case that NMI-source isn't enabled, the extra VMREAD would be > harmless since the exit qualification is expected to be zero. Nit, instead of "is expected to be zero", something like this harmless since the exit qualification is architecturally guaranteed to be zero on CPUs that don't support NMI-source reporting. Per the SDM's "Exit qualification" subsection of "Basic VM-Exit Information": For all other VM exits, this field is cleared. -- to make it very explicit that reading the exit qualification on older CPUs is 100% safe, e.g. even on non-FRED CPUs (see https://lore.kernel.org/all/aBUiwLV4ZY2HdRbz@google.com). > Suggested-by: Sean Christopherson > Originally-by: Zeng Guang > Signed-off-by: Sohil Mehta > --- Acked-by: Sean Christopherson