From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.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 C0AC13C1FCA for ; Thu, 15 Jan 2026 17:29:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498184; cv=none; b=afDK8Et8lv+EiubLqaErlDn+dajNIcEVD/fcaGTyUIndNg7as+jfqgfT2VAzRzlKFTYeOyuiVrjRsLNF3lth6v6mf4Ob+2cln+C8CBbQzIsTAU0WBd9c9c7zEmsmFEsm5xH5cPJ+K7qZJIYERq05JUoWNUOHWOYK2kouZ+LjwIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498184; c=relaxed/simple; bh=MA28bjpdROGLBGyWpjAe2cE36NptQV21lD6fviztOIU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hlBvXKIDsvK/Dy46gydCWkof1X0ZfLqZ+Q5trbh5i8D8zFjZEEUgGL+128EwM1Ob3sE9WCqURuJALhx+f7epoTBTQSfiIgONDx4sEfCky46IytgJ37NkVon/4H17DIv/DUBFSwgfKqKJkyh7DH+mhd3bOk6Os/tgbanJo6YwET8= 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=FjzTd3z4; arc=none smtp.client-ip=209.85.215.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="FjzTd3z4" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c5539b9adb8so698468a12.2 for ; Thu, 15 Jan 2026 09:29:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768498182; x=1769102982; 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=0RdgWmeOIRqyt3CX1pAJn26pk8EuG6NaH6VeuOJiiKo=; b=FjzTd3z48lhDCxBAiHd2O8kc97F0shVlswe96T5nxkUZg8aGsXmCIq5dszBkMFTuPz iDkDVeTOr1ltTV5s8uxO3MTTNU8CGQrt5KROGIO3BxSRDha1AwEg9BsdYHFCgQ9J3S65 2UOsw6XcCxoPEtXU98qslhgYfmhNdFriD+/TQMqUjSCsK8TvmHG16S//1cUPiYpBChyc bLc7FsuAhzGsibu2iXAy6FgC8QUWYdwhCawtqZs6vrGzdqxAQsAbFxXIU1IB6seAE4ZR +Jy0E9PBOueLqekxgRrXhgBYHfdRIDSvnqrfu9VlVt1yTcMg2aKdLGuftNMFMXdIDxos 31sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768498182; x=1769102982; 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=0RdgWmeOIRqyt3CX1pAJn26pk8EuG6NaH6VeuOJiiKo=; b=Uu5nRoni3Mr6VsqzbW9kLmYFBWi+ESBnoX7vSyuZYSYmHXYdqvQI++qQEnAwfGX+4H TA+M9cgB/85t9RTfGyLly4p/F5ZCuPskXgdMLrkhAYjHqh0aGnQC82uWwwN6LzZVXOwg cw2BGsccm+VC92yp4SCTUm3Lu1am9HEpgTgbGMw8UCPFxBpmgfYgvkP7Jo3xjzjuLViV hHwESKH+HVCvKGdo8G3ZtBxxPPTHGalGyWJ8Ccb5+jm9V7xkjaEDi+HCRFmfshcGb8tF kZbneilCVUzzVQxvT9GnMqc71Qi5HIxjDq0+AnT6SNH+FrcJYNJzditDe3tgw8tJtkb/ d+MQ== X-Forwarded-Encrypted: i=1; AJvYcCWE1OqwezdakZLBGe5hoVAXsG/dRHdwPEZY8KcOFNMRDwyEUQ6CPrDqmHw91zIqvz0USXIH23j79+bBQfI=@vger.kernel.org X-Gm-Message-State: AOJu0YzNeMo4PffM+C1F+Bm3gFGjjgf7GNCsVoF6WRUnZ6Xunxeo76W3 eMZSpdWT6UmSLcWrUE9TaD+LNnKpqpdZBG+cEhY45PddO9R1kwavaLRqvkaFwMa7rrmsGfzaMi0 fVMyZrg== X-Received: from pfbln22.prod.google.com ([2002:a05:6a00:3cd6:b0:7a5:20e6:4185]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3d0d:b0:81f:4164:79b0 with SMTP id d2e1a72fcca58-81f9f6d5262mr297714b3a.31.1768498182045; Thu, 15 Jan 2026 09:29:42 -0800 (PST) Date: Thu, 15 Jan 2026 09:29:40 -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: <20260112174535.3132800-1-chengkev@google.com> <20260112174535.3132800-2-chengkev@google.com> Message-ID: Subject: Re: [PATCH V2 1/5] KVM: SVM: Move STGI and CLGI intercept handling From: Sean Christopherson To: Yosry Ahmed Cc: Kevin Cheng , pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, Jan 15, 2026, Yosry Ahmed wrote: > On Thu, Jan 15, 2026 at 09:00:07AM -0800, Sean Christopherson wrote: > > On Thu, Jan 15, 2026, Yosry Ahmed wrote: > > > Or maybe it's clearer if we just put the checks in a helper like > > > svm_waiting_for_gif() or svm_pending_gif_interrupt(). > > > > This was my first idea as well, though I would name it svm_has_pending_gif_event() > > to better align with kvm_vcpu_has_events(). > > svm_has_pending_gif_event() sounds good. > > > > > I suggested a single helper because I don't love that how to react to the pending > > event is duplicated. But I definitely don't object to open coding the request if > > the consensus is that it's more readable overall. > > A single helper is nice, but I can't think of a name that would read > well. My first instinct is svm_check_pending_gif_event(), but we are not > really checking the event as much as requesting for it to be checked. Ya, that's the same problem I'm having. I can't even come up with an absurdly verbose name to describe the behavior. > We can do svm_request_gif_event(), perhaps? Not sure if that's better or > worse than svm_has_pending_gif_event(). Definitely worse in my opinion. My entire motivation for a single helper would be to avoid bleeding implementation details (use of KVM_REQ_EVENT) to trigger the potential re-evaluation STGI/CLGI intercepts. And then there's the fact that in most cases, there probably isn't a pending event, i.e. not request will be made. Let's just go with svm_has_pending_gif_event().