All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: Mats Petersson <Mats.Petersson@amd.com>
Cc: xen-devel@lists.xensource.com
Subject: RE: [PATCH] support protected mode mmio with non-zero CS base
Date: Wed, 22 Nov 2006 08:36:20 +0100	[thread overview]
Message-ID: <45640C04.76E4.0078.0@novell.com> (raw)
In-Reply-To: <907625E08839C4409CE5768403633E0B018E1746@sefsexmb1.amd.com>

>>      realmode = hvm_realmode(v);
>>      if ( realmode )
>> -        inst_addr = (regs->cs << 4) + regs->eip;
>> +        inst_addr = regs->cs << 4;
>>      else
>> -        inst_addr = regs->eip;
>> +        inst_addr = hvm_get_segment_base(current, seg_cs);
>
>Remove the "if ( realmode ) " and just use the segment base address. The
>base-address in the register should be correct even in realmod, or the
>processor is broken. [I don't think this code is being executed from
>vmxassist - if it is, then that's a different special case!]. 

I intentionally didn't, as at least on VMX the read operation could
be significantly slower than a shift (and due to the indirect call it will
be slower even on SVM).

>Theoretically, you should also check that (eip <= segment.limit), and
>issue GP-fault if not true. 

Again intentionally no: If the original instruction managed to generate
a page fault, than it must have been entirely within limits - otherwise
hardware would have generated a GP fault.

Jan

  reply	other threads:[~2006-11-22  7:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-21 16:55 [PATCH] support protected mode mmio with non-zero CS base Jan Beulich
2006-11-21 17:03 ` Petersson, Mats
2006-11-22  7:36   ` Jan Beulich [this message]
2006-11-22  7:51     ` Keir Fraser
2006-11-22 11:15     ` Petersson, Mats
2006-11-22 11:24       ` Jan Beulich
2006-11-22 11:44         ` Keir Fraser
2006-11-22 12:46           ` Jan Beulich

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=45640C04.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=Mats.Petersson@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /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.