[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2
From: |
Daniel Kiper |
Subject: |
Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2 |
Date: |
Thu, 1 Dec 2022 16:51:30 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Thu, Dec 01, 2022 at 09:58:45AM -0500, Stefan Berger wrote:
> On 12/1/22 09:47, Daniel Kiper wrote:
> > On Thu, Dec 01, 2022 at 09:22:42AM -0500, Stefan Berger wrote:
> > > On 12/1/22 09:02, Daniel Kiper wrote:
> >
> > [...]
> >
> > > > ./configure --target=i386 --with-platform=ieee1275 ...
> > >
> > > I had to adjust the created symlist.h like this to make it compile at
> > > least:
> > >
> > > //#include <../include/grub/machine/pxe.h>
> > > //#include <../include/grub/machine/int.h>
> >
> > Hmmm... Strange... It builds for me without any issues. I use latest
> > Debian testing, gcc version 12.2.0 (Debian 12.2.0-9). It builds with
> > gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) too. What compiler
> > do you use?
>
> $ cat /etc/debian_version
> 11.5
> $ gcc --version
> gcc (Debian 10.2.1-6) 10.2.1 20210110
> Copyright (C) 2020 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Hmmm... It should work...
> > > When trying to install this on my i386 VM I get this here:
> > >
> > > sudo grub-install /dev/vda --target=i386-ieee1275
> > > Installing for i386-ieee1275 platform.
> > > grub-install: warning: cannot open directory `/usr/local/share/locale':
> > > No such file or directory.
> > > grub-install: warning: unknown device type vda1.
> > > grub-install: error: ofpathname: not found.
> > >
> > > Would this type of target produce a grub version that works on a VM
> > > that would otherwise work with i386-pc?
> >
> > Nope...
>
> Well, not good...
>
> >
> > > And is this still a supported target?
> >
> > What do you mean by "supported"? It is build tested and, AIUI, all "make
> > check"
> > tests pass. Though I am not sure anybody uses this kinda weird target. Well,
> > I think I knew but I forgot... :-)
>
> The problem is I don't know much about the target other than ieee1275
> being OpenFirmare or so. So we (I) could easily break someone's
> favorite target here ...
:-) I am happy you care about that. I think Glenn could tell you how to
run "make check" for i386-ieee1275 target. Glenn?
And I think you can find some hints how to run "make check" in the
INSTALL file too...
> The following function from this series would probably run on
> i386-ieee1275 as well since these nodes are probably so fundamental to
> OpenFirmware that there's no point in surrounding it with #ifdef
> __powerpc__ ?
Yeah, I think you are right...
> static grub_err_t
> grub_ieee1275_total_mem (grub_uint64_t *total)
> {
> grub_ieee1275_phandle_t root;
> grub_ieee1275_phandle_t memory;
> grub_uint32_t reg[4];
> grub_ssize_t reg_size;
> grub_uint32_t address_cells = 1;
> grub_uint32_t size_cells = 1;
> grub_uint64_t size;
>
> /* If we fail to get to the end, report 0. */
> *total = 0;
>
> /* Determine the format of each entry in `reg'. */
> if (grub_ieee1275_finddevice ("/", &root))
> return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't find / node");
> if (grub_ieee1275_get_integer_property (root, "#address-cells",
> &address_cells,
> sizeof (address_cells), 0))
> return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine
> #address-cells");
> if (grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells,
> sizeof (size_cells), 0))
> return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine
> #size-cells");
>
> I added the if's here just to be 'safe'.
This should be enough. Though please double check if other parts of the
code fail safely if grub_ieee1275_total_mem() returns an error.
> In the end i386-ieee1275 shouldn't hold up progress on powerpc ieee1275...
Yeah, I concur...
Daniel
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Glenn Washburn, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Stefan Berger, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Daniel Kiper, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Stefan Berger, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Daniel Kiper, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Stefan Berger, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2,
Daniel Kiper <=
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Stefan Berger, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Daniel Kiper, 2022/12/01
- Re: [PATCH 0/6] Dynamic allocation of memory regions and IBM vTPM v2, Lennart Sorensen, 2022/12/02