From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUw0T-00046Z-MM for qemu-devel@nongnu.org; Mon, 09 Mar 2015 07:37:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUw0S-0000Qh-Ls for qemu-devel@nongnu.org; Mon, 09 Mar 2015 07:37:57 -0400 Message-ID: <54FD85F6.1000402@redhat.com> Date: Mon, 09 Mar 2015 13:37:26 +0200 From: Marcel Apfelbaum MIME-Version: 1.0 References: <1425813387-31231-1-git-send-email-marcel@redhat.com> <1425813387-31231-6-git-send-email-marcel@redhat.com> <20150309113957.0400875b@nial.brq.redhat.com> <20150309115907-mutt-send-email-mst@redhat.com> In-Reply-To: <20150309115907-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 for-2.3 05/25] acpi: add aml_index() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , Igor Mammedov Cc: quintela@redhat.com, seabios@seabios.org, agraf@suse.de, qemu-devel@nongnu.org, alex.williamson@redhat.com, kevin@koconnor.net, qemu-ppc@nongnu.org, kraxel@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, rth@twiddle.net, leon.alrae@imgtec.com, aurelien@aurel32.net, hare@suse.de On 03/09/2015 01:00 PM, Michael S. Tsirkin wrote: > On Mon, Mar 09, 2015 at 11:39:57AM +0100, Igor Mammedov wrote: >> On Sun, 8 Mar 2015 13:16:07 +0200 >> Marcel Apfelbaum wrote: >> >>> Add encoding for ACPI DefIndex Opcode. >>> >>> Signed-off-by: Marcel Apfelbaum >>> --- >>> hw/acpi/aml-build.c | 13 +++++++++++++ >>> include/hw/acpi/aml-build.h | 1 + >>> 2 files changed, 14 insertions(+) >>> >>> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c >>> index 49ba8c1..b3372df 100644 >>> --- a/hw/acpi/aml-build.c >>> +++ b/hw/acpi/aml-build.c >>> @@ -477,6 +477,19 @@ Aml *aml_add(Aml *arg1, Aml *arg2) >>> return var; >>> } >>> >>> +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefIndex */ >>> +Aml *aml_index(Aml *arg1, Aml *idx) >>> +{ >>> + Aml *var = aml_opcode(0x88 /* IndexOp */); >>> + >>> + g_assert(arg1->block_flags & (AML_PACKAGE | AML_EXT_PACKAGE | AML_BUFFER)); >> it couldn't be AML_EXT_PACKAGE, it's either a plain DefPackage or DefBuffer >> i.e. I'd suggest to add to above check also checking for >> specific opcodes arg1->op = 0x11 /* buffer */ ... >> >> Also a newer spec (>1.0b) allows to use DefString as argument as well. > > You really can have a lot of things there, e.g. a method call > will also work. > I think it's best to drop these asserts at this point, > and maybe blacklist specific bad configs down the road. OK, I'll drop the assert for now. Thanks, Marcel