[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] x86/pv: Use xmemdup() for cpuidmasks, rather than opencoding it



commit 3dd454c6c694409aaedd4ed075d6aeace2dd8391
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Aug 15 10:53:53 2018 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Aug 15 14:54:50 2018 +0100

    x86/pv: Use xmemdup() for cpuidmasks, rather than opencoding it
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/pv/domain.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 3230ac6a22..52108d4a83 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -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),
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.