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

[Xen-devel] Re: [Xen-changelog] [xen-unstable] tboot: fix tboot memory m

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [Xen-changelog] [xen-unstable] tboot: fix tboot memory mapping for 32b
From: Mark Johnson <johnson.nh@xxxxxxxxx>
Date: Tue, 22 Sep 2009 07:34:38 -0400
Delivery-date: Tue, 22 Sep 2009 04:34:59 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ezNeiYZ3LvLNc+AYNPwKXcA2ftAvPqIEQjbH1kFTuOY=; b=XhXMm5ounBJ4BBAedG2ci54e1P2mYwcPSWltxgCOzFvegZPldIukfxcIbcOUuznlsj rq1QL27CaKdQhfGTStUhjTulQn9M8XrBQRY7yjkIHoes0hU7NJo5nDU2+cCHkF9CBPnQ pN0JgjVWMu7prVBeThPDULH2ZfmL6T0wJopmE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gRuj8Eq2vwq+UkyzdQNGZ0e+g1rPBUfmq56DZCATMpvIjw0yIyy93iqUcBGcdQnIjE bpJf8s8LJvOyjphLt8kqaLTA/o/1Ai5ABu3sjkxuH9pK6cytyqw95pUTITCggInxY/us 0ek1DrkWZc7cBKeHRNOtsU6S/77D2GSdWX+jk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200909220825.n8M8PX4R018629@xxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200909220825.n8M8PX4R018629@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, Sep 22, 2009 at 4:25 AM, Xen patchbot-unstable
<patchbot-unstable@xxxxxxxxxxxxxxxxxxx> wrote:
> # HG changeset patch
> # User Keir Fraser <keir.fraser@xxxxxxxxxx>
> # Date 1253605000 -3600
> # Node ID bcb6b95b30b13efa9635f8b8e1b7ff57c50dae3d
> # Parent  be747c582738035889d5f3f9d40051818e1af50e
> tboot: fix tboot memory mapping for 32b
>
> This patch used fixmap to get TXT heap base/size and SINIT base/size
> from TXT pub config registers (whose address starts from 0xfed20000),
> and get DMAR table copy from TXT heap (whose address may start from
> 0x7d520000) for tboot, instead of using map_pages_to_xen(), which will
> cause panic on x86_32.
>
> Signed-off-by: Shane Wang <shane.wang@xxxxxxxxx>
> ---
>  xen/arch/x86/tboot.c         |   94 
> ++++++++++++++++++++++++-------------------
>  xen/include/asm-x86/fixmap.h |    1
>  2 files changed, 54 insertions(+), 41 deletions(-)
>
> diff -r be747c582738 -r bcb6b95b30b1 xen/arch/x86/tboot.c
> --- a/xen/arch/x86/tboot.c      Tue Sep 22 08:28:26 2009 +0100
> +++ b/xen/arch/x86/tboot.c      Tue Sep 22 08:36:40 2009 +0100
> @@ -69,12 +69,29 @@ typedef struct __packed {
>     uint32_t     vtd_dmars_off;
>  } sinit_mle_data_t;
>
> +static void tboot_copy_memory(unsigned char *va, uint32_t size,
> +                              unsigned long pa)
> +{
> +    uint32_t map_base;
> +    unsigned long map_addr;
> +    int i;
> +
> +    map_base = 0;
> +    for (i = 0; i < size; i++) {
> +        if ( map_base != PFN_DOWN(pa + i) ) {
> +            map_base = PFN_DOWN(pa + i);
> +            set_fixmap(FIX_TBOOT_MAP_ADDRESS, map_base << PAGE_SHIFT);
> +            map_addr = (unsigned long)fix_to_virt(FIX_TBOOT_MAP_ADDRESS);
> +        }
> +        *(va + i) = *(unsigned char *)(map_addr + pa + i
> +                                       - (map_base << PAGE_SHIFT));
> +    }
> +}
> +

I see the following error with this change..

tboot.c: In function `tboot_copy_memory':
tboot.c:76: warning: 'map_addr' might be used uninitialized in this function
gmake[5]: *** [tboot.o] Error 1



MRJ

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Re: [Xen-changelog] [xen-unstable] tboot: fix tboot memory mapping for 32b, Mark Johnson <=