From patchwork Wed Apr 24 17:07:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Nesterov X-Patchwork-Id: 239282 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E1EFC2C00EC for ; Thu, 25 Apr 2013 03:10:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756128Ab3DXRKc (ORCPT ); Wed, 24 Apr 2013 13:10:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755073Ab3DXRKb (ORCPT ); Wed, 24 Apr 2013 13:10:31 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3OH9vgI025543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Apr 2013 13:09:57 -0400 Received: from tranklukator.brq.redhat.com (dhcp-1-102.brq.redhat.com [10.34.1.102]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r3OH9riX030130; Wed, 24 Apr 2013 13:09:53 -0400 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Wed, 24 Apr 2013 19:07:06 +0200 (CEST) Date: Wed, 24 Apr 2013 19:07:02 +0200 From: Oleg Nesterov To: Ingo Molnar Cc: Linus Torvalds , Cyrill Gorcunov , Peter Zijlstra , "H. Peter Anvin" , Thomas Gleixner , David Miller , "Theodore Ts'o" , Linux Kernel Mailing List , the arch/x86 maintainers , Network Development , "linux-ext4@vger.kernel.org" , Fr??d??ric Weisbecker Subject: [PATCH] x86: make DR*_RESERVED unsigned long Message-ID: <20130424170702.GA1867@redhat.com> References: <20130424072630.GB1780@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130424072630.GB1780@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org DR6_RESERVED and DR_CONTROL_RESERVED are used to clear the set bits in the "unsigned long" data, make them long to ensure that "&~" doesn't clear the upper bits. do_debug() and ptrace_write_dr7() which use DR*_RESERVED look safe, but probably it makes sense to cleanup anyway. Reported-by: Linus Torvalds Signed-off-by: Oleg Nesterov --- arch/x86/include/uapi/asm/debugreg.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/uapi/asm/debugreg.h b/arch/x86/include/uapi/asm/debugreg.h index 3c0874d..75d07dd 100644 --- a/arch/x86/include/uapi/asm/debugreg.h +++ b/arch/x86/include/uapi/asm/debugreg.h @@ -15,7 +15,7 @@ are either reserved or not of interest to us. */ /* Define reserved bits in DR6 which are always set to 1 */ -#define DR6_RESERVED (0xFFFF0FF0) +#define DR6_RESERVED (0xFFFF0FF0ul) #define DR_TRAP0 (0x1) /* db0 */ #define DR_TRAP1 (0x2) /* db1 */ @@ -65,7 +65,7 @@ gdt or the ldt if we want to. I am not sure why this is an advantage */ #ifdef __i386__ -#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */ +#define DR_CONTROL_RESERVED (0xFC00ul) /* Reserved by Intel */ #else #define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */ #endif