mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
hyperv/vmbus: Move vcpuid into vmbus softc per-cpu data
MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6521
This commit is contained in:
parent
95a45414a0
commit
14aa3e8097
4 changed files with 6 additions and 11 deletions
|
|
@ -32,7 +32,8 @@
|
|||
#include <sys/mbuf.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#include "hv_vmbus_priv.h"
|
||||
#include <dev/hyperv/vmbus/hv_vmbus_priv.h>
|
||||
#include <dev/hyperv/vmbus/vmbus_var.h>
|
||||
|
||||
/*
|
||||
* Internal functions
|
||||
|
|
@ -301,7 +302,7 @@ vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu)
|
|||
KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu %d", cpu));
|
||||
|
||||
chan->target_cpu = cpu;
|
||||
chan->target_vcpu = hv_vmbus_g_context.hv_vcpu_index[cpu];
|
||||
chan->target_vcpu = VMBUS_PCPU_GET(vmbus_get_softc(), vcpuid, cpu);
|
||||
|
||||
if (bootverbose) {
|
||||
printf("vmbus_chan%u: assigned to cpu%u [vcpu%u]\n",
|
||||
|
|
@ -744,7 +745,7 @@ vmbus_select_outgoing_channel(struct hv_vmbus_channel *primary)
|
|||
return outgoing_channel;
|
||||
}
|
||||
|
||||
cur_vcpu = hv_vmbus_g_context.hv_vcpu_index[smp_pro_id];
|
||||
cur_vcpu = VMBUS_PCPU_GET(vmbus_get_softc(), vcpuid, smp_pro_id);
|
||||
|
||||
TAILQ_FOREACH(new_channel, &primary->sc_list_anchor, sc_list_entry) {
|
||||
if (new_channel->state != HV_CHANNEL_OPENED_STATE){
|
||||
|
|
|
|||
|
|
@ -213,7 +213,6 @@ vmbus_synic_setup(void *arg __unused)
|
|||
{
|
||||
struct vmbus_softc *sc = vmbus_get_softc();
|
||||
int cpu;
|
||||
uint64_t hv_vcpu_index;
|
||||
hv_vmbus_synic_simp simp;
|
||||
hv_vmbus_synic_siefp siefp;
|
||||
hv_vmbus_synic_scontrol sctrl;
|
||||
|
|
@ -271,8 +270,7 @@ vmbus_synic_setup(void *arg __unused)
|
|||
* Set up the cpuid mapping from Hyper-V to FreeBSD.
|
||||
* The array is indexed using FreeBSD cpuid.
|
||||
*/
|
||||
hv_vcpu_index = rdmsr(HV_X64_MSR_VP_INDEX);
|
||||
hv_vmbus_g_context.hv_vcpu_index[cpu] = (uint32_t)hv_vcpu_index;
|
||||
VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(HV_X64_MSR_VP_INDEX);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -202,11 +202,6 @@ union vmbus_event_flags;
|
|||
|
||||
typedef struct {
|
||||
hv_bool_uint8_t syn_ic_initialized;
|
||||
|
||||
/*
|
||||
* For FreeBSD cpuid to Hyper-V vcpuid mapping.
|
||||
*/
|
||||
uint32_t hv_vcpu_index[MAXCPU];
|
||||
} hv_vmbus_context;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
struct vmbus_pcpu_data {
|
||||
u_long *intr_cnt; /* Hyper-V interrupt counter */
|
||||
struct vmbus_message *message; /* shared messages */
|
||||
uint32_t vcpuid; /* virtual cpuid */
|
||||
int event_flag_cnt; /* # of event flags */
|
||||
union vmbus_event_flags *event_flag; /* shared event flags */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue