bitkeeper revision 1.1668.1.7 (42a8a4de9UsUPhyAknlQBRJ3xbTHtw)

Zero out newly allocated xenheap pages for page tables,
also newly allocated domheap pages.
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
This commit is contained in:
djm@kirby.fc.hp.com committed 2005-06-09 20:21:50 +00:00
1 parent 7bf4906ead
commit 26a6bd3700
3 files changed
+14 -11

No files matched your search

+4 -1
View File
@@ -453,7 +453,11 @@ extern unsigned long vhpt_paddr, vhpt_pend;
if (d == dom0) p = map_new_domain0_page(mpaddr);
else
#endif
{
p = alloc_domheap_page(d);
// zero out pages for security reasons
memset(__va(page_to_phys(p)),0,PAGE_SIZE);
}
if (unlikely(!p)) {
printf("map_new_domain_page: Can't alloc!!!! Aaaargh!\n");
return(p);
@@ -512,7 +516,6 @@ tryagain:
}
/* if lookup fails and mpaddr is "legal", "create" the page */
if ((mpaddr >> PAGE_SHIFT) < d->max_pages) {
// FIXME: should zero out pages for security reasons
if (map_new_domain_page(d,mpaddr)) goto tryagain;
}
printk("lookup_domain_mpa: bad mpa %p (> %p\n",
+10 -6
View File
@@ -1,54 +1,58 @@
--- ../../linux-2.6.11/include/asm-ia64/pgalloc.h 2005-03-02 00:37:31.000000000 -0700
+++ include/asm-ia64/pgalloc.h 2005-04-29 17:09:20.000000000 -0600
@@ -61,7 +61,11 @@
+++ include/asm-ia64/pgalloc.h 2005-06-09 13:40:48.000000000 -0600
@@ -61,7 +61,12 @@
pgd_t *pgd = pgd_alloc_one_fast(mm);
if (unlikely(pgd == NULL)) {
+#ifdef XEN
+ pgd = (pgd_t *)alloc_xenheap_page();
+ memset(pgd,0,PAGE_SIZE);
+#else
pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
+#endif
}
return pgd;
}
@@ -104,7 +108,11 @@
@@ -104,7 +109,12 @@
static inline pmd_t*
pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
{
+#ifdef XEN
+ pmd_t *pmd = (pmd_t *)alloc_xenheap_page();
+ memset(pmd,0,PAGE_SIZE);
+#else
pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
+#endif
return pmd;
}
@@ -136,7 +144,11 @@
@@ -136,7 +146,12 @@
static inline struct page *
pte_alloc_one (struct mm_struct *mm, unsigned long addr)
{
+#ifdef XEN
+ struct page *pte = alloc_xenheap_page();
+ memset(pte,0,PAGE_SIZE);
+#else
struct page *pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+#endif
return pte;
}
@@ -144,7 +156,11 @@
@@ -144,7 +159,12 @@
static inline pte_t *
pte_alloc_one_kernel (struct mm_struct *mm, unsigned long addr)
{
+#ifdef XEN
+ pte_t *pte = (pte_t *)alloc_xenheap_page();
+ memset(pte,0,PAGE_SIZE);
+#else
pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
+#endif
return pte;
}
@@ -152,13 +168,21 @@
@@ -152,13 +172,21 @@
static inline void
pte_free (struct page *pte)
{
-4
View File
@@ -822,8 +822,6 @@ ia64_handle_privop (unsigned long ifa, struct pt_regs *regs, unsigned long isr,
#define INTR_TYPE_MAX 10
UINT64 int_counts[INTR_TYPE_MAX];
void dis_foo(void) { }
void
ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long iim, unsigned long vector)
{
@@ -858,8 +856,6 @@ ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long i
vector = IA64_DATA_ACCESS_RIGHTS_VECTOR; break;
case 25:
vector = IA64_DISABLED_FPREG_VECTOR;
//printf("*** Attempting to handle disabled_fpreg\n");
dis_foo();
break;
case 26:
printf("*** NaT fault... attempting to handle as privop\n");
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.