x86/pv: Use xmemdup() for cpuidmasks, rather than opencoding it
PATCH 1/1 x86/pv: Use xmemdup() for cpuidmasks, rather than opencoding it
Signed-off-by Andrew Cooper <[email protected]>
---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>
--- xen/arch/x86/pv/domain.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
xen/arch/x86/pv/domain.c +3 -7
@@ -240,13 +240,9 @@ int pv_domain_initialise(struct domain *d) goto fail;clear_page (d->arch.pv_domain.gdt_ldt_l1tab); -if ( levelling_caps & ~LCAP_faulting ) - { - d->arch.pv_domain.cpuidmasks = xmalloc(struct cpuidmasks); -if ( !d->arch.pv_domain.cpuidmasks ) - goto fail; - *d->arch.pv_domain.cpuidmasks = cpuidmask_defaults; - } +if ( levelling_caps & ~LCAP_faulting && + (d->arch.pv_domain.cpuidmasks =xmemdup (&cpuidmask_defaults)) ==NULL ) + goto fail; rc = create_perdomain_mapping(d, GDT_LDT_VIRT_START, GDT_LDT_MBYTES << (20 - PAGE_SHIFT),
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 1 line · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>
Reviewed-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Jan Beulich
Acked-byQuoted 5 lines
Quoted 1 line
Quoted 1 line · On 15.08.18 at 11:58, <[email protected]> wrote:
Quoted 1 line · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>Reviewed-by Wei Liu <[email protected]>
Acked-by Jan Beulich <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 1 line · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>
Reviewed-by Roger Pau Monné <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel