Commit a09b1d78 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull xen updates from Juergen Gross:

 - two small cleanup patches

 - avoid error messages when initializing MCA banks in a Xen dom0

 - a small series for converting the Xen gntdev driver to use
   pin_user_pages*() instead of get_user_pages*()

 - intermediate fix for running as a Xen guest on Arm with KPTI enabled
   (the final solution will need new Xen functionality)

* tag 'for-linus-5.10b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  x86/xen: Fix typo in xen_pagetable_p2m_free()
  x86/xen: disable Firmware First mode for correctable memory errors
  xen/arm: do not setup the runstate info page if kpti is enabled
  xen: remove redundant initialization of variable ret
  xen/gntdev.c: Convert get_user_pages*() to pin_user_pages*()
  xen/gntdev.c: Mark pages as dirty
parents 4907a43d 32118f97
#include <xen/arm/page.h> #include <xen/arm/page.h>
static inline bool xen_kernel_unmapped_at_usr(void)
{
return false;
}
...@@ -158,7 +158,8 @@ static int xen_starting_cpu(unsigned int cpu) ...@@ -158,7 +158,8 @@ static int xen_starting_cpu(unsigned int cpu)
BUG_ON(err); BUG_ON(err);
per_cpu(xen_vcpu, cpu) = vcpup; per_cpu(xen_vcpu, cpu) = vcpup;
xen_setup_runstate_info(cpu); if (!xen_kernel_unmapped_at_usr())
xen_setup_runstate_info(cpu);
after_register_vcpu_info: after_register_vcpu_info:
enable_percpu_irq(xen_events_irq, 0); enable_percpu_irq(xen_events_irq, 0);
...@@ -387,7 +388,8 @@ static int __init xen_guest_init(void) ...@@ -387,7 +388,8 @@ static int __init xen_guest_init(void)
return -EINVAL; return -EINVAL;
} }
xen_time_setup_guest(); if (!xen_kernel_unmapped_at_usr())
xen_time_setup_guest();
if (xen_initial_domain()) if (xen_initial_domain())
pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier); pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier);
......
#include <xen/arm/page.h> #include <xen/arm/page.h>
#include <asm/mmu.h>
static inline bool xen_kernel_unmapped_at_usr(void)
{
return arm64_kernel_unmapped_at_el0();
}
...@@ -1370,6 +1370,15 @@ asmlinkage __visible void __init xen_start_kernel(void) ...@@ -1370,6 +1370,15 @@ asmlinkage __visible void __init xen_start_kernel(void)
x86_init.mpparse.get_smp_config = x86_init_uint_noop; x86_init.mpparse.get_smp_config = x86_init_uint_noop;
xen_boot_params_init_edd(); xen_boot_params_init_edd();
#ifdef CONFIG_ACPI
/*
* Disable selecting "Firmware First mode" for correctable
* memory errors, as this is the duty of the hypervisor to
* decide.
*/
acpi_disable_cmcff = 1;
#endif
} }
if (!boot_params.screen_info.orig_video_isVGA) if (!boot_params.screen_info.orig_video_isVGA)
......
...@@ -1142,7 +1142,7 @@ static void __init xen_pagetable_p2m_free(void) ...@@ -1142,7 +1142,7 @@ static void __init xen_pagetable_p2m_free(void)
* We could be in __ka space. * We could be in __ka space.
* We roundup to the PMD, which means that if anybody at this stage is * We roundup to the PMD, which means that if anybody at this stage is
* using the __ka address of xen_start_info or * using the __ka address of xen_start_info or
* xen_start_info->shared_info they are in going to crash. Fortunatly * xen_start_info->shared_info they are in going to crash. Fortunately
* we have already revectored in xen_setup_kernel_pagetable. * we have already revectored in xen_setup_kernel_pagetable.
*/ */
size = roundup(size, PMD_SIZE); size = roundup(size, PMD_SIZE);
......
...@@ -720,17 +720,18 @@ struct gntdev_copy_batch { ...@@ -720,17 +720,18 @@ struct gntdev_copy_batch {
s16 __user *status[GNTDEV_COPY_BATCH]; s16 __user *status[GNTDEV_COPY_BATCH];
unsigned int nr_ops; unsigned int nr_ops;
unsigned int nr_pages; unsigned int nr_pages;
bool writeable;
}; };
static int gntdev_get_page(struct gntdev_copy_batch *batch, void __user *virt, static int gntdev_get_page(struct gntdev_copy_batch *batch, void __user *virt,
bool writeable, unsigned long *gfn) unsigned long *gfn)
{ {
unsigned long addr = (unsigned long)virt; unsigned long addr = (unsigned long)virt;
struct page *page; struct page *page;
unsigned long xen_pfn; unsigned long xen_pfn;
int ret; int ret;
ret = get_user_pages_fast(addr, 1, writeable ? FOLL_WRITE : 0, &page); ret = pin_user_pages_fast(addr, 1, batch->writeable ? FOLL_WRITE : 0, &page);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -744,11 +745,9 @@ static int gntdev_get_page(struct gntdev_copy_batch *batch, void __user *virt, ...@@ -744,11 +745,9 @@ static int gntdev_get_page(struct gntdev_copy_batch *batch, void __user *virt,
static void gntdev_put_pages(struct gntdev_copy_batch *batch) static void gntdev_put_pages(struct gntdev_copy_batch *batch)
{ {
unsigned int i; unpin_user_pages_dirty_lock(batch->pages, batch->nr_pages, batch->writeable);
for (i = 0; i < batch->nr_pages; i++)
put_page(batch->pages[i]);
batch->nr_pages = 0; batch->nr_pages = 0;
batch->writeable = false;
} }
static int gntdev_copy(struct gntdev_copy_batch *batch) static int gntdev_copy(struct gntdev_copy_batch *batch)
...@@ -837,8 +836,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch, ...@@ -837,8 +836,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch,
virt = seg->source.virt + copied; virt = seg->source.virt + copied;
off = (unsigned long)virt & ~XEN_PAGE_MASK; off = (unsigned long)virt & ~XEN_PAGE_MASK;
len = min(len, (size_t)XEN_PAGE_SIZE - off); len = min(len, (size_t)XEN_PAGE_SIZE - off);
batch->writeable = false;
ret = gntdev_get_page(batch, virt, false, &gfn); ret = gntdev_get_page(batch, virt, &gfn);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -856,8 +856,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch, ...@@ -856,8 +856,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch,
virt = seg->dest.virt + copied; virt = seg->dest.virt + copied;
off = (unsigned long)virt & ~XEN_PAGE_MASK; off = (unsigned long)virt & ~XEN_PAGE_MASK;
len = min(len, (size_t)XEN_PAGE_SIZE - off); len = min(len, (size_t)XEN_PAGE_SIZE - off);
batch->writeable = true;
ret = gntdev_get_page(batch, virt, true, &gfn); ret = gntdev_get_page(batch, virt, &gfn);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -371,7 +371,7 @@ static int alloc_active_ring(struct sock_mapping *map) ...@@ -371,7 +371,7 @@ static int alloc_active_ring(struct sock_mapping *map)
static int create_active(struct sock_mapping *map, evtchn_port_t *evtchn) static int create_active(struct sock_mapping *map, evtchn_port_t *evtchn)
{ {
void *bytes; void *bytes;
int ret = -ENOMEM, irq = -1, i; int ret, irq = -1, i;
*evtchn = 0; *evtchn = 0;
init_waitqueue_head(&map->active.inflight_conn_req); init_waitqueue_head(&map->active.inflight_conn_req);
......
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