Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755795AbbGPSmE (ORCPT ); Thu, 16 Jul 2015 14:42:04 -0400 Received: from mout.gmx.net ([212.227.17.21]:52459 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753414AbbGPSmB convert rfc822-to-8bit (ORCPT ); Thu, 16 Jul 2015 14:42:01 -0400 From: Peter =?utf-8?q?H=C3=BCwe?= To: "Hon Ching(Vicky) Lo" Subject: Re: [PATCH v4 1/2] vTPM: support little endian guests Date: Thu, 16 Jul 2015 20:43:52 +0200 User-Agent: KMail/1.13.7 (Linux/4.1.2; KDE/4.14.8; x86_64; ; ) Cc: tpmdd-devel@lists.sourceforge.net, Ashley Lai , Vicky Lo , linux-kernel@vger.kernel.org, Joy Latten References: <1434579429-29449-1-git-send-email-honclo@linux.vnet.ibm.com> <201507132308.00824.PeterHuewe@gmx.de> <1437069255.29298.5.camel@vtpm2014.ibm.com> In-Reply-To: <1437069255.29298.5.camel@vtpm2014.ibm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Message-Id: <201507162043.52754.PeterHuewe@gmx.de> X-Provags-ID: V03:K0:nk8zrRs8sVq8yFz5Nv8rTsOemlGJk4GANwrwD8YZdPvq5SMPHa+ xG3uDneaB4Vk9a+vyi/RDMEg5pomDTHBLLP+dtj7+fhLb6Vc3yv/w620Vomsq41n3C5Zq62 Q5M6/A+1nOAjYSTwGOPCqzDC4O/5v9My2pJw1Y01iEXrAsd6i9Yy/xCoZ7OzvUZtRo1qdHo /TCMEEniDisKjiu3CuguA== X-UI-Out-Filterresults: notjunk:1;V01:K0:vKtrfZ+QcKc=:S+IwcmNrCPh37GemFu0e8T fmjDx28VDr9lOotM0cbzuMwCvrOsklwzKWI+S9jL+HKFdBLUx3k3BBkpcOi6/9B28+15eX9bd KNtlgtT88MntV6sPneVL5FHOSqcq+Ww98WbaVLccgigTDREWA3mIVO/Qro4Jd75otufAiOh05 L7Jg1r5eFckAoidpo28DCCuNGkgxakayumObZ9eRg+NEBeK8tD3P5lrv2f6wZnf8+9nGe1Q8f WZUYpSjj43i/HTj2JoLeirvsoTLkN1PeGFskHfvhrAkUXNhJxrLhqC2ovStU/qKhwpZhII1k9 jPZMwm5MwOSEKk0NLf7A2eKyijPXFHMpMfZLPyZE65sinCnIAeznIXBu/uTj2/LTbXS2EBKpT jTsJulYsxe+8We+6MLinDBHW/wmehIpHgQnt4o3ZoldWsZuuq+hOQ10BPkrYsC6xbhKwGS3Fd pa8gf9nYc0O2XtCkSm1k1rNONG1QOn5ntcjHarotW5DxVmjDe/bZDsjZxsjJG9zaSbla7L0YB n30Sr56Qx9yhzv7cKx2DVAFPK8CMrO3+lyUmB+8N67NfAyDPmEE5l1ma17BCNa1kwMszUUnWV C0be/z6IbSGBkbmF/QOoahrlAoQd3mnOIYXGsGAY0Mxx+ndOU5UfrTG+nckYEbBojIYjDKaEL e1qNlszHpSN3aYPP9szNWdBOClJn3no+hOjK/Qn6jNs5G2+w75+8p7vchUKINQvS0HJg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1784 Lines: 56 Hi Vicky, Am Donnerstag, 16. Juli 2015, 19:54:15 schrieb Hon Ching(Vicky) Lo: > Hi Peter, > > On Mon, 2015-07-13 at 23:08 +0200, Peter Hüwe wrote: > > Hi Vicky, > > > > sorry for the late reply > > > > > This patch makes the code endianness independent. We defined a > > > macro do_endian_conversion to apply endianness to raw integers > > > in the event entries so that they will be displayed properly. > > > tpm_binary_bios_measurements_show() is modified for the display. > > > > > > Signed-off-by: Hon Ching(Vicky) Lo > > > Signed-off-by: Joy Latten > > > > > > b/drivers/char/tpm/tpm_eventlog.h index e7da086..267bfbd 100644 > > > --- a/drivers/char/tpm/tpm_eventlog.h > > > +++ b/drivers/char/tpm/tpm_eventlog.h > > > @@ -6,6 +6,12 @@ > > > > > > #define MAX_TEXT_EVENT 1000 /* Max event string length */ > > > #define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */ > > > > > > +#ifdef CONFIG_PPC64 > > > +#define do_endian_conversion(x) be32_to_cpu(x) > > > +#else > > > +#define do_endian_conversion(x) x > > > +#endif > > > > Why is this macro needed? > > shouldn't the be32_to_cpu macro already do correct thing? > > Or am I missing something here? > > > > > > Thanks, > > Peter > > The macro is defined to not do the conversion in the architecture > that does not need it. Unfortunately I'm still not convinced this is needed? be32_to_cpu(x) should already do the right thing if no conversion is needed ? (being defined as (x)) Or is it not? Peter -- 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/