From nobody Mon Feb 9 11:31:55 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1690820940; cv=none; d=zohomail.com; s=zohoarc; b=A6gtLmlq+W4sDId+gpeerVlorRQZ4osUBmEEZMtul7+zwVUiQdghXj+8fOPLZBfRl6TZN2uIF/ycRN9vzgNcrnA0i3lRwL0M+DROO4GpJAtT7p3qUdvDcxK5+G+jwDKm/ZC98NUiufGJX1J0zew91kePq6jECzhQLJNzUqUarNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690820940; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4QaSj7uP/XiD7aX6DwrTtyHkShQKv8AgB0V9Y7FQ264=; b=W39nEE0lfXDt9hWiKQd9fri9FizHCfozD3VUDjvz7/TMerybkd2hKYc1Kg2KZ3Gm9dK+T9DMprNrhOFKte9igWNWgo5Zp3efpFnNWDn9pje7pu0p6iKmzddjCIG574IF91BAtMWHRp5ngCyKrZtRaA3baW0oS/dg5Ws305JcumY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690820940691911.9097886656577; Mon, 31 Jul 2023 09:29:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQVku-0003fu-OO; Mon, 31 Jul 2023 12:28:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQVki-0003e6-N9 for qemu-devel@nongnu.org; Mon, 31 Jul 2023 12:28:12 -0400 Received: from mgamail.intel.com ([134.134.136.126]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQVkg-0008I7-KS for qemu-devel@nongnu.org; Mon, 31 Jul 2023 12:28:12 -0400 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 09:24:56 -0700 Received: from lxy-clx-4s.sh.intel.com ([10.239.48.46]) by orsmga008.jf.intel.com with ESMTP; 31 Jul 2023 09:24:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690820890; x=1722356890; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rGg2cVGBDP7vKJG5NcZCnC1i778S3kaV/6nLpZcWGp8=; b=G0Ffnae72CgAe2ttXiQCebE5pWKYpNb9c8ilgj6gsH0aPisZ47ItKOvU i6MPGShOfV5EzYuNkWkQh7BhIPDlpp+j/Cu+5+XdO3srNWnaLhyQLFOCB jIpw9P3u5vFxw8MMJ5cjX6sRoXgh+sSuFMF6ilij5ZsfL0oRku4T19dYE lI67IA7eKJbZUwozHUuXIR3LrJfJkXeveEWmsH+MNfDnmVQm3vEaz16gp TZXABfxsr9BWR+ZTr7Vtf0mPHw9BpkqRJSoad8oHuID45GX5EYx7vgt6c whTUS3A4gwNjANOYDONmC5LhH9MKw9x8r0WvzSxu5wHQfHb+r/zMSxmnk w==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="353993307" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="353993307" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="757983895" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="757983895" From: Xiaoyao Li To: Paolo Bonzini , Sean Christopherson , David Hildenbrand , Igor Mammedov , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Marcelo Tosatti Cc: Markus Armbruster , Eric Blake , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Chao Peng , Michael Roth , isaku.yamahata@gmail.com, xiaoyao.li@intel.com, qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [RFC PATCH 01/19] trace/kvm: Split address space and slot id in trace_kvm_set_user_memory() Date: Mon, 31 Jul 2023 12:21:43 -0400 Message-Id: <20230731162201.271114-2-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731162201.271114-1-xiaoyao.li@intel.com> References: <20230731162201.271114-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.126; envelope-from=xiaoyao.li@intel.com; helo=mgamail.intel.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1690820941923100001 Content-Type: text/plain; charset="utf-8" The upper 16 bits of kvm_userspace_memory_region::slot are address space id. Parse it separately in trace_kvm_set_user_memory(). Signed-off-by: Xiaoyao Li --- accel/kvm/kvm-all.c | 5 +++-- accel/kvm/trace-events | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 373d876c0580..d8eee405de24 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -309,8 +309,9 @@ static int kvm_set_user_memory_region(KVMMemoryListener= *kml, KVMSlot *slot, boo ret =3D kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, &mem); slot->old_flags =3D mem.flags; err: - trace_kvm_set_user_memory(mem.slot, mem.flags, mem.guest_phys_addr, - mem.memory_size, mem.userspace_addr, ret); + trace_kvm_set_user_memory(mem.slot >> 16, (uint16_t)mem.slot, mem.flag= s, + mem.guest_phys_addr, mem.memory_size, + mem.userspace_addr, ret); if (ret < 0) { error_report("%s: KVM_SET_USER_MEMORY_REGION failed, slot=3D%d," " start=3D0x%" PRIx64 ", size=3D0x%" PRIx64 ": %s", diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events index 399aaeb0ec75..14ebfa1b991c 100644 --- a/accel/kvm/trace-events +++ b/accel/kvm/trace-events @@ -15,7 +15,7 @@ kvm_irqchip_update_msi_route(int virq) "Updating MSI rout= e virq=3D%d" kvm_irqchip_release_virq(int virq) "virq %d" kvm_set_ioeventfd_mmio(int fd, uint64_t addr, uint32_t val, bool assign, u= int32_t size, bool datamatch) "fd: %d @0x%" PRIx64 " val=3D0x%x assign: %d = size: %d match: %d" kvm_set_ioeventfd_pio(int fd, uint16_t addr, uint32_t val, bool assign, ui= nt32_t size, bool datamatch) "fd: %d @0x%x val=3D0x%x assign: %d size: %d m= atch: %d" -kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t guest_phys_add= r, uint64_t memory_size, uint64_t userspace_addr, int ret) "Slot#%d flags= =3D0x%x gpa=3D0x%"PRIx64 " size=3D0x%"PRIx64 " ua=3D0x%"PRIx64 " ret=3D%d" +kvm_set_user_memory(uint16_t as, uint16_t slot, uint32_t flags, uint64_t g= uest_phys_addr, uint64_t memory_size, uint64_t userspace_addr, int ret) "Ad= drSpace#%d Slot#%d flags=3D0x%x gpa=3D0x%"PRIx64 " size=3D0x%"PRIx64 " ua= =3D0x%"PRIx64 " ret=3D%d" kvm_clear_dirty_log(uint32_t slot, uint64_t start, uint32_t size) "slot#%"= PRId32" start 0x%"PRIx64" size 0x%"PRIx32 kvm_resample_fd_notify(int gsi) "gsi %d" kvm_dirty_ring_full(int id) "vcpu %d" --=20 2.34.1