WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] [HVMLOADER] built-in memcmp function uses not-ye

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] [HVMLOADER] built-in memcmp function uses not-yet implemented opcode
From: Stefan Berger <stefanb@xxxxxxxxxx>
Date: Wed, 29 Nov 2006 07:18:38 -0500
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, keir@xxxxxxxxxxxxx
Delivery-date: Wed, 29 Nov 2006 04:18:08 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C192EC96.5014%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

xen-devel-bounces@xxxxxxxxxxxxxxxxxxx wrote on 11/29/2006 02:51:50 AM:

> On 29/11/06 4:15 am, "Stefan Berger" <stefanb@xxxxxxxxxx> 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.


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@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>