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

Re: [Xen-devel] [PATCH v3 11/23] xsplice: Add support for alternatives



On 12/02/16 18:05, Konrad Rzeszutek Wilk wrote:
> diff --git a/xen/common/xsplice.c b/xen/common/xsplice.c
> index d863a99..65b1f11 100644
> --- a/xen/common/xsplice.c
> +++ b/xen/common/xsplice.c
> @@ -695,7 +695,7 @@ static int find_special_sections(struct payload *payload,
>      if ( sec )
>      {
>          if ( ( !sec->sec->sh_size ) ||
> -             ( sec->sec->sh_size % sizeof *sec->load_addr ) )
> +             ( sec->sec->sh_size % sizeof (struct exception_table_entry) ) )

This hunk looks like it wants to be in the previous patch.

>              return -EINVAL;
>  
>          payload->start_ex_table = (struct exception_table_entry 
> *)sec->load_addr;
> @@ -703,6 +703,14 @@ static int find_special_sections(struct payload *payload,
>  
>          sort_exception_table(payload->start_ex_table, 
> payload->stop_ex_table);
>      }
> +    sec = xsplice_elf_sec_by_name(elf, ".altinstructions");
> +    if ( sec )
> +    {
> +        local_irq_disable();
> +        apply_alternatives((struct alt_instr *)sec->load_addr,
> +                           (struct alt_instr *)(sec->load_addr + 
> sec->sec->sh_size));
> +        local_irq_enable();
> +    }

None of that code is active, and it can't be made active at this point. 
Interrupts absolutely shouldn't be disabled here.  Instead, the
assertion in apply_alternatives() should be modified as you are adding a
new valid usecase.

Also, modifications like this in a function named
find_special_sections() seem wrong.  It looks like the function would be
better named prepare_payload() or similar.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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