Displaying 20 results from an estimated 273 matches for "__va".
2008 May 15
0
[PATCH] linux/x86: utilize lookup_address() for virt_to_ptep()
...6/mach-xen/asm/pgtable.h 2008-05-15 13:38:59.000000000 +0200
@@ -477,19 +477,16 @@ void make_page_writable(void *va, unsign
void make_pages_readonly(void *va, unsigned int nr, unsigned int feature);
void make_pages_writable(void *va, unsigned int nr, unsigned int feature);
-#define virt_to_ptep(__va) \
-({ \
- pgd_t *__pgd = pgd_offset_k((unsigned long)(__va)); \
- pud_t *__pud = pud_offset(__pgd, (unsigned long)(__va)); \
- pmd_t *__pmd = pmd_offset(__pud, (unsigned long)(__va)); \
- pte_offset_kernel(__pmd, (unsigned long)(__va)); \
-})
-
-#define arbitrary_virt_to_machine(__v...
2007 Apr 18
1
[PATCH 14/21] i386 Apm is on cpu zero only
...ect a 64k limit, so we use that.
+ *
+ * Note we only set APM segments on CPU zero, since we pin the APM
+ * code to that CPU.
*/
- for (i = 0; i < NR_CPUS; i++) {
- struct desc_struct *gdt = get_cpu_gdt_table(i);
- if (!gdt)
- continue;
- set_base(&gdt[APM_CS >> 3],
- __va((unsigned long)apm_info.bios.cseg << 4));
- set_base(&gdt[APM_CS_16 >> 3],
- __va((unsigned long)apm_info.bios.cseg_16 << 4));
- set_base(&gdt[APM_DS >> 3],
- __va((unsigned long)apm_info.bios.dseg << 4));
- }
+ gdt = get_cpu_gdt_table(0);
+ set_base(&a...
2007 Apr 18
1
[PATCH 14/21] i386 Apm is on cpu zero only
...ect a 64k limit, so we use that.
+ *
+ * Note we only set APM segments on CPU zero, since we pin the APM
+ * code to that CPU.
*/
- for (i = 0; i < NR_CPUS; i++) {
- struct desc_struct *gdt = get_cpu_gdt_table(i);
- if (!gdt)
- continue;
- set_base(&gdt[APM_CS >> 3],
- __va((unsigned long)apm_info.bios.cseg << 4));
- set_base(&gdt[APM_CS_16 >> 3],
- __va((unsigned long)apm_info.bios.cseg_16 << 4));
- set_base(&gdt[APM_DS >> 3],
- __va((unsigned long)apm_info.bios.dseg << 4));
- }
+ gdt = get_cpu_gdt_table(0);
+ set_base(&a...
2007 Apr 18
3
[PATCH 12/21] i386 Deprecate descriptor asm
...ch-work/arch/i386/kernel/apm.c 2005-11-05 00:28:07.000000000 -0800
@@ -2256,11 +2256,11 @@ static int __init apm_init(void)
*/
for (i = 0; i < NR_CPUS; i++) {
struct desc_struct *gdt = get_cpu_gdt_table(i);
- set_base(gdt[APM_CS >> 3],
+ set_base(&gdt[APM_CS >> 3],
__va((unsigned long)apm_info.bios.cseg << 4));
- set_base(gdt[APM_CS_16 >> 3],
+ set_base(&gdt[APM_CS_16 >> 3],
__va((unsigned long)apm_info.bios.cseg_16 << 4));
- set_base(gdt[APM_DS >> 3],
+ set_base(&gdt[APM_DS >> 3],
__va((unsigned long)apm_i...
2007 Apr 18
3
[PATCH 12/21] i386 Deprecate descriptor asm
...ch-work/arch/i386/kernel/apm.c 2005-11-05 00:28:07.000000000 -0800
@@ -2256,11 +2256,11 @@ static int __init apm_init(void)
*/
for (i = 0; i < NR_CPUS; i++) {
struct desc_struct *gdt = get_cpu_gdt_table(i);
- set_base(gdt[APM_CS >> 3],
+ set_base(&gdt[APM_CS >> 3],
__va((unsigned long)apm_info.bios.cseg << 4));
- set_base(gdt[APM_CS_16 >> 3],
+ set_base(&gdt[APM_CS_16 >> 3],
__va((unsigned long)apm_info.bios.cseg_16 << 4));
- set_base(gdt[APM_DS >> 3],
+ set_base(&gdt[APM_DS >> 3],
__va((unsigned long)apm_i...
2007 Apr 18
0
[PATCH 8/12] base-limit-cleanup
.../apm.c 2005-08-08 17:58:01.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/apm.c 2005-08-08 17:58:03.000000000 -0700
@@ -2291,40 +2291,40 @@
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*/
- set_base(bad_bios_desc, __va((unsigned long)0x40 << 4));
- _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4));
+ set_base(&bad_bios_desc, __va((unsigned long)0x40 << 4));
+ _set_limit(&bad_bios_desc, 4095 - (0x40 << 4));
apm_bios_entry.offset = apm_info.bios.offset;
apm_bios_entry....
2007 Apr 18
0
[PATCH 8/12] base-limit-cleanup
.../apm.c 2005-08-08 17:58:01.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/apm.c 2005-08-08 17:58:03.000000000 -0700
@@ -2291,40 +2291,40 @@
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*/
- set_base(bad_bios_desc, __va((unsigned long)0x40 << 4));
- _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4));
+ set_base(&bad_bios_desc, __va((unsigned long)0x40 << 4));
+ _set_limit(&bad_bios_desc, 4095 - (0x40 << 4));
apm_bios_entry.offset = apm_info.bios.offset;
apm_bios_entry....
2007 Apr 18
0
[PATCH 2/2] Use page present for pae pdpes
...tPagePDE(virt_to_page(pmd));
- set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
+ set_pgd(&pgd[i], __pgd(_PAGE_PRESENT | __pa(pmd)));
}
return pgd;
out_oom:
for (i--; i >= 0; i--) {
ClearPagePDE(pfn_to_page(pgd_val(pgd[i]) >> PAGE_SHIFT));
- kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i]) & PAGE_MASK));
}
kmem_cache_free(pgd_cache, pgd);
return NULL;
@@ -268,7 +268,7 @@ void pgd_free(pgd_t *pgd)
if (PTRS_PER_PMD > 1)
for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
ClearPagePDE(pfn_to_p...
2010 Aug 05
1
How can i get VA from a pfn in HVM guest
Hi,
After i get the pfn in a hvm guest using following code, how can i use it? Simply using __va() seems wrong, for the ( param.value << PAGE_SHIFT ) is feffc000 in my test module, using __va() will overflow.
xen_hvm_param_t param;
param.domid = DOMID_SELF;
param.index = HVM_PARAM_STORE_PFN;
hypercall_hvm_op(HVMOP_get_param, ¶m);
_______________...
2007 Apr 18
0
[PATCH 2/2] Use page present for pae pdpes
...tPagePDE(virt_to_page(pmd));
- set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
+ set_pgd(&pgd[i], __pgd(_PAGE_PRESENT | __pa(pmd)));
}
return pgd;
out_oom:
for (i--; i >= 0; i--) {
ClearPagePDE(pfn_to_page(pgd_val(pgd[i]) >> PAGE_SHIFT));
- kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i]) & PAGE_MASK));
}
kmem_cache_free(pgd_cache, pgd);
return NULL;
@@ -268,7 +268,7 @@ void pgd_free(pgd_t *pgd)
if (PTRS_PER_PMD > 1)
for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
ClearPagePDE(pfn_to_p...
2007 Apr 18
0
[PATCH 9/14] i386 / Typecheck and optimize base and limit accessors
.../apm.c 2005-08-09 20:17:26.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/apm.c 2005-08-09 20:17:26.000000000 -0700
@@ -2291,40 +2291,40 @@
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*/
- set_base(bad_bios_desc, __va((unsigned long)0x40 << 4));
- _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4));
+ set_base(&bad_bios_desc, __va((unsigned long)0x40 << 4));
+ _set_limit(&bad_bios_desc, 4095 - (0x40 << 4));
apm_bios_entry.offset = apm_info.bios.offset;
apm_bios_entry....
2007 Apr 18
0
[PATCH 9/14] i386 / Typecheck and optimize base and limit accessors
.../apm.c 2005-08-09 20:17:26.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/apm.c 2005-08-09 20:17:26.000000000 -0700
@@ -2291,40 +2291,40 @@
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*/
- set_base(bad_bios_desc, __va((unsigned long)0x40 << 4));
- _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4));
+ set_base(&bad_bios_desc, __va((unsigned long)0x40 << 4));
+ _set_limit(&bad_bios_desc, 4095 - (0x40 << 4));
apm_bios_entry.offset = apm_info.bios.offset;
apm_bios_entry....
2007 Apr 18
1
[PATCH 1/5] Add pagetable allocation notifiers
...(!pmd)
goto out_oom;
+ SetPagePDE(virt_to_page(pmd));
set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
}
return pgd;
out_oom:
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--) {
+ ClearPagePDE(pfn_to_page(pgd_val(pgd[i]) >> PAGE_SHIFT));
kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ }
kmem_cache_free(pgd_cache, pgd);
return NULL;
}
@@ -261,8 +266,10 @@ void pgd_free(pgd_t *pgd)
/* in the PAE case user pgd entries are overwritten before usage */
if (PTRS_PER_PMD > 1)
- for (i = 0; i < USER_PTRS_PER_PGD; ++i)
- kmem_cache_free(pmd_cache...
2007 Apr 18
1
[PATCH 1/5] Add pagetable allocation notifiers
...(!pmd)
goto out_oom;
+ SetPagePDE(virt_to_page(pmd));
set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
}
return pgd;
out_oom:
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--) {
+ ClearPagePDE(pfn_to_page(pgd_val(pgd[i]) >> PAGE_SHIFT));
kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ }
kmem_cache_free(pgd_cache, pgd);
return NULL;
}
@@ -261,8 +266,10 @@ void pgd_free(pgd_t *pgd)
/* in the PAE case user pgd entries are overwritten before usage */
if (PTRS_PER_PMD > 1)
- for (i = 0; i < USER_PTRS_PER_PGD; ++i)
- kmem_cache_free(pmd_cache...
2007 Apr 18
0
[PATCH 6/21] i386 Fixed pnp bios limits
...16:54:56.000000000 -0800
+++ linux-2.6.14-zach-work/drivers/pnp/pnpbios/bioscalls.c 2005-11-05 00:28:11.000000000 -0800
@@ -58,12 +58,6 @@ __asm__(
".previous \n"
);
-#define Q_SET_SEL(cpu, selname, address, size) \
-do { \
-set_base(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], __va((u32)(address))); \
-set_limit(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], size); \
-} while(0)
-
#define Q2_SET_SEL(cpu, selname, address, size) \
do { \
set_base(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], (u32)(address)); \
@@ -523,10 +517,10 @@ void pnpbios_calls_init(union pnp_b...
2007 Apr 18
0
[PATCH 6/21] i386 Fixed pnp bios limits
...16:54:56.000000000 -0800
+++ linux-2.6.14-zach-work/drivers/pnp/pnpbios/bioscalls.c 2005-11-05 00:28:11.000000000 -0800
@@ -58,12 +58,6 @@ __asm__(
".previous \n"
);
-#define Q_SET_SEL(cpu, selname, address, size) \
-do { \
-set_base(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], __va((u32)(address))); \
-set_limit(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], size); \
-} while(0)
-
#define Q2_SET_SEL(cpu, selname, address, size) \
do { \
set_base(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], (u32)(address)); \
@@ -523,10 +517,10 @@ void pnpbios_calls_init(union pnp_b...
2007 Apr 18
0
[PATCH 1/5] Paravirt page alloc.patch
...mm_struct *mm)
pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
if (!pmd)
goto out_oom;
+ paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
}
return pgd;
out_oom:
- for (i--; i >= 0; i--)
- kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ for (i--; i >= 0; i--) {
+ pgd_t pgdent = pgd[i];
+ void* pmd = (void *)__va(pgd_val(pgdent)-1);
+ paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
+ kmem_cache_free(pmd_cache, pmd);
+ }
kmem_cache_free(pgd_cache, pgd);
return NULL;
}
@@ -291,8 +303,12 @@ void...
2007 Apr 18
0
[PATCH 1/5] Paravirt page alloc.patch
...mm_struct *mm)
pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
if (!pmd)
goto out_oom;
+ paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
}
return pgd;
out_oom:
- for (i--; i >= 0; i--)
- kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ for (i--; i >= 0; i--) {
+ pgd_t pgdent = pgd[i];
+ void* pmd = (void *)__va(pgd_val(pgdent)-1);
+ paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
+ kmem_cache_free(pmd_cache, pmd);
+ }
kmem_cache_free(pgd_cache, pgd);
return NULL;
}
@@ -291,8 +303,12 @@ void...
2007 Apr 18
0
[PATCH 1/6] Page allocation hooks for VMI backend
...mm_struct *mm)
pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
if (!pmd)
goto out_oom;
+ paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
}
return pgd;
out_oom:
- for (i--; i >= 0; i--)
- kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ for (i--; i >= 0; i--) {
+ pgd_t pgdent = pgd[i];
+ void* pmd = (void *)__va(pgd_val(pgdent)-1);
+ paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
+ kmem_cache_free(pmd_cache, pmd);
+ }
kmem_cache_free(pgd_cache, pgd);
return NULL;
}
@@ -291,8 +303,12 @@ void...
2007 Apr 18
0
[PATCH 1/6] Page allocation hooks for VMI backend
...mm_struct *mm)
pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
if (!pmd)
goto out_oom;
+ paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
}
return pgd;
out_oom:
- for (i--; i >= 0; i--)
- kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ for (i--; i >= 0; i--) {
+ pgd_t pgdent = pgd[i];
+ void* pmd = (void *)__va(pgd_val(pgdent)-1);
+ paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
+ kmem_cache_free(pmd_cache, pmd);
+ }
kmem_cache_free(pgd_cache, pgd);
return NULL;
}
@@ -291,8 +303,12 @@ void...