From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbdJRTLJ (ORCPT ); Wed, 18 Oct 2017 15:11:09 -0400 Received: from esa2.dell-outbound.iphmx.com ([68.232.149.220]:24712 "EHLO esa2.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdJRTLH (ORCPT ); Wed, 18 Oct 2017 15:11:07 -0400 From: X-LoopCount0: from 10.166.132.187 X-IronPort-AV: E=Sophos;i="5.43,397,1503378000"; d="scan'208";a="564342689" X-DLP: DLP_GlobalPCIDSS To: , CC: , , , , , , , , , Subject: RE: [PATCH v9 11/17] platform/x86: dell-smbios-smm: test for WSMT Thread-Topic: [PATCH v9 11/17] platform/x86: dell-smbios-smm: test for WSMT Thread-Index: AQHTSESjJV8y9bJoLEupf7lM3Aua8aLp+Oog Date: Wed, 18 Oct 2017 19:10:59 +0000 Message-ID: References: <20171017192258.fx2ejggjkyzkrzle@pali> <20171018190927.GA1097@fury> In-Reply-To: <20171018190927.GA1097@fury> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.242.75] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v9IJBEfF012360 > -----Original Message----- > From: Darren Hart [mailto:dvhart@infradead.org] > Sent: Wednesday, October 18, 2017 2:09 PM > To: Pali Rohár > Cc: Limonciello, Mario ; Andy Shevchenko > ; LKML ; platform- > driver-x86@vger.kernel.org; Andy Lutomirski ; > quasisec@google.com; rjw@rjwysocki.net; mjg59@google.com; hch@lst.de; Greg > KH ; Alan Cox > Subject: Re: [PATCH v9 11/17] platform/x86: dell-smbios-smm: test for WSMT > > On Tue, Oct 17, 2017 at 09:22:58PM +0200, Pali Rohár wrote: > > On Tuesday 17 October 2017 13:21:55 Mario Limonciello wrote: > > > +/* When enabled this indicates that SMM won't work */ > > > +static int test_wsmt_enabled(void) > > > +{ > > > + struct calling_interface_token *token; > > > + > > > + /* if token doesn't exist, SMM will work */ > > > + token = dell_smbios_find_token(WSMT_EN_TOKEN); > > > + if (!token) > > > + return 0; > > > + > > > + /* if token exists, try to access over SMM */ > > > + buffer->class = CLASS_TOKEN_READ; > > > + buffer->select = SELECT_TOKEN_STD; > > > + memset(buffer, 0, sizeof(struct calling_interface_buffer)); > > > + buffer->input[0] = token->location; > > > + dell_smbios_smm_call(buffer); > > > + > > > + /* if lookup failed, we know WSMT was enabled */ > > > + if (buffer->output[0] != 0) > > > + return 1; > > > + > > > + /* query token status if it didn't fail */ > > > + return (buffer->output[1] == token->value); > > > +} > > > > Maybe small suggestion... function returns only zero or one -- what is a > > good candidate to have return value boolean and not basic int. > > Yes please. > OK I'll adjust this (and the other things Pali sent recently) in the next submission. Just waiting on feedback for some of the other areas before sending off again.