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

Re: [Xen-devel] Hvmloader: Modify ACPI to only supply _EJ0 methods for PCIslots that support hotplug by runtime patching



>>> On 16.10.13 at 08:30, "Gonglei (Arei)" <arei.gonglei@xxxxxxxxxx> wrote:
> --- hvmloader/acpi/Makefile   2013-10-16 11:51:53.000000000 +0800
> +++ hvmloader_new//acpi/Makefile      2013-10-16 11:51:58.000000000 +0800
> @@ -36,18 +36,34 @@
>  
>  dsdt_anycpu_qemu_xen.asl: dsdt.asl mk_dsdt
>       awk 'NR > 1 {print s} {s=$$0}' $< > $@
> -     ./mk_dsdt --dm-version qemu-xen >> $@
> +     sed -i 's/AmlCode/dsdt_anycpu_qemu_xen/g' $@

This must never be done - if someone hits Ctrl-C in the middle of
this, you'll have a modified but incomplete generated file. You
either need to use properly chained rules, or do all output to a
temporary file which you rename as the last step.

I realize that the problem existed before your change, but you
making it worse requires doing it properly now.

> +     ./mk_dsdt --dm-version qemu-xen >> $@   
> +     sed -i 's/aml_ej0_name/dsdt_anycpu_qemu_xen_aml_ej0_name/g' $@
> +     sed -i 's/aml_adr_dword/dsdt_anycpu_qemu_xen_aml_adr_dword/g' $@
>  
>  # NB. awk invocation is a portable alternative to 'head -n -1'
>  dsdt_%cpu.asl: dsdt.asl mk_dsdt
>       awk 'NR > 1 {print s} {s=$$0}' $< > $@
> +     sed -i 's/AmlCode/dsdt_$*cpu/g' $@
>       ./mk_dsdt --maxcpu $*  >> $@
>  
>  $(filter dsdt_%.c,$(C_SRC)): %.c: iasl %.asl
> -     iasl -vs -p $* -tc $*.asl
> -     sed -e 's/AmlCode/$*/g' $*.hex >$@
> +     cpp -P $*.asl > $*.asl.i.orig
> +     /usr/bin/python ../tools/acpi_extract_preprocess.py $*.asl.i.orig > 
> $*.asl.i
> +     iasl -vs -l -tc -p $* $*.asl.i
> +     /usr/bin/python ../tools/acpi_extract.py $*.lst > $@
>       echo "int $*_len=sizeof($*);" >>$@
> -     rm -f $*.aml $*.hex
> +     rm -f $*.aml $*.hex $*.asl.i.orig $*.asl.i $*.lst
> +
> +dsdt_anycpu_qemu_xen.c:iasl dsdt_anycpu_qemu_xen.asl
> +     cpp -P $*.asl > $*.asl.i.orig
> +     /usr/bin/python ../tools/acpi_extract_preprocess.py $*.asl.i.orig > 
> $*.asl.i
> +     iasl -vs -l -tc -p $* $*.asl.i
> +     /usr/bin/python ../tools/acpi_extract.py $*.lst > $@
> +     echo "int $*_len=sizeof($*);" >>$@
> +     echo "int $*_aml_ej0_name_len=sizeof($*_aml_ej0_name);" >>$@
> +     echo "int $*_aml_adr_dword_len=sizeof($*_aml_adr_dword);" >>$@

Why is this needed only here, but not in the generic .asl -> .c rule?
Keeping a single, generic rule would be preferred even if the
generated data isn't used for the other cases.

Also, please generate you patches with -p passed to diff (or a
suitable equivalent if you use some other mechanism for
generating it).

Jan


_______________________________________________
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®.