Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756483Ab3DZRSl (ORCPT ); Fri, 26 Apr 2013 13:18:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46338 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754092Ab3DZRSi (ORCPT ); Fri, 26 Apr 2013 13:18:38 -0400 Date: Fri, 26 Apr 2013 19:15:26 +0200 From: Oleg Nesterov To: "H. Peter Anvin" Cc: Ingo Molnar , Linus Torvalds , Cyrill Gorcunov , Peter Zijlstra , 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: Re: [PATCH v2] x86: make DR*_RESERVED unsigned long Message-ID: <20130426171526.GA30875@redhat.com> References: <20130424072630.GB1780@gmail.com> <20130424170702.GA1867@redhat.com> <5178282D.9030902@zytor.com> <20130425144818.GA25921@redhat.com> <20130426163802.GA30351@redhat.com> <517AAED5.7040400@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <517AAED5.7040400@zytor.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1482 Lines: 53 On 04/26, H. Peter Anvin wrote: > > On 04/26/2013 09:38 AM, Oleg Nesterov wrote: > > > > - do_debug: > > > > dr6 &= ~DR6_RESERVED; > > > > this also wrongly clears 32-63 bits. Fortunately these > > bits are reserved and must be zero. > > I don't think this is wrongly at all. OK, I meant that it also clears the bits that are not specified in DR6_RESERVED mask. > The whole point is to mask out > the bits that the handler doesn't want to deal with, so masking out the > reserved bits [63:32] seems reasonable to me. Then we should do - #define DR6_RESERVED 0xFFFF0FF0 + #define DR6_RESERVED 0xFFFFFFFFFFFF0FF0 ? or what? (just in case, I will happily agree with "do nothing" ;) > The comment should probably be corrected, though. Which one? /* Define reserved bits in DR6 which are always set to 1 */ #define DR6_RESERVED (0xFFFF0FF0UL) /* Filter out all the reserved bits which are preset to 1 */ dr6 &= ~DR6_RESERVED; I guess both should be updated then. But if I read the doc correctly the lower reserved bits are set to 1. However do_debug() does set_debugreg(0, 6) and this looks correct, the doc says "debug handlers should clear the register before returning to the interrupted task". Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/