public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Alex Williamson <alex.williamson@hp.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] bios: Makefile ACPI DSDT generation
Date: Sun, 22 Jun 2008 09:16:02 +0300	[thread overview]
Message-ID: <485DEE22.8090008@qumranet.com> (raw)
In-Reply-To: <1213846162.17626.15.camel@lappy>

Alex Williamson wrote:
> Hi Avi,
>
> This builds on your preprocessor work for cleaning up the DSDT and makes
> it trivially easy to change the CPU and PCI hotplug slot count.  I'm
> thinking about splitting a few SSDTs out of the monolithic DSDT, and
> generating some of the code at compile time should make that easier.
> This generates the same ASL after the preprocessor as current code.
> BTW, isn't \_PR.PRU & \_PR.PRD too small for hotplug'ing more than 8
> CPUs?  Let me know what you think.  Thanks,
>
> 	Alex
>
>
>
> kvm: bios: generate cpu and pci hotplug objects at compile time
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
> --
>
> diff --git a/bios/Makefile b/bios/Makefile
> index 48022ea..8ca5482 100644
> --- a/bios/Makefile
> +++ b/bios/Makefile
> @@ -22,6 +22,9 @@
>  
>  # Makefile for the BIOS component of bochs
>  
> +max_cpus ?= 16
> +max_pci_slots ?= 32
> +win2k_cpu_limit ?= y
>   

I don't particularly like random environment variables influencing the 
build.  This should be part of ./configure.

>  
>  
> +acpi-dsdt-processor.gen:
> +	rm -f $@;
> +	last=`expr $(max_cpus) - 1`;					\
> +	if [ "$(win2k_cpu_limit)" = "y" ] && [ $$last -gt 14 ]; then	\
> +		last=14;						\
> +	fi;								\
> +	for i in `seq 1 $$last`; do					\
> +		echo "gen_processor($$i, `printf "%X" $$i`)" >> $@;	\
> +	done
> +
> +acpi-dsdt-cpu-hotplug.gen:
> +	rm -f $@;
> +	last=`expr $(max_cpus) - 1`;					\
> +	if [ "$(win2k_cpu_limit)" = "y" ] && [ $$last -gt 14 ]; then	\
> +		last=14;						\
> +	fi;								\
> +	for i in `seq 1 $$last`; do					\
> +		echo "gen_cpu_hotplug($$i, `printf "%X" $$i`)" >> $@;	\
> +	done
> +
> +acpi-dsdt-prt-slot.gen:
> +	rm -f $@;
> +	last=`expr $(max_pci_slots) - 1`;				\
> +	for i in `seq 0 4 $$last`; do					\
> +		echo "prt_slot0(`printf "0x%04x" $$i`)," >> $@;		\
> +		next=`expr $$i + 1`;					\
> +		echo "prt_slot1(`printf "0x%04x" $$next`)," >> $@;	\
> +		next=`expr $$i + 2`;					\
> +		echo "prt_slot2(`printf "0x%04x" $$next`)," >> $@;	\
> +		next=`expr $$i + 3`;					\
> +		echo "prt_slot3(`printf "0x%04x" $$next`)," >> $@;	\
> +	done
> +
> +acpi-dsdt-hotplug-slot.gen:
> +	rm -f $@;
> +	last=`expr $(max_pci_slots) - 1`;				\
> +	for i in `seq 1 $$last`; do					\
> +		echo "hotplug_slot($$i, `printf "0x%04x" $$i`)" >> $@;	\
> +	done
> +
> +acpi-dsdt-pci-hotplug.gen:
> +	rm -f $@;
> +	last=`expr $(max_pci_slots) - 1`;				\
> +	for i in `seq 1 $$last`; do					\
> +		echo "gen_pci_hotplug($$i)" >> $@;			\
> +	done
> +
>   

Moving so much code into the Makefile isn't so pretty either.  I 
considered using a preprocessor other than cpp, but then nobody knows 
how to work with things like m4.

Ideas, anyone?

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


      parent reply	other threads:[~2008-06-22  6:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19  3:29 [PATCH] bios: Makefile ACPI DSDT generation Alex Williamson
2008-06-19  5:02 ` Marcelo Tosatti
2008-06-22  6:16 ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485DEE22.8090008@qumranet.com \
    --to=avi@qumranet.com \
    --cc=alex.williamson@hp.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox