From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: Jan Beulich <JBeulich@suse.com>,
"Egger, Christoph" <chegger@amazon.de>,
xen-devel <xen-devel@lists.xen.org>
Cc: Jun Nakajima <jun.nakajima@intel.com>
Subject: x86/AMD: Nested VM failed to boot L2 guest due to setting/clearing CR0.CD bit
Date: Mon, 5 Aug 2013 21:27:24 -0500 [thread overview]
Message-ID: <52005F0C.4070409@amd.com> (raw)
Hi All,
While I was testing nested VM on with latest Xen on AMD system, I am running into issue where
the L2 guest (Linux) seems to stuck right after loading the kernel. When using the "xl debug-keys d" to dump registers,
the L2 guest RIP always at the instruction which tries to write the CR0.CD bit. Besides, once starting L2 guest and it
got stuck, L0 Dom0 becomes very slow until I kill the L2 guest.
After looking into the hvm code for handling CR0 (i.e. xen/arch/x86/hvm/hvm.c: hvm_set_cr0()),
I see that the code tries to issue local cache flush on all the cores when the L2 guest is
setting the CR0.CD bit. (Please see the code snippet below.)
if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
{
/* Entering no fill cache mode. */
spin_lock(&v->domain->arch.hvm_domain.uc_lock);
v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
{
/* Flush physical caches. */
---> HERE on_each_cpu(local_flush_cache, NULL, 1);
hvm_set_uc_mode(v, 1);
}
spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
}
When I try to comment out the line, the issue goes away. Is this line necessary?
Why do we need to flush all the cpu cores when the CR0.CD bit only applies
to a particular core?
Thank you,
Suravee
next reply other threads:[~2013-08-06 2:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-06 2:27 Suravee Suthikulanit [this message]
2013-08-06 7:12 ` x86/AMD: Nested VM failed to boot L2 guest due to setting/clearing CR0.CD bit Jan Beulich
2013-08-06 17:55 ` Suravee Suthikulanit
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=52005F0C.4070409@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=JBeulich@suse.com \
--cc=chegger@amazon.de \
--cc=jun.nakajima@intel.com \
--cc=xen-devel@lists.xen.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.