Stefan Berger
2006-Nov-29 04:15 UTC
[Xen-devel] [PATCH] [HVMLOADER] built-in memcmp function uses not-yet implemented opcode
Keir, it seems like the acpi/build.c function now uses the gcc built-in memcmp function. Unfortunately that one seems to generate some code that hits a not-yet implemented/emulated opcode. Instead of implementing emultaion for that opcode I just copied the previously used memcmp function from util.c into the build.c and renamed it to _memcmp to avoid linking problems. (XEN) a6, This opcode isn''t handled yet! (XEN) handle_mmio: failed to decode instruction (XEN) mmio opcode: gpa 0xfed40f00, len 2: f3 a6 (XEN) domain_crash_sync called from platform.c:944 Signed-off-by: Stefan Berger <stefanb@us.ibm.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Nov-29 07:51 UTC
Re: [Xen-devel] [PATCH] [HVMLOADER] built-in memcmp function uses not-yet implemented opcode
On 29/11/06 4:15 am, "Stefan Berger" <stefanb@us.ibm.com> wrote:> it seems like the acpi/build.c function now uses the gcc built-in > memcmp function. Unfortunately that one seems to generate some code that > hits a not-yet implemented/emulated opcode. Instead of implementing > emultaion for that opcode I just copied the previously used memcmp > function from util.c into the build.c and renamed it to _memcmp to avoid > linking problems.There''s an easier fix. hvmloader/acpi/Makefile is missing -fno-builtin. I''ll apply a patch. Thanks, Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan Berger
2006-Nov-29 12:18 UTC
Re: [Xen-devel] [PATCH] [HVMLOADER] built-in memcmp function uses not-yet implemented opcode
xen-devel-bounces@lists.xensource.com wrote on 11/29/2006 02:51:50 AM:> On 29/11/06 4:15 am, "Stefan Berger" <stefanb@us.ibm.com> wrote: > > > it seems like the acpi/build.c function now uses the gcc built-in > > memcmp function. Unfortunately that one seems to generate some codethat> > hits a not-yet implemented/emulated opcode. Instead of implementing > > emultaion for that opcode I just copied the previously used memcmp > > function from util.c into the build.c and renamed it to _memcmp toavoid> > linking problems. > > There''s an easier fix. hvmloader/acpi/Makefile is missing -fno-builtin.I''ll> apply a patch.I had tried that, but it didn''t help, either, and memcmp got linked in. Maybe this fix here is ok? --- build.c 2006-11-29 07:12:51.000000000 -0500 +++ build.c.new 2006-11-29 00:21:38.000000000 -0500 @@ -116,6 +116,7 @@ int construct_secondary_tables(uint8_t * struct acpi_20_madt *madt; struct acpi_20_tcpa *tcpa; static const uint16_t tis_did_vid_rid[] = {0x0001, 0x0001, 0x0001}; + uint16_t *mem16; /* MADT. */ if ( (get_vcpu_nr() > 1) || get_apic_mode() ) @@ -126,8 +127,10 @@ int construct_secondary_tables(uint8_t * } /* TPM TCPA and SSDT. */ - if ( memcmp((char *)0xFED40F00, tis_did_vid_rid, - sizeof(tis_did_vid_rid)) == 0 ) /* Probe for TIS interface. */ + mem16 = (uint16_t *)0xFED40F00; + if (mem16[0] == tis_did_vid_rid[0] && + mem16[1] == tis_did_vid_rid[1] && + mem16[2] == tis_did_vid_rid[2]) { memcpy(&buf[offset], AmlCode_TPM, sizeof(AmlCode_TPM)); table_ptrs[nr_tables++] = (unsigned long)&buf[offset]; Stefan> > Thanks, > Keir > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel