From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v3 11/23] xsplice: Add support for alternatives Date: Tue, 16 Feb 2016 19:41:40 +0000 Message-ID: <56C37B74.4050301@citrix.com> References: <1455300361-13092-1-git-send-email-konrad.wilk@oracle.com> <1455300361-13092-12-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1455300361-13092-12-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk , xen-devel@lists.xenproject.org, konrad@kernel.org, mpohlack@amazon.de, ross.lagerwall@citrix.com, jinsong.liu@alibaba-inc.com, Keir Fraser , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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