qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin O'Connor <kevin@koconnor.net>
To: "Xu, Anthony" <anthony.xu@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] target/i386: enable A20 automatically in system management mode
Date: Fri, 12 May 2017 20:01:41 -0400	[thread overview]
Message-ID: <20170513000141.GA542@morn.lan> (raw)
In-Reply-To: <4712D8F4B26E034E80552F30A67BE0B1AB6CBF@ORSMSX112.amr.corp.intel.com>

On Fri, May 12, 2017 at 11:19:00PM +0000, Xu, Anthony wrote:
> > SeaBIOS defaults to enabling A20 and it's a rare beast that disables
> > it.  One could change x86.h:set_a20 and romlayout.S:transition32 to
> > only issue the outb() if the inb() indicates a change is needed.  That
> > would likely eliminate half the accesses.
> 
> The 350 port 92 access is for write operation only.
> If include the inb(), it would be 700, and every time it actually has a change
> To be precise, It is about 175 switches from 32 bit to 16 bit, then back to 32 bit.
> call16 is called 175 times during Seabios boot without any option rom,
> It would be more if some option roms are included.
> 
> 
> I think A20 is disabled by default in SeaBios.

I don't know why you think that.  One can check with:

--- a/src/stacks.c
+++ b/src/stacks.c
@@ -99,6 +99,8 @@ call32_post(void)
         if (cr0_caching)
             cr0_mask(CR0_CD|CR0_NW, cr0_caching);
     }
+    if (!get_a20())
+        dprintf(1, "a20=0\n");
 
     // Restore cmos index register
     outb(GET_LOW(Call16Data.cmosindex), PORT_CMOS_INDEX);

With the above I only see a handful of cases where SeaBIOS has to
restore a20 to a disabled state.

The handful I do see are due to cases where yield() is called prior to
option rom initialization.  Those handful are eliminated for me with
the following fix:

--- a/src/stacks.c
+++ b/src/stacks.c
@@ -496,6 +496,7 @@ void
 thread_setup(void)
 {
     CanInterrupt = 1;
+    call16_override(1);
     if (! CONFIG_THREADS)
         return;
     ThreadControl = romfile_loadint("etc/threads", 1);

What OS / bootloader are you running?

-Kevin

  reply	other threads:[~2017-05-13  0:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 11:35 [Qemu-devel] [PATCH] target/i386: enable A20 automatically in system management mode Paolo Bonzini
2017-05-11 11:41 ` no-reply
2017-05-11 11:58 ` no-reply
2017-05-11 14:53 ` Kevin O'Connor
2017-05-11 15:32   ` Paolo Bonzini
2017-05-11 16:34     ` Kevin O'Connor
2017-05-11 23:55       ` Xu, Anthony
2017-05-12 12:16         ` Paolo Bonzini
2017-05-12 18:55           ` Xu, Anthony
2017-05-12 19:16             ` Paolo Bonzini
2017-05-12 19:38               ` Kevin O'Connor
2017-05-12 23:19                 ` Xu, Anthony
2017-05-13  0:01                   ` Kevin O'Connor [this message]
2017-05-13  1:24                     ` Xu, Anthony
2017-05-16 16:24                       ` Kevin O'Connor
2017-05-16 20:00                         ` Xu, Anthony
2017-05-16 21:42                           ` Kevin O'Connor
2017-05-16 22:39                             ` Xu, Anthony
2017-05-17  8:18                             ` Paolo Bonzini

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=20170513000141.GA542@morn.lan \
    --to=kevin@koconnor.net \
    --cc=anthony.xu@intel.com \
    --cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).