[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 6/7] x86/shadow: Make _shadow_prealloc() compile at -Og


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 19 Apr 2021 15:01:31 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, "Jan Beulich" <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 19 Apr 2021 14:02:03 +0000
  • Ironport-hdrordr: A9a23:t6oF1qgSpEjUF7F8VFLowa1vMHBQXwh13DAbvn1ZSRFFG/Gwv9 yynfgdyB//gCsQXnZlotybJKycWxrnmKJdy4N5B9efdSPhv3alK5wn0Jv6z1TbaknD38N+9Y MlSahxD9XsEUN35PyR3CCUG8stqePpzImGnuHbpk0CcShPS4VNqzh0ERyaFEoefngiObMcGI CH7sRK4xqMEE5nDfiTPXUOU+jdq9CjrvuPDSIuPBI79BKIyQqh9b+SKXOl9y0DWDBCy6pKyx mmryXF4MyY0s2T+1vn+EL4q79Xn9bgzdUrPr3wtuElbg/CpyztSIBoW7iptC04rue1+D8R4a XxiiZlBetfwTf8eXy0vAvM1mDboUkTwk6n83C0qz/CptH0Xz0zAcYpv/MmTjLpr3AOkfs59Y Aj5RP/i7NnSSnusQ642v3zEzZtrUawqWpKq59ps1VvFbEwRZUUkZYS5ypuYfE9NRO/0q8LOs 90AvrR4f5HGGnqFUzxjy1UzNugUm9bJGb+fmEy/sic0z1hlHtk1UcvxMsGgnca9J4mIqM0n9 j5Dg==
  • Ironport-sdr: 4dw8FPQQdflBDRcafRhL0AdCLPex3/yZ9EWa56O9Ip9Lx67CF9Puw1pAF6geEP8bZYpRBLFagD EsRqPZHTaZGt0poXjK79QmTWY611BSqyBKPxwQVNz00N4ZC8TbwXPtKvXLJdQYaOAJdq1c3w2N BdUSskXTOvp9ormIvJY2RFppqJZko8MdrmOghVKlRYu90jU/QufkCWG05Tig5pCsCeymO9MLfR Ga34BGL+ZeB+xtr2nmbtAsVPFsn/6VEVal/O1nTKxjq1Ake/zQQSUpDPPEKY743ab6EOGIvHpf +VI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When compiling at -Og:

  In file included from
  /builds/xen-project/people/andyhhp/xen/xen/include/asm/domain.h:4:0,
                   from 
/builds/xen-project/people/andyhhp/xen/xen/include/xen/domain.h:8,
                   from 
/builds/xen-project/people/andyhhp/xen/xen/include/xen/sched.h:11,
                   from 
/builds/xen-project/people/andyhhp/xen/xen/include/xen/ioreq.h:22,
                   from common.c:23:
  common.c: In function '_shadow_prealloc':
  /builds/xen-project/people/andyhhp/xen/xen/include/xen/mm.h:252:55: error: 
't' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       return page != head->next ? pdx_to_page(page->list.prev) : NULL;
                                                         ^
  common.c:933:28: note: 't' was declared here
       struct page_info *sp, *t;
                              ^

I'm not certain the analysis is correct.  't' is a temporary variable, and is
clearly initialised before use in foreach_pinned_shadow().  Either way,
initialising it to NULL placates the compiler.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Tim Deegan <tim@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index b99ca14e71..737e6b365a 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -931,7 +931,7 @@ static inline void trace_shadow_prealloc_unpin(struct 
domain *d, mfn_t smfn)
 static void _shadow_prealloc(struct domain *d, unsigned int pages)
 {
     struct vcpu *v;
-    struct page_info *sp, *t;
+    struct page_info *sp, *t = NULL;
     mfn_t smfn;
     int i;
 
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.