Commit f73f047d authored by Linus Torvalds's avatar Linus Torvalds

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

Pull xen fixes from Juergen Gross:

 - fixes for the Xen pvcalls frontend driver

 - fix for booting Xen pv domains

 - fix for the xenbus driver user interface

* tag 'for-linus-4.16a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  pvcalls-front: wait for other operations to return when release passive sockets
  pvcalls-front: introduce a per sock_mapping refcount
  x86/xen: Calculate __max_logical_packages on PV domains
  xenbus: track caller request id
parents 1e3510b2 d1a75e08
...@@ -129,6 +129,7 @@ static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask) ...@@ -129,6 +129,7 @@ static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)
void cpu_disable_common(void); void cpu_disable_common(void);
void native_smp_prepare_boot_cpu(void); void native_smp_prepare_boot_cpu(void);
void native_smp_prepare_cpus(unsigned int max_cpus); void native_smp_prepare_cpus(unsigned int max_cpus);
void calculate_max_logical_packages(void);
void native_smp_cpus_done(unsigned int max_cpus); void native_smp_cpus_done(unsigned int max_cpus);
void common_cpu_up(unsigned int cpunum, struct task_struct *tidle); void common_cpu_up(unsigned int cpunum, struct task_struct *tidle);
int native_cpu_up(unsigned int cpunum, struct task_struct *tidle); int native_cpu_up(unsigned int cpunum, struct task_struct *tidle);
......
...@@ -1281,11 +1281,10 @@ void __init native_smp_prepare_boot_cpu(void) ...@@ -1281,11 +1281,10 @@ void __init native_smp_prepare_boot_cpu(void)
cpu_set_state_online(me); cpu_set_state_online(me);
} }
void __init native_smp_cpus_done(unsigned int max_cpus) void __init calculate_max_logical_packages(void)
{ {
int ncpus; int ncpus;
pr_debug("Boot done\n");
/* /*
* Today neither Intel nor AMD support heterogenous systems so * Today neither Intel nor AMD support heterogenous systems so
* extrapolate the boot cpu's data to all packages. * extrapolate the boot cpu's data to all packages.
...@@ -1293,6 +1292,13 @@ void __init native_smp_cpus_done(unsigned int max_cpus) ...@@ -1293,6 +1292,13 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
ncpus = cpu_data(0).booted_cores * topology_max_smt_threads(); ncpus = cpu_data(0).booted_cores * topology_max_smt_threads();
__max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus);
pr_info("Max logical packages: %u\n", __max_logical_packages); pr_info("Max logical packages: %u\n", __max_logical_packages);
}
void __init native_smp_cpus_done(unsigned int max_cpus)
{
pr_debug("Boot done\n");
calculate_max_logical_packages();
if (x86_has_numa_in_package) if (x86_has_numa_in_package)
set_sched_topology(x86_numa_in_package_topology); set_sched_topology(x86_numa_in_package_topology);
......
...@@ -122,6 +122,8 @@ void __init xen_smp_cpus_done(unsigned int max_cpus) ...@@ -122,6 +122,8 @@ void __init xen_smp_cpus_done(unsigned int max_cpus)
if (xen_hvm_domain()) if (xen_hvm_domain())
native_smp_cpus_done(max_cpus); native_smp_cpus_done(max_cpus);
else
calculate_max_logical_packages();
if (xen_have_vcpu_info_placement) if (xen_have_vcpu_info_placement)
return; return;
......
This diff is collapsed.
...@@ -76,6 +76,7 @@ struct xb_req_data { ...@@ -76,6 +76,7 @@ struct xb_req_data {
struct list_head list; struct list_head list;
wait_queue_head_t wq; wait_queue_head_t wq;
struct xsd_sockmsg msg; struct xsd_sockmsg msg;
uint32_t caller_req_id;
enum xsd_sockmsg_type type; enum xsd_sockmsg_type type;
char *body; char *body;
const struct kvec *vec; const struct kvec *vec;
......
...@@ -309,6 +309,7 @@ static int process_msg(void) ...@@ -309,6 +309,7 @@ static int process_msg(void)
goto out; goto out;
if (req->state == xb_req_state_wait_reply) { if (req->state == xb_req_state_wait_reply) {
req->msg.req_id = req->caller_req_id;
req->msg.type = state.msg.type; req->msg.type = state.msg.type;
req->msg.len = state.msg.len; req->msg.len = state.msg.len;
req->body = state.body; req->body = state.body;
......
...@@ -227,6 +227,8 @@ static void xs_send(struct xb_req_data *req, struct xsd_sockmsg *msg) ...@@ -227,6 +227,8 @@ static void xs_send(struct xb_req_data *req, struct xsd_sockmsg *msg)
req->state = xb_req_state_queued; req->state = xb_req_state_queued;
init_waitqueue_head(&req->wq); init_waitqueue_head(&req->wq);
/* Save the caller req_id and restore it later in the reply */
req->caller_req_id = req->msg.req_id;
req->msg.req_id = xs_request_enter(req); req->msg.req_id = xs_request_enter(req);
mutex_lock(&xb_write_mutex); mutex_lock(&xb_write_mutex);
...@@ -310,6 +312,7 @@ static void *xs_talkv(struct xenbus_transaction t, ...@@ -310,6 +312,7 @@ static void *xs_talkv(struct xenbus_transaction t,
req->num_vecs = num_vecs; req->num_vecs = num_vecs;
req->cb = xs_wake_up; req->cb = xs_wake_up;
msg.req_id = 0;
msg.tx_id = t.id; msg.tx_id = t.id;
msg.type = type; msg.type = type;
msg.len = 0; msg.len = 0;
......
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