Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755597AbbGCOxY (ORCPT ); Fri, 3 Jul 2015 10:53:24 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39362 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754831AbbGCOxP convert rfc822-to-8bit (ORCPT ); Fri, 3 Jul 2015 10:53:15 -0400 References: <1435699387-32591-1-git-send-email-timur@codeaurora.org> <1435699387-32591-4-git-send-email-timur@codeaurora.org> <55947F1C.3020904@codeaurora.org> In-Reply-To: <55947F1C.3020904@codeaurora.org> Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii Message-Id: <830CD79F-C263-4C3B-A27F-77A4DA55236F@codeaurora.org> Content-Transfer-Encoding: 8BIT Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Shanker Donthineni , awallis@codeaurora.org, abhimany@codeaurora.org, will.deacon@arm.com, Vipul Gandhi From: Timur Tabi Subject: Re: [PATCH 4/4] hvc_dcc: disable user-space access to DCC Date: Fri, 3 Jul 2015 10:53:12 -0400 To: Stephen Boyd X-Mailer: Apple Mail (2.1085) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1602 Lines: 53 On Jul 1, 2015, at 8:00 PM, Stephen Boyd wrote: >> >> #include >> +#include > > That's new. And no one else is using it either. >> >> + >> +static inline void __dcc_initialize(void) >> +{ >> + u32 val; >> + >> + /* Disable user-space access to DCC */ >> + val = MRC14(0, c0, c1, 0); >> + val |= 1 << 12; /* DSCR[Comms] */ >> + MCR14(val, 0, c0, c1, 0); >> +} > > Nitpick: We do raw cp14 accesses for other functions in this file, so it > would be nice to be consistent throughout. I agree, but I didn't want to expand the scope of this patch beyond what it's supposed to do. >> >> +static inline void __dcc_initialize(void) >> +{ >> + u32 val; >> + >> + /* Disable user-space access to DCC */ >> + asm ("mrs %0, mdscr_el1\n" > > shouldn't this be volatile? Well, I figured it wasn't important exactly why these instructions are executed, since it just disables user-space. I usually get chewed out by someone if I add volatile where it's not needed, so I didn't add it this time. > >> + " orr %0, %0, #4096\n" /* Set the TDCC bit */ > > arm64 has some #defines in debug-monitors.h which we should probably > extend to have this bit as a #define too. Hmmm, the only thing I see in debug_monitors.h that seems applicable are the mdscr_write() and mdscr_read() functions, which seem to overlap cp14.h. -- 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/