All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	kvm@vger.kernel.org, Gleb Natapov <gleb@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>, Avi Kivity <avi@redhat.com>
Subject: Re: [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests
Date: Thu, 09 Feb 2012 18:20:38 +0100	[thread overview]
Message-ID: <4F340066.9070108@redhat.com> (raw)
In-Reply-To: <4F33F50C.2050104@web.de>

On 02/09/2012 05:32 PM, Jan Kiszka wrote:
> >  I mean just check kpcr.self.
>
> Yes, clear, but that means that Windows must have initialized FS.base to
> point to the KPCR also in UP mode. Is that really the case? E.g. when
> ACPI is off?! I wonder if that explains the reported bug of qemu-kvm
> with -no-acpi and in-kernel irqchip...

Yes, it does.  It's used by some fast-path kernel APIs, and indeed the 
canonical way to find the KPCR base from ring 0 is to look at FS:[1Ch].

Similarly in userspace you can find the thread information block at 
FS:[sizeof(void*)*6], and FS:[1Ch] is something else.  But your code 
cannot be reached from userspace, so that's always fine.

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	kvm@vger.kernel.org, Gleb Natapov <gleb@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests
Date: Thu, 09 Feb 2012 18:20:38 +0100	[thread overview]
Message-ID: <4F340066.9070108@redhat.com> (raw)
In-Reply-To: <4F33F50C.2050104@web.de>

On 02/09/2012 05:32 PM, Jan Kiszka wrote:
> >  I mean just check kpcr.self.
>
> Yes, clear, but that means that Windows must have initialized FS.base to
> point to the KPCR also in UP mode. Is that really the case? E.g. when
> ACPI is off?! I wonder if that explains the reported bug of qemu-kvm
> with -no-acpi and in-kernel irqchip...

Yes, it does.  It's used by some fast-path kernel APIs, and indeed the 
canonical way to find the KPCR base from ring 0 is to look at FS:[1Ch].

Similarly in userspace you can find the thread information block at 
FS:[sizeof(void*)*6], and FS:[1Ch] is something else.  But your code 
cannot be reached from userspace, so that's always fine.

Paolo

  parent reply	other threads:[~2012-02-09 17:20 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05 12:39 [PATCH 0/6] uq/master: TPR access optimization for Windows guests Jan Kiszka
2012-02-05 12:39 ` [Qemu-devel] " Jan Kiszka
2012-02-05 12:39 ` [PATCH 1/6] target-i386: Add infrastructure for reporting TPR MMIO accesses Jan Kiszka
2012-02-05 12:39   ` [Qemu-devel] " Jan Kiszka
2012-02-05 12:39 ` [PATCH 2/6] kvmvapic: Add option ROM Jan Kiszka
2012-02-05 12:39   ` [Qemu-devel] " Jan Kiszka
2012-02-05 12:39 ` [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests Jan Kiszka
2012-02-05 12:39   ` [Qemu-devel] " Jan Kiszka
2012-02-09  8:35   ` [Qemu-devel] subpages with memory region aliases (was: [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests) Jan Kiszka
2012-02-09  9:32     ` [Qemu-devel] subpages with memory region aliases Avi Kivity
2012-02-09 14:23       ` Jan Kiszka
2012-02-09 15:05         ` Avi Kivity
2012-02-09 15:18   ` [PATCH 3/6] kvmvapic: Introduce TPR access optimization for Windows guests Avi Kivity
2012-02-09 15:18     ` [Qemu-devel] " Avi Kivity
2012-02-09 15:39     ` Jan Kiszka
2012-02-09 15:39       ` [Qemu-devel] " Jan Kiszka
2012-02-09 16:00       ` Avi Kivity
2012-02-09 16:00         ` [Qemu-devel] " Avi Kivity
2012-02-09 16:32         ` Jan Kiszka
2012-02-09 16:32           ` [Qemu-devel] " Jan Kiszka
2012-02-09 16:47           ` Avi Kivity
2012-02-09 16:47             ` [Qemu-devel] " Avi Kivity
2012-02-09 17:24             ` Jan Kiszka
2012-02-09 17:24               ` [Qemu-devel] " Jan Kiszka
2012-02-09 17:20           ` Paolo Bonzini [this message]
2012-02-09 17:20             ` Paolo Bonzini
2012-02-09 18:01             ` Jan Kiszka
2012-02-09 18:01               ` [Qemu-devel] " Jan Kiszka
2012-02-05 12:39 ` [PATCH 4/6] kvmvapic: Simplify mp/up_set_tpr Jan Kiszka
2012-02-05 12:39   ` [Qemu-devel] " Jan Kiszka
2012-02-05 12:39 ` [PATCH 5/6] optionsrom: Reserve space for checksum Jan Kiszka
2012-02-05 12:39   ` [Qemu-devel] " Jan Kiszka
2012-02-05 12:39 ` [PATCH 6/6] kvmvapic: Use optionrom helpers Jan Kiszka
2012-02-05 12:39   ` [Qemu-devel] " Jan Kiszka

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=4F340066.9070108@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.