Commit 4290d5b9 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-4.19b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

 - minor cleanup avoiding a warning when building with new gcc

 - a patch to add a new sysfs node for Xen frontend/backend drivers to
   make it easier to obtain the state of a pv device

 - two fixes for 32-bit pv-guests to avoid intermediate L1TF vulnerable
   PTEs

* tag 'for-linus-4.19b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  x86/xen: remove redundant variable save_pud
  xen: export device state to sysfs
  x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear
  x86/xen: don't write ptes directly in 32-bit PV guests
parents 01f6543a 6d3c8ce0
...@@ -73,3 +73,12 @@ KernelVersion: 3.0 ...@@ -73,3 +73,12 @@ KernelVersion: 3.0
Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Description: Description:
Number of sectors written by the frontend. Number of sectors written by the frontend.
What: /sys/bus/xen-backend/devices/*/state
Date: August 2018
KernelVersion: 4.19
Contact: Joe Jin <joe.jin@oracle.com>
Description:
The state of the device. One of: 'Unknown',
'Initialising', 'Initialised', 'Connected', 'Closing',
'Closed', 'Reconfiguring', 'Reconfigured'.
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#ifndef _ASM_X86_PGTABLE_3LEVEL_H #ifndef _ASM_X86_PGTABLE_3LEVEL_H
#define _ASM_X86_PGTABLE_3LEVEL_H #define _ASM_X86_PGTABLE_3LEVEL_H
#include <asm/atomic64_32.h>
/* /*
* Intel Physical Address Extension (PAE) Mode - three-level page * Intel Physical Address Extension (PAE) Mode - three-level page
* tables on PPro+ CPUs. * tables on PPro+ CPUs.
...@@ -150,10 +152,7 @@ static inline pte_t native_ptep_get_and_clear(pte_t *ptep) ...@@ -150,10 +152,7 @@ static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
{ {
pte_t res; pte_t res;
/* xchg acts as a barrier before the setting of the high bits */ res.pte = (pteval_t)arch_atomic64_xchg((atomic64_t *)ptep, 0);
res.pte_low = xchg(&ptep->pte_low, 0);
res.pte_high = ptep->pte_high;
ptep->pte_high = 0;
return res; return res;
} }
......
...@@ -435,14 +435,13 @@ static void xen_set_pud(pud_t *ptr, pud_t val) ...@@ -435,14 +435,13 @@ static void xen_set_pud(pud_t *ptr, pud_t val)
static void xen_set_pte_atomic(pte_t *ptep, pte_t pte) static void xen_set_pte_atomic(pte_t *ptep, pte_t pte)
{ {
trace_xen_mmu_set_pte_atomic(ptep, pte); trace_xen_mmu_set_pte_atomic(ptep, pte);
set_64bit((u64 *)ptep, native_pte_val(pte)); __xen_set_pte(ptep, pte);
} }
static void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) static void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{ {
trace_xen_mmu_pte_clear(mm, addr, ptep); trace_xen_mmu_pte_clear(mm, addr, ptep);
if (!xen_batched_set_pte(ptep, native_make_pte(0))) __xen_set_pte(ptep, native_make_pte(0));
native_pte_clear(mm, addr, ptep);
} }
static void xen_pmd_clear(pmd_t *pmdp) static 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,7 +1569,7 @@ static void __init xen_set_pte_init(pte_t *ptep, pte_t pte)
pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) & pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) &
pte_val_ma(pte)); pte_val_ma(pte));
#endif #endif
native_set_pte(ptep, pte); __xen_set_pte(ptep, pte);
} }
/* Early in boot, while setting up the initial pagetable, assume /* Early in boot, while setting up the initial pagetable, assume
...@@ -2061,7 +2060,6 @@ void __init xen_relocate_p2m(void) ...@@ -2061,7 +2060,6 @@ void __init xen_relocate_p2m(void)
pud_t *pud; pud_t *pud;
pgd_t *pgd; pgd_t *pgd;
unsigned long *new_p2m; unsigned long *new_p2m;
int save_pud;
size = PAGE_ALIGN(xen_start_info->nr_pages * sizeof(unsigned long)); size = PAGE_ALIGN(xen_start_info->nr_pages * sizeof(unsigned long));
n_pte = roundup(size, PAGE_SIZE) >> PAGE_SHIFT; n_pte = roundup(size, PAGE_SIZE) >> PAGE_SHIFT;
...@@ -2091,7 +2089,6 @@ void __init xen_relocate_p2m(void) ...@@ -2091,7 +2089,6 @@ void __init xen_relocate_p2m(void)
pgd = __va(read_cr3_pa()); pgd = __va(read_cr3_pa());
new_p2m = (unsigned long *)(2 * PGDIR_SIZE); new_p2m = (unsigned long *)(2 * PGDIR_SIZE);
save_pud = n_pud;
for (idx_pud = 0; idx_pud < n_pud; idx_pud++) { for (idx_pud = 0; idx_pud < n_pud; idx_pud++) {
pud = early_memremap(pud_phys, PAGE_SIZE); pud = early_memremap(pud_phys, PAGE_SIZE);
clear_page(pud); clear_page(pud);
......
...@@ -402,10 +402,19 @@ static ssize_t modalias_show(struct device *dev, ...@@ -402,10 +402,19 @@ static ssize_t modalias_show(struct device *dev,
} }
static DEVICE_ATTR_RO(modalias); static DEVICE_ATTR_RO(modalias);
static ssize_t state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%s\n",
xenbus_strstate(to_xenbus_device(dev)->state));
}
static DEVICE_ATTR_RO(state);
static struct attribute *xenbus_dev_attrs[] = { static struct attribute *xenbus_dev_attrs[] = {
&dev_attr_nodename.attr, &dev_attr_nodename.attr,
&dev_attr_devtype.attr, &dev_attr_devtype.attr,
&dev_attr_modalias.attr, &dev_attr_modalias.attr,
&dev_attr_state.attr,
NULL, NULL,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment