It turns out that these are unused, and we dup a type-dependent block of
zeros. Use xzalloc() instead.
Read/write MSRs typically default 0, and non-zero defaults would need dealing
with at suitable INIT/RESET points (e.g. arch_vcpu_regs_init).
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
__read_mostly hvm_max_msr_policy,
__read_mostly pv_max_msr_policy;
-struct vcpu_msrs __read_mostly hvm_max_vcpu_msrs,
- __read_mostly pv_max_vcpu_msrs;
-
static void __init calculate_raw_policy(void)
{
/* 0x000000ce MSR_INTEL_PLATFORM_INFO */
int init_vcpu_msr_policy(struct vcpu *v)
{
- struct domain *d = v->domain;
- struct vcpu_msrs *msrs =
- xmemdup(is_pv_domain(d) ? &pv_max_vcpu_msrs
- : &hvm_max_vcpu_msrs);
+ struct vcpu_msrs *msrs = xzalloc(struct vcpu_msrs);
if ( !msrs )
return -ENOMEM;