Displaying 20 results from an estimated 90 matches for "_page_rw".
2008 Jan 18
0
[PATCH] minios: support COW for a zero page
...e2 extras/mini-os/include/x86/arch_mm.h
--- a/extras/mini-os/include/x86/arch_mm.h Fri Jan 18 15:55:13 2008 +0000
+++ b/extras/mini-os/include/x86/arch_mm.h Fri Jan 18 16:02:32 2008 +0000
@@ -144,12 +144,14 @@ typedef unsigned long pgentry_t;
#if defined(__i386__)
#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
+#define L1_PROT_RO (_PAGE_PRESENT|_PAGE_ACCESSED)
#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY |_PAGE_USER)
#if defined(CONFIG_X86_PAE)
#define L3_PROT (_PAGE_PRESENT)
#endif /* CONFIG_X86_PAE */
#elif defined(__x86_64__)
#define L1_PROT (_PAGE_PRESENT|_...
2012 Feb 14
1
[PATCH] x86: don't allow Dom0 to map MSI-X table writably
...first MSI-X interrupt (see
the original c/s 22182:68cc3c514a0a description for options).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -869,7 +869,7 @@ get_page_from_l1e(
return -EINVAL;
}
- if ( !(l1f & _PAGE_RW) || IS_PRIV(pg_owner) ||
+ if ( !(l1f & _PAGE_RW) ||
!rangeset_contains_singleton(mmio_ro_ranges, mfn) )
return 0;
dprintk(XENLOG_G_WARNING,
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http:...
2005 Mar 14
4
[patch/unstable] page table cleanups
...SED) ) {
- spte = (mfn << PAGE_SHIFT) | (gpte & ~PAGE_MASK);
+ spte = mk_l1_pgentry((mfn << PAGE_SHIFT) |
+ (l1_pgentry_val(gpte) & ~PAGE_MASK));
- if ( shadow_mode_log_dirty(d) || !(gpte & _PAGE_DIRTY) )
- spte &= ~_PAGE_RW;
+ if ( shadow_mode_log_dirty(d) || !(l1_pgentry_val(gpte) & _PAGE_DIRTY) )
+ l1_pgentry_val(spte) &= ~_PAGE_RW;
}
#if SHADOW_VERBOSE_DEBUG
- if ( old_spte || spte || gpte )
- SH_VVLOG("l1pte_propagate_from_guest: gpte=0x%p, old spte=0x%p, ne...
2006 Dec 01
1
[PATCH 2/10] Add support for netfront/netback acceleration drivers
...6 +0000
@@ -249,7 +249,9 @@ void __iomem * __ioremap(unsigned long p
return NULL;
area->phys_addr = phys_addr;
addr = (void __iomem *) area->addr;
- flags |= _KERNPG_TABLE;
+ /* This doesn''t mean the page will always be readonly - caller
+ could have passed in _PAGE_RW in flags */
+ flags |= _KERNPG_TABLE_READONLY;
if (__direct_remap_pfn_range(&init_mm, (unsigned long)addr,
phys_addr>>PAGE_SHIFT,
size, __pgprot(flags), domid)) {
@@ -285,7 +287,7 @@ void __iomem *ioremap_nocache (unsigned
void __iomem *ioremap_nocache (unsigned lo...
2009 Sep 21
1
[PATCH 2/5] lguest: use set_pte/set_pmd uniformly for real page table entries
...5 @@ static unsigned long setup_pagetables(st
*/
for (i = j = 0; i < mapped_pages && j < PTRS_PER_PMD;
i += PTRS_PER_PTE, j++) {
- /* FIXME: native_set_pmd is overkill here. */
- native_set_pmd(&pmd, __pmd(((unsigned long)(linear + i)
- - mem_base) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
+ pmd = pfn_pmd(((unsigned long)&linear[i] - mem_base)/PAGE_SIZE,
+ __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
if (copy_to_user(&pmds[j], &pmd, sizeof(pmd)) != 0)
return -EFAULT;
}
/* One PGD entry, pointing to that PMD page. */
- set_pgd(&...
2009 Sep 21
1
[PATCH 2/5] lguest: use set_pte/set_pmd uniformly for real page table entries
...5 @@ static unsigned long setup_pagetables(st
*/
for (i = j = 0; i < mapped_pages && j < PTRS_PER_PMD;
i += PTRS_PER_PTE, j++) {
- /* FIXME: native_set_pmd is overkill here. */
- native_set_pmd(&pmd, __pmd(((unsigned long)(linear + i)
- - mem_base) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
+ pmd = pfn_pmd(((unsigned long)&linear[i] - mem_base)/PAGE_SIZE,
+ __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
if (copy_to_user(&pmds[j], &pmd, sizeof(pmd)) != 0)
return -EFAULT;
}
/* One PGD entry, pointing to that PMD page. */
- set_pgd(&...
2008 Nov 04
7
[PATCH 1/1] Xen PV support for hugepages
...return 1;
@@ -698,10 +722,9 @@ get_page_from_l1e(
* contribute to writeable mapping refcounts. (This allows the
* qemu-dm helper process in dom0 to map the domain''s memory without
* messing up the count of "real" writable mappings.) */
- okay = (((l1f & _PAGE_RW) &&
- !(unlikely(paging_mode_external(d) && (d != curr->domain))))
- ? get_page_and_type(page, d, PGT_writable_page)
- : get_page(page, d));
+ writeable = (l1f & _PAGE_RW) &&
+ !( unlikely(paging_mode_external(d) &&...
2008 Jan 17
1
[PATCH 0/7] More lguest massage.
This series takes one more step towards cpu-ification of lguest.
As for rusty's last suggestion, I get rid of the whole bunch
of "struct lguest *lg = cpu->lg" statements around by using
lg_cpu as our base structure wherever it matters. (this saves us
11 lines)
2007 May 14
0
[PATCH] x86: ptwr adjustments
...5-14.orig/xen/arch/x86/mm.c 2007-05-14 13:43:50.000000000 +0200
+++ 2007-05-14/xen/arch/x86/mm.c 2007-05-14 13:44:25.000000000 +0200
@@ -3238,13 +3238,14 @@ static int ptwr_emulated_update(
/* We are looking only for read-only mappings of p.t. pages. */
ASSERT((l1e_get_flags(pte) & (_PAGE_RW|_PAGE_PRESENT)) == _PAGE_PRESENT);
+ ASSERT(mfn_valid(mfn));
ASSERT((page->u.inuse.type_info & PGT_type_mask) == PGT_l1_page_table);
ASSERT((page->u.inuse.type_info & PGT_count_mask) != 0);
ASSERT(page_get_owner(page) == d);
/* Check the new PTE. */
nl1e...
2008 Jan 17
1
[PATCH 0/7] More lguest massage.
This series takes one more step towards cpu-ification of lguest.
As for rusty's last suggestion, I get rid of the whole bunch
of "struct lguest *lg = cpu->lg" statements around by using
lg_cpu as our base structure wherever it matters. (this saves us
11 lines)
2012 Mar 05
0
Page Fault in PV?
Hi,
I remove some pages'' _PAGE_RW flags and record these pages.
Then I modify do_page_fault function of Xen. I just add
_PAGE_RW flags to these, when they are written.
However, my domain still crashes.
Guest OS are supposed to know nothing about this. Why does this happen?
R
2007 Apr 30
0
[PATCH] lguest: properly kill guest userspace programs accessing kernel mem
...guest *lg, unsigned long vaddr, int write)
+int demand_page(struct lguest *lg, unsigned long vaddr, int errcode)
{
gpgd_t gpgd;
spgd_t *spgd;
@@ -138,12 +140,16 @@ int demand_page(struct lguest *lg, unsig
return 0;
/* Write to read-only page? */
- if (write && !(gpte.flags & _PAGE_RW))
+ if ((errcode & 2) && !(gpte.flags & _PAGE_RW))
return 0;
+
+ /* User access to a non-user page? */
+ if ((errcode & 4) && !(gpte.flags & _PAGE_USER))
+ return 0;
check_gpte(lg, gpte);
gpte.flags |= _PAGE_ACCESSED;
- if (write)
+ if (errcode & 2)...
2007 Apr 30
0
[PATCH] lguest: properly kill guest userspace programs accessing kernel mem
...guest *lg, unsigned long vaddr, int write)
+int demand_page(struct lguest *lg, unsigned long vaddr, int errcode)
{
gpgd_t gpgd;
spgd_t *spgd;
@@ -138,12 +140,16 @@ int demand_page(struct lguest *lg, unsig
return 0;
/* Write to read-only page? */
- if (write && !(gpte.flags & _PAGE_RW))
+ if ((errcode & 2) && !(gpte.flags & _PAGE_RW))
return 0;
+
+ /* User access to a non-user page? */
+ if ((errcode & 4) && !(gpte.flags & _PAGE_USER))
+ return 0;
check_gpte(lg, gpte);
gpte.flags |= _PAGE_ACCESSED;
- if (write)
+ if (errcode & 2)...
2008 May 23
0
[PATCH] x86/paravirt: add pte_flags to just get pte flags
...{
- return pte_val(pte) & _PAGE_DIRTY;
+ return pte_flags(pte) & _PAGE_DIRTY;
}
static inline int pte_young(pte_t pte)
{
- return pte_val(pte) & _PAGE_ACCESSED;
+ return pte_flags(pte) & _PAGE_ACCESSED;
}
static inline int pte_write(pte_t pte)
{
- return pte_val(pte) & _PAGE_RW;
+ return pte_flags(pte) & _PAGE_RW;
}
static inline int pte_file(pte_t pte)
{
- return pte_val(pte) & _PAGE_FILE;
+ return pte_flags(pte) & _PAGE_FILE;
}
static inline int pte_huge(pte_t pte)
{
- return pte_val(pte) & _PAGE_PSE;
+ return pte_flags(pte) & _PAGE_PSE;
}...
2008 May 23
0
[PATCH] x86/paravirt: add pte_flags to just get pte flags
...{
- return pte_val(pte) & _PAGE_DIRTY;
+ return pte_flags(pte) & _PAGE_DIRTY;
}
static inline int pte_young(pte_t pte)
{
- return pte_val(pte) & _PAGE_ACCESSED;
+ return pte_flags(pte) & _PAGE_ACCESSED;
}
static inline int pte_write(pte_t pte)
{
- return pte_val(pte) & _PAGE_RW;
+ return pte_flags(pte) & _PAGE_RW;
}
static inline int pte_file(pte_t pte)
{
- return pte_val(pte) & _PAGE_FILE;
+ return pte_flags(pte) & _PAGE_FILE;
}
static inline int pte_huge(pte_t pte)
{
- return pte_val(pte) & _PAGE_PSE;
+ return pte_flags(pte) & _PAGE_PSE;
}...
2007 Jun 20
2
Page fault on mapped pages with reserved bits set
I''m porting a light weight kernel to run under the Xen hypervisor
and have run into a problem while trying to switch to my page tables
on x86-64. After a minor problem with switching to the new PML4
table that was cleared up when Mark Williamson suggested mapping
everything read-only in the current map before switching, as well
as switching the memory management code to use the
2008 Oct 02
11
[PATCH 1/2] PV hugepages - Xen patch
This patch enables support of hugepages in a pv Xen environment. It is
against the latest xen unstable tree on http://xenbits.xensource.com.
The patch assumes the guest is passing a physically aligned hugepage. It does
reference counting on all the underlying pages.
Dave McCracken
Oracle Corp.
_______________________________________________
Xen-devel mailing list
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...f (!(pmd_flags(*spmd) & _PAGE_PRESENT))
+ return false;
+#endif
+
/* Check the flags on the pte entry itself: it must be present and
* writable. */
- flags = pte_flags(*(spte_addr(*spgd, vaddr)));
+ flags = pte_flags(*(spte_addr(cpu, *spgd, vaddr)));
return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW);
}
@@ -322,8 +439,45 @@ void pin_page(struct lg_cpu *cpu, unsigned long vaddr)
kill_guest(cpu, "bad stack page %#lx", vaddr);
}
+#ifdef CONFIG_X86_PAE
+static void release_pmd(pmd_t *spmd)
+{
+ /* If the entry's not present, there's nothing to...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...f (!(pmd_flags(*spmd) & _PAGE_PRESENT))
+ return false;
+#endif
+
/* Check the flags on the pte entry itself: it must be present and
* writable. */
- flags = pte_flags(*(spte_addr(*spgd, vaddr)));
+ flags = pte_flags(*(spte_addr(cpu, *spgd, vaddr)));
return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW);
}
@@ -322,8 +439,45 @@ void pin_page(struct lg_cpu *cpu, unsigned long vaddr)
kill_guest(cpu, "bad stack page %#lx", vaddr);
}
+#ifdef CONFIG_X86_PAE
+static void release_pmd(pmd_t *spmd)
+{
+ /* If the entry's not present, there's nothing to...
2020 Apr 28
0
[PATCH v3 75/75] x86/efi: Add GHCB mappings when SEV-ES is active
...@ -422,6 +422,31 @@ int sev_es_setup_ap_jump_table(struct real_mode_header *rmh)
return 0;
}
+int __init sev_es_efi_map_ghcbs(pgd_t *pgd)
+{
+ struct sev_es_runtime_data *data;
+ unsigned long address, pflags;
+ int cpu;
+ u64 pfn;
+
+ if (!sev_es_active())
+ return 0;
+
+ pflags = _PAGE_NX | _PAGE_RW;
+
+ for_each_possible_cpu(cpu) {
+ data = per_cpu(runtime_data, cpu);
+
+ address = __pa(&data->ghcb_page);
+ pfn = address >> PAGE_SHIFT;
+
+ if (kernel_map_pages_in_pgd(pgd, pfn, address, 1, pflags))
+ return 1;
+ }
+
+ return 0;
+}
+
static enum es_result vc_handle_msr(struc...