public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: kvm@kernel.org
Subject: [Bug 197381] New: reading segmented memory in kvm
Date: Wed, 25 Oct 2017 07:57:45 +0000	[thread overview]
Message-ID: <bug-197381-28872@https.bugzilla.kernel.org/> (raw)

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.

                 reply	other threads:[~2017-10-25  7:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-197381-28872@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=kvm@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox