Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1186163 > unrolled thread

Re: [PATCH v4 1/2] vTPM: support little endian guests

Started by"Hon Ching(Vicky) Lo" <honclo@linux.vnet.ibm.com>
First post2015-07-16 20:00 +0200
Last post2015-07-16 20:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v4 1/2] vTPM: support little endian guests "Hon Ching(Vicky) Lo" <honclo@linux.vnet.ibm.com> - 2015-07-16 20:00 +0200
    Re: [PATCH v4 1/2] vTPM: support little endian guests Peter Hüwe <PeterHuewe@gmx.de> - 2015-07-16 20:50 +0200

#1186163 — Re: [PATCH v4 1/2] vTPM: support little endian guests

From"Hon Ching(Vicky) Lo" <honclo@linux.vnet.ibm.com>
Date2015-07-16 20:00 +0200
SubjectRe: [PATCH v4 1/2] vTPM: support little endian guests
Message-ID<pMVBV-5ug-27@gated-at.bofh.it>
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 <honclo@linux.vnet.ibm.com>
> > Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
> 
> > 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.


Regards,
Vicky

--
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/

[toc] | [next] | [standalone]


#1186187

FromPeter Hüwe <PeterHuewe@gmx.de>
Date2015-07-16 20:50 +0200
Message-ID<pMWoh-6DY-1@gated-at.bofh.it>
In reply to#1186163
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 <honclo@linux.vnet.ibm.com>
> > > Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
> > > 
> > > 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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web