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

[Xen-changelog] [xen master] xen/arm: alternative: Clean-up __apply_alternatives



commit 24e1dea03aa23adc1b700ddc9a0fbc20ccf45ffa
Author:     Julien Grall <julien.grall@xxxxxxx>
AuthorDate: Fri Sep 9 09:40:07 2016 +0100
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CommitDate: Fri Sep 9 11:47:36 2016 -0400

    xen/arm: alternative: Clean-up __apply_alternatives
    
    This patch contains only renaming and comment update. There are no
    functional changes:
        - Don't mix _start and _stext, they both point to the same address
        but the former makes more sense (we are mapping the Xen binary, not
        only the text section).
        - s/text_mfn/xen_mfn/ and s/text_order/xen_order/ to make clear that
        we map the Xen binary.
        - Mention about inittext as alternative may patch this section.
        - Use 1U instead of 1 in shift
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
---
 xen/arch/arm/alternative.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c
index 8ee5a11..bd7d409 100644
--- a/xen/arch/arm/alternative.c
+++ b/xen/arch/arm/alternative.c
@@ -99,21 +99,21 @@ static int __apply_alternatives(const struct alt_region 
*region)
     const struct alt_instr *alt;
     const u32 *origptr, *replptr;
     u32 *writeptr, *writemap;
-    mfn_t text_mfn = _mfn(virt_to_mfn(_stext));
-    unsigned int text_order = get_order_from_bytes(_end - _start);
+    mfn_t xen_mfn = _mfn(virt_to_mfn(_start));
+    unsigned int xen_order = get_order_from_bytes(_end - _start);
 
     printk(XENLOG_INFO "alternatives: Patching kernel code\n");
 
     /*
-     * The text section is read-only. So re-map Xen to be able to patch
-     * the code.
+     * The text and inittext section are read-only. So re-map Xen to be
+     * able to patch the code.
      */
-    writemap = __vmap(&text_mfn, 1 << text_order, 1, 1, PAGE_HYPERVISOR,
+    writemap = __vmap(&xen_mfn, 1U << xen_order, 1, 1, PAGE_HYPERVISOR,
                       VMAP_DEFAULT);
     if ( !writemap )
     {
         printk(XENLOG_ERR "alternatives: Unable to map the text section (size 
%u)\n",
-               1 << text_order);
+               1 << xen_order);
         return -ENOMEM;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.