xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Egger <Christoph.Egger@amd.com>
To: Tim Deegan <tim@xen.org>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH 4 of 7 v2] x86: fix memset(ptr, 0, sizeof ptr)
Date: Tue, 10 Apr 2012 12:08:50 +0200	[thread overview]
Message-ID: <4F8406B2.6090001@amd.com> (raw)
In-Reply-To: <a93381049790e4f8a02f.1333641113@whitby.uk.xensource.com>

On 04/05/12 17:51, Tim Deegan wrote:
> # HG changeset patch
> # User Tim Deegan<tim@xen.org>
> # Date 1333640955 -3600
> # Node ID a93381049790e4f8a02f2322851f78175c254c5b
> # Parent  4674ce03c62a3e916954fd445b4510ffe72e64f4
> x86: fix memset(ptr, 0, sizeof ptr).
>
> Signed-off-by: Tim Deegan<tim@xen.org>

Acked-by: Christoph Egger <Christoph.Egger@amd.com>

>
> diff -r 4674ce03c62a -r a93381049790 xen/arch/x86/cpu/mcheck/amd_f10.c
> --- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Thu Apr 05 16:49:15 2012 +0100
> +++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Thu Apr 05 16:49:15 2012 +0100
> @@ -73,9 +73,9 @@ amd_f10_handler(struct mc_info *mi, uint
>   		return NULL;
>   	}
>
> -	memset(mc_ext, 0, sizeof(mc_ext));
> +	memset(mc_ext, 0, sizeof(*mc_ext));
>   	mc_ext->common.type = MC_TYPE_EXTENDED;
> -	mc_ext->common.size = sizeof(mc_ext);
> +	mc_ext->common.size = sizeof(*mc_ext);
>   	mc_ext->mc_msrs = 3;
>
>   	mc_ext->mc_msr[0].reg = MSR_F10_MC4_MISC1;
> diff -r 4674ce03c62a -r a93381049790 xen/arch/x86/mm/p2m.c
> --- a/xen/arch/x86/mm/p2m.c	Thu Apr 05 16:49:15 2012 +0100
> +++ b/xen/arch/x86/mm/p2m.c	Thu Apr 05 16:49:15 2012 +0100
> @@ -1232,11 +1232,10 @@ bool_t p2m_mem_access_check(unsigned lon
>       }
>
>       *req_ptr = NULL;
> -    req = xmalloc(mem_event_request_t);
> +    req = xzalloc(mem_event_request_t);
>       if ( req )
>       {
>           *req_ptr = req;
> -        memset(req, 0, sizeof(req));
>           req->reason = MEM_EVENT_REASON_VIOLATION;
>
>           /* Pause the current VCPU */
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

  parent reply	other threads:[~2012-04-10 10:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 15:51 [PATCH 0 of 7 v2] Make xen build with clang/LLVM again Tim Deegan
2012-04-05 15:51 ` [PATCH 1 of 7 v2] xen: Add -Wno-unused-value to the clang CFLAGS Tim Deegan
2012-04-05 15:51 ` [PATCH 2 of 7 v2] x86/mm: Another couple of comparisons of unsigned vars with < 0 Tim Deegan
2012-04-05 15:51 ` [PATCH 3 of 7 v2] x86: fix logical ANDs used to mask bitfields Tim Deegan
2012-04-05 15:51 ` [PATCH 4 of 7 v2] x86: fix memset(ptr, 0, sizeof ptr) Tim Deegan
2012-04-10  7:41   ` Jan Beulich
2012-04-10 10:08   ` Christoph Egger [this message]
2012-04-05 15:51 ` [PATCH 5 of 7 v2] x86: don't use .subsection when compiling with clang Tim Deegan
2012-04-10  7:43   ` Jan Beulich
2012-04-05 15:51 ` [PATCH 6 of 7 v2] xen: define __section() and friends and use them for section annotations Tim Deegan
2012-04-05 15:51 ` [PATCH 7 of 7 v2] x86: explicitly mark __initdata variables as used when building with clang Tim Deegan
2012-04-10  7:46 ` [PATCH 0 of 7 v2] Make xen build with clang/LLVM again Jan Beulich
2012-04-10  9:08   ` Keir Fraser

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=4F8406B2.6090001@amd.com \
    --to=christoph.egger@amd.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).