Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 4E2D22690EC for ; Wed, 25 Feb 2026 01:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771982466; cv=none; b=CfcmrREZI/NayfFJS5bkxRu4UoofxzgtEXf7n/JyXYnkM24tLCPa12EiBoU9QYN1+Zij/JwTdYSqBNn6z+jhyL1uDo6uZ9rYB4RR70g155PZ+PdAECugSqbtJhsDlqecxDmyKKmsXSPDxpyxW0VhIZiLv97sn+mQQf/0Qj8tSQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771982466; c=relaxed/simple; bh=7lRp2eCkoo+DRHWUNEDaUBTQXTHdWU47sEkYGqsesug=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=GQGK0QiGSO5uHc0mxfYDrkjcSjkY8TzCNG1fsSOoAFKM+So9o0QhJOD1r7XF1Q+QxNirqqURYyMy9uNBn1f3BquOdwUA2ASRcvaEw5zvYpDfmMnt7jskAxE9ChvA2U3gvtj+QZEqtd4/j+UCndPyFKpGQymVRaZHu/AFi+QmuPY= 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=t7HwgQyb; arc=none smtp.client-ip=209.85.216.73 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="t7HwgQyb" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-358f8b01604so2567639a91.3 for ; Tue, 24 Feb 2026 17:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771982464; x=1772587264; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=gV7BZ60qmf3JAsxc6wDH0RQvnfJYSY1NcM7wseiHg1Y=; b=t7HwgQybqbbZUi30gFfENo1IvEUYBHKRNSWdodWfVKUDcAjRnPpqUKGyWoVAF53xDV i/tlYY+Z3bbE5sJQCfA2tOHRJJQ3ORd3NIUFhXHqrDVR/31dYplwHkzAWAPxnPe4qpnr g3sIEo+e5ICEsCxAeLZOIRXoYwM8s39Vya5zgW5THDZUZs5voTCkcr6AyVZmLTzkyDDa q01JqmMTaCNh2i2tNaLGe0rpLIlbC4/ygIwy6pMd+nDeL9miw2YMRdKKqlE+U4VRkU6W wy5PPXHD7g6HhSMSD4IFApFfQGbzhAjn3kej138uJ3WtRRIKu1MtvY4k3c+BGcS0JARQ OIdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771982464; x=1772587264; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gV7BZ60qmf3JAsxc6wDH0RQvnfJYSY1NcM7wseiHg1Y=; b=TbBohRa12pBKSGTSDABln+2DjO70DVJqSlizgq1rQ93x+Pq7XOZ0zeH69CFoDzMpih 1cYgpXRYqetusf0GYVNiZIUUD3E+rV4dEjPnmiMxIC0ifSV2f0it5B5aSqESSVW24+1h OItvAtpo9rgPSEfHJzxNsbThYtU0f5EA0ZKNN3RtJ/eFFG/18KdKQ+hjzxqlqqu4UnFE J8lQsYPA02ne4xhXWUG6uy9Re0HLLqFJDNcth/1DEHUKWoAtUnSFpWmLQNffktijm5oo 5PjBDTCNpAYZ8xAzpNTXrXIPi2cik5BbBMvz5BawqpeqpuG8i5CjZ4kAROsG+yc1w6ZD hR5A== X-Gm-Message-State: AOJu0YwDlaFAWEvr7vUE+tEZqUGDeRXA5j8Gt0kBNo1uqoN0qqrv9JuW YxKJdNoqn6AmyldfbKpRFlx8Gem9PrFjBsZUwWZC0cpfDnqUz9G6jDvl6aWvR3/HNcDiwrhKxQz 0Cig0SA== X-Received: from pjal2.prod.google.com ([2002:a17:90a:1502:b0:34a:bebf:c162]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:5285:b0:354:c629:efaf with SMTP id 98e67ed59e1d1-3590f26515dmr508907a91.35.1771982463612; Tue, 24 Feb 2026 17:21:03 -0800 (PST) Reply-To: Sean Christopherson Date: Tue, 24 Feb 2026 17:20:41 -0800 In-Reply-To: <20260225012049.920665-1-seanjc@google.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260225012049.920665-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.414.gf7e9f6c205-goog Message-ID: <20260225012049.920665-7-seanjc@google.com> Subject: [PATCH 06/14] KVM: x86: Move MMIO write tracing into vcpu_mmio_write() From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Kiryl Shutsemau Cc: kvm@vger.kernel.org, x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Yashu Zhang , Rick Edgecombe , Binbin Wu , Xiaoyao Li , Tom Lendacky , Michael Roth Content-Type: text/plain; charset="UTF-8" Move the invocation of MMIO write tracepoint into vcpu_mmio_write() and drop its largely-useless wrapper to cull pointless code and to make the code symmetrical with respect to vcpu_mmio_read(). No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/x86.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 5fde5bb010e7..7abd6f93c386 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -7769,11 +7769,14 @@ static void kvm_init_msr_lists(void) } static int vcpu_mmio_write(struct kvm_vcpu *vcpu, gpa_t addr, int len, - const void *v) + void *__v) { + const void *v = __v; int handled = 0; int n; + trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, len, addr, __v); + do { n = min(len, 8); if (!(lapic_in_kernel(vcpu) && @@ -8131,12 +8134,6 @@ static int write_emulate(struct kvm_vcpu *vcpu, gpa_t gpa, return emulator_write_phys(vcpu, gpa, val, bytes); } -static int write_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes, void *val) -{ - trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, val); - return vcpu_mmio_write(vcpu, gpa, bytes, val); -} - static const struct read_write_emulator_ops read_emultor = { .read_write_emulate = read_emulate, .read_write_mmio = vcpu_mmio_read, @@ -8144,7 +8141,7 @@ static const struct read_write_emulator_ops read_emultor = { static const struct read_write_emulator_ops write_emultor = { .read_write_emulate = write_emulate, - .read_write_mmio = write_mmio, + .read_write_mmio = vcpu_mmio_write, .write = true, }; -- 2.53.0.414.gf7e9f6c205-goog