>>> On 19.05.11 at 21:06, Olaf Hering <olaf@xxxxxxxxx> wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@xxxxxxxxx>
> # Date 1305824433 -7200
> # Node ID 9c4ff80169706c948442799f82c15cc65ad403c8
> # Parent f64bb486b83ccefb1e1352db56f898b8272ad56d
> gcc-4.6 compile fix: xen/arch/x86/traps.c
>
> traps.c: In function 'emulate_privileged_op':
> traps.c:1742:48: error: variable 'lm_ovr' set but not used
> [-Werror=unused-but-set-variable]
Instead of these many #ifdef-s, wouldn't just adding (void)lm_ovr
somewhere work too?
Jan
> Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
>
> diff -r f64bb486b83c -r 9c4ff8016970 xen/arch/x86/traps.c
> --- a/xen/arch/x86/traps.c Thu May 19 19:00:32 2011 +0200
> +++ b/xen/arch/x86/traps.c Thu May 19 19:00:33 2011 +0200
> @@ -1739,7 +1739,9 @@ static int emulate_privileged_op(struct
> struct vcpu *v = current;
> unsigned long *reg, eip = regs->eip;
> u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0, lock = 0, rex =
> 0;
> +#ifdef CONFIG_X86_64
> enum { lm_seg_none, lm_seg_fs, lm_seg_gs } lm_ovr = lm_seg_none;
> +#endif
> int rc;
> unsigned int port, i, data_sel, ar, data, bpmatch = 0;
> unsigned int op_bytes, op_default, ad_bytes, ad_default, opsize_prefix=
> 0;
> @@ -1795,11 +1797,15 @@ static int emulate_privileged_op(struct
> continue;
> case 0x64: /* FS override */
> data_sel = read_sreg(regs, fs);
> +#ifdef CONFIG_X86_64
> lm_ovr = lm_seg_fs;
> +#endif
> continue;
> case 0x65: /* GS override */
> data_sel = read_sreg(regs, gs);
> +#ifdef CONFIG_X86_64
> lm_ovr = lm_seg_gs;
> +#endif
> continue;
> case 0x36: /* SS override */
> data_sel = regs->ss;
> @@ -1846,7 +1852,9 @@ static int emulate_privileged_op(struct
> if ( !(opcode & 2) )
> {
> data_sel = read_sreg(regs, es);
> +#ifdef CONFIG_X86_64
> lm_ovr = lm_seg_none;
> +#endif
> }
>
> if ( !(ar & _SEGMENT_L) )
>
> _______________________________________________
> 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
|