aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/ABI/stable/sysfs-bus-xen-backend9
-rw-r--r--arch/x86/include/asm/pgtable-3level.h7
-rw-r--r--arch/x86/xen/mmu_pv.c9
-rw-r--r--drivers/xen/xenbus/xenbus_probe.c9
4 files changed, 24 insertions, 10 deletions
diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
index 3d5951c8bf5f..e8b60bd766f7 100644
--- a/Documentation/ABI/stable/sysfs-bus-xen-backend
+++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
@@ -73,3 +73,12 @@ KernelVersion: 3.0
73Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 73Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
74Description: 74Description:
75 Number of sectors written by the frontend. 75 Number of sectors written by the frontend.
76
77What: /sys/bus/xen-backend/devices/*/state
78Date: August 2018
79KernelVersion: 4.19
80Contact: Joe Jin <joe.jin@oracle.com>
81Description:
82 The state of the device. One of: 'Unknown',
83 'Initialising', 'Initialised', 'Connected', 'Closing',
84 'Closed', 'Reconfiguring', 'Reconfigured'.
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
index a564084c6141..f8b1ad2c3828 100644
--- a/arch/x86/include/asm/pgtable-3level.h
+++ b/arch/x86/include/asm/pgtable-3level.h
@@ -2,6 +2,8 @@
2#ifndef _ASM_X86_PGTABLE_3LEVEL_H 2#ifndef _ASM_X86_PGTABLE_3LEVEL_H
3#define _ASM_X86_PGTABLE_3LEVEL_H 3#define _ASM_X86_PGTABLE_3LEVEL_H
4 4
5#include <asm/atomic64_32.h>
6
5/* 7/*
6 * Intel Physical Address Extension (PAE) Mode - three-level page 8 * Intel Physical Address Extension (PAE) Mode - three-level page
7 * tables on PPro+ CPUs. 9 * tables on PPro+ CPUs.
@@ -150,10 +152,7 @@ static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
150{ 152{
151 pte_t res; 153 pte_t res;
152 154
153 /* xchg acts as a barrier before the setting of the high bits */ 155 res.pte = (pteval_t)arch_atomic64_xchg((atomic64_t *)ptep, 0);
154 res.pte_low = xchg(&ptep->pte_low, 0);
155 res.pte_high = ptep->pte_high;
156 ptep->pte_high = 0;
157 156
158 return res; 157 return res;
159} 158}
diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index 45b700ac5fe7..2fe5c9b1816b 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -435,14 +435,13 @@ static void xen_set_pud(pud_t *ptr, pud_t val)
435static void xen_set_pte_atomic(pte_t *ptep, pte_t pte) 435static void xen_set_pte_atomic(pte_t *ptep, pte_t pte)
436{ 436{
437 trace_xen_mmu_set_pte_atomic(ptep, pte); 437 trace_xen_mmu_set_pte_atomic(ptep, pte);
438 set_64bit((u64 *)ptep, native_pte_val(pte)); 438 __xen_set_pte(ptep, pte);
439} 439}
440 440
441static void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 441static void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
442{ 442{
443 trace_xen_mmu_pte_clear(mm, addr, ptep); 443 trace_xen_mmu_pte_clear(mm, addr, ptep);
444 if (!xen_batched_set_pte(ptep, native_make_pte(0))) 444 __xen_set_pte(ptep, native_make_pte(0));
445 native_pte_clear(mm, addr, ptep);
446} 445}
447 446
448static void xen_pmd_clear(pmd_t *pmdp) 447static void xen_pmd_clear(pmd_t *pmdp)
@@ -1570,7 +1569,7 @@ static void __init xen_set_pte_init(pte_t *ptep, pte_t pte)
1570 pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) & 1569 pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) &
1571 pte_val_ma(pte)); 1570 pte_val_ma(pte));
1572#endif 1571#endif
1573 native_set_pte(ptep, pte); 1572 __xen_set_pte(ptep, pte);
1574} 1573}
1575 1574
1576/* Early in boot, while setting up the initial pagetable, assume 1575/* Early in boot, while setting up the initial pagetable, assume
@@ -2061,7 +2060,6 @@ void __init xen_relocate_p2m(void)
2061 pud_t *pud; 2060 pud_t *pud;
2062 pgd_t *pgd; 2061 pgd_t *pgd;
2063 unsigned long *new_p2m; 2062 unsigned long *new_p2m;
2064 int save_pud;
2065 2063
2066 size = PAGE_ALIGN(xen_start_info->nr_pages * sizeof(unsigned long)); 2064 size = PAGE_ALIGN(xen_start_info->nr_pages * sizeof(unsigned long));
2067 n_pte = roundup(size, PAGE_SIZE) >> PAGE_SHIFT; 2065 n_pte = roundup(size, PAGE_SIZE) >> PAGE_SHIFT;
@@ -2091,7 +2089,6 @@ void __init xen_relocate_p2m(void)
2091 2089
2092 pgd = __va(read_cr3_pa()); 2090 pgd = __va(read_cr3_pa());
2093 new_p2m = (unsigned long *)(2 * PGDIR_SIZE); 2091 new_p2m = (unsigned long *)(2 * PGDIR_SIZE);
2094 save_pud = n_pud;
2095 for (idx_pud = 0; idx_pud < n_pud; idx_pud++) { 2092 for (idx_pud = 0; idx_pud < n_pud; idx_pud++) {
2096 pud = early_memremap(pud_phys, PAGE_SIZE); 2093 pud = early_memremap(pud_phys, PAGE_SIZE);
2097 clear_page(pud); 2094 clear_page(pud);
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index f2088838f690..5b471889d723 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -402,10 +402,19 @@ static ssize_t modalias_show(struct device *dev,
402} 402}
403static DEVICE_ATTR_RO(modalias); 403static DEVICE_ATTR_RO(modalias);
404 404
405static ssize_t state_show(struct device *dev,
406 struct device_attribute *attr, char *buf)
407{
408 return sprintf(buf, "%s\n",
409 xenbus_strstate(to_xenbus_device(dev)->state));
410}
411static DEVICE_ATTR_RO(state);
412
405static struct attribute *xenbus_dev_attrs[] = { 413static struct attribute *xenbus_dev_attrs[] = {
406 &dev_attr_nodename.attr, 414 &dev_attr_nodename.attr,
407 &dev_attr_devtype.attr, 415 &dev_attr_devtype.attr,
408 &dev_attr_modalias.attr, 416 &dev_attr_modalias.attr,
417 &dev_attr_state.attr,
409 NULL, 418 NULL,
410}; 419};
411 420