From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@bugzilla.kernel.org Subject: [Bug 197381] New: reading segmented memory in kvm Date: Wed, 25 Oct 2017 07:57:45 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT To: kvm@kernel.org Return-path: Received: from mail.wl.linuxfoundation.org ([198.145.29.98]:38016 "EHLO mail.wl.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932101AbdJYH5r (ORCPT ); Wed, 25 Oct 2017 03:57:47 -0400 Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CF0D28B10 for ; Wed, 25 Oct 2017 07:57:46 +0000 (UTC) Sender: kvm-owner@vger.kernel.org List-ID: https://bugzilla.kernel.org/show_bug.cgi?id=197381 Bug ID: 197381 Summary: reading segmented memory in kvm Product: Virtualization Version: unspecified Kernel Version: 4.9.0 Hardware: i386 OS: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: kvm Assignee: virtualization_kvm@kernel-bugs.osdl.org Reporter: dekel35@walla.com Regression: No I am trying to get the "current" pointer of a running thread. The "current" resides in a per_cpu segment and translates to gs:current_task. I have added the following code to emulate.c at em_syscall() calling segmented_read(): { int rc; struct segmented_address addr; u64 *ptr; addr.ea = 0xd380; addr.seg = VCPU_SREG_GS; rc = segmented_read(ctxt, addr, &ptr, sizeof(ptr)); printk("%s::%s - cr3 %p rc=%d ptr:%p\n", __BASE_FILE__, __func__, (void *)vcpu->nitro.event.sregs.cr3, rc, ptr); } in the log I see: [49478.575263] arch/x86/kvm/emulate.c::em_syscall - cr3 000000007aaa2000 rc=2 ptr:0000000000000004 which implies that the segmented read failed. is there something else that needs to be done? alternatively, is there a way to get the "current" pointer? -- You are receiving this mail because: You are watching the assignee of the bug.