From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [PATCH v5 13/17] xenctx: Add convert of more registers to symbols Date: Fri, 21 Mar 2014 08:34:55 -0400 Message-ID: <532C31EF.9010404@terremark.com> References: <1395342425-16260-1-git-send-email-dslutz@verizon.com> <1395342425-16260-14-git-send-email-dslutz@verizon.com> <532C218B0200007800126737@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <532C218B0200007800126737@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson , Don Slutz , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 03/21/14 06:24, Jan Beulich wrote: >>>> On 20.03.14 at 20:07, Don Slutz wrote: >> @@ -368,8 +380,11 @@ static void print_ctx_32(vcpu_guest_context_x86_32_t *ctx) >> printf(" gs: %04x\n", regs->gs); >> >> if (xenctx.disp_all) { >> - print_special(ctx->ctrlreg, "cr", 0x1d, 4); >> - print_special(ctx->debugreg, "dr", 0xcf, 4); >> + uint64_t cr_reg_mask[5] = {0, 0, ~0ULL}; >> + uint64_t dr_reg_mask[8] = {~0ULL, ~0ULL, ~0ULL, ~0ULL}; > So you've got a total of three of those. Why can't they be static > const at file scope, and be used in all three places? Looks like they can. > Also, using C99 (available as gcc extension) here may make this > a bit more legible: > > static const uint64_t cr_reg_mask[5] = { [2] = ~UINT64_C(0) }; > static const uint64_t dr_reg_mask[8] = { [0 ... 3] = ~UINT64_C(0) }; Will test that it works on CentOS 5.10 and a send a v6 of just this. -Don Slutz > Jan >