From: "Scott Parish" <srparish@us.ibm.com>
To: xen-devel@lists.xensource.com
Subject: [patch] unwanted sign extending
Date: Tue, 21 Jun 2005 20:10:30 +0000 [thread overview]
Message-ID: <20050621201030.GB16276@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 826 bytes --]
static int alloc_l3_table(struct pfn_info *page)
{
...
unsigned long vaddr;
unsigned int i;
...
for ( i = 0; i < L3_PAGETABLE_ENTRIES; i++ )
{
vaddr = i << L3_PAGETABLE_SHIFT;
...
}
...
}
"i" gets sign extended when its shifted, so vaddr has all its high
bits set. Because of that some l2 page_type's come out looking like
PGT_writable instead of PGT_l2. Eventually this leads to an attempt to
call put_page_type on the page twice, once when cleaning up recursively
from l4, and once from walking the raw frames list. The second
put_page_type hits the ASSERT that the type count isn't 0.
With the attached patch, i can completely run a simple "hello world"
domu, and its cleanup. Linux domu still probably doesn't work.
sRp
--
Scott Parish
Signed-off-by: srparish@us.ibm.com
[-- Attachment #2: no-sign-extension.diff --]
[-- Type: text/plain, Size: 394 bytes --]
--- old-xen-build/xen/arch/x86/mm.c 2005-06-14 15:55:34.000000000 +0000
+++ new-xen-build/xen/arch/x86/mm.c 2005-06-21 20:35:09.000000000 +0000
@@ -814,7 +814,7 @@ static int alloc_l3_table(struct pfn_inf
unsigned long pfn = page_to_pfn(page);
unsigned long vaddr;
l3_pgentry_t *pl3e;
- int i;
+ unsigned int i;
ASSERT(!shadow_mode_refcounts(d));
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2005-06-21 20:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-21 20:10 Scott Parish [this message]
2005-06-22 7:14 ` [patch] unwanted sign extending Jan Beulich
2005-06-22 11:20 ` Scott Parish
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=20050621201030.GB16276@us.ibm.com \
--to=srparish@us.ibm.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.