Re: [PATCH 0/2] efinet: correct closing of SNP protocol

2021-10-06 Thread Andreas Schwab
On Okt 06 2021, Heinrich Schuchardt wrote:

> In the context of the implementation of the EFI_LOAD_FILE2_PROTOCOL for
> the initial ramdisk it was observed that opening the SNP protocol failed
> (https://lists.gnu.org/archive/html/grub-devel/2021-10/msg00020.html).
> This is due to an incorrect call to CloseProtocol().
>
> This is corrected in the first patch.
>
> The second patch provides a new function grub_efi_close_protocol() to
> simplify the coding.

Sucessfully tested with
https://download.opensuse.org/ports/riscv/tumbleweed/iso/openSUSE-Tumbleweed-NET-riscv64-Media.iso
on the Hifive Unmatched.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2 3/7] efi: implemented LoadFile2 initrd loading protocol for Linux

2021-10-05 Thread Andreas Schwab
On Okt 05 2021, Heinrich Schuchardt wrote:

> Before the 'boot' command the communication via TFTP seems to work fine.
> The init command can identify which file exists on the TFTP server.
>
> The boot command calls ShutDown() and Stop() on the SNP protocol and
> closes it. And then tries to open it again for the LOAD_FILE2 protocol.
>
> The question remains why the protocol cannot be reopened. It is unclear
> if this is a GRUB or a U-Boot issue.

The strange thing is that the first two packets+ACK still get through.
Maybe related to the size of the following DATA packet?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2 3/7] efi: implemented LoadFile2 initrd loading protocol for Linux

2021-10-05 Thread Andreas Schwab
On Okt 05 2021, Heinrich Schuchardt wrote:

> Which firmware did you use? U-Boot or EDK II? Which version?

U-Boot.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2 3/7] efi: implemented LoadFile2 initrd loading protocol for Linux

2021-10-05 Thread Andreas Schwab
On Okt 05 2021, Heinrich Schuchardt wrote:

> Do you think this problem is RISC-V specific

No, I don't think so.

> and related to the series?

Since network download of the kernel works, this seems to be related to
the use of the LoadFile2 protocol.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2 3/7] efi: implemented LoadFile2 initrd loading protocol for Linux

2021-09-23 Thread Andreas Schwab
That appears to have issues with loading the initrd over network.  I can
see the RRQ packet for the initrd arriving at the tftp server, the first
DATA packet sent out by the sever, which is acknowleged by the client.
But all subsequent DATA packages are never acknowleged by the client,
which just times out.  The kernel is loaded without problem.

Loading kernel ...
Loading initial ramdisk ...
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
error: ../../grub-core/net/drivers/efi/efinet.c:81:couldn't send network
packet.
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Exiting boot services and installing virtual address map...

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2 0/7] Add LoadFile2 and riscv Linux loader

2021-06-27 Thread Andreas Schwab
On Jun 27 2021, Heinrich Schuchardt wrote:

> On 6/26/21 8:07 PM, Andreas Schwab wrote:
>> On Jun 03 2021, Nikita Ermakov wrote:
>>
>>> This series contains patches to add support for LoadFile2 protocol to load
>>> initrd on EFI systems. Also it contains patches to load Linux kernel with 
>>> EFI
>>> stub on riscv platforms and unites arm and riscv codes together into common
>>> loader code for EFI systems.
>>
>> That doesn't work with a CD image.  When I try to run
>> http://download.opensuse.org/ports/riscv/tumbleweed/iso/openSUSE-Tumbleweed-NET-riscv64-Media.iso
>> with qemu, the initrd fails to load.
>
> Please, indicate how you built u-boot.bin.

With qemu-riscv64_smode_defconfig.

>> $ qemu-system-riscv64 -M virt -nographic -serial mon:stdio -smp 4 -m 8g 
>> -kernel u-boot.bin -drive 
>> format=raw,if=virtio,media=cdrom,file=openSUSE-Tumbleweed-NET-riscv64-Media.iso
>
> This command results in an error
>
> qemu-system-riscv64: warning:
> No -bios option specified. Not loading a firmware.

Looks like you use an old qemu.  Nowadays it automatically loads opensbi
as firmware.

> Please, provide a repo with the GRUB code you have been compiling.

https://build.opensuse.org/package/show/openSUSE:Factory:RISCV/grub2

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2 0/7] Add LoadFile2 and riscv Linux loader

2021-06-26 Thread Andreas Schwab
On Jun 03 2021, Nikita Ermakov wrote:

> This series contains patches to add support for LoadFile2 protocol to load
> initrd on EFI systems. Also it contains patches to load Linux kernel with EFI
> stub on riscv platforms and unites arm and riscv codes together into common
> loader code for EFI systems.

That doesn't work with a CD image.  When I try to run
http://download.opensuse.org/ports/riscv/tumbleweed/iso/openSUSE-Tumbleweed-NET-riscv64-Media.iso
with qemu, the initrd fails to load.

$ qemu-system-riscv64 -M virt -nographic -serial mon:stdio -smp 4 -m 8g -kernel 
u-boot.bin -drive 
format=raw,if=virtio,media=cdrom,file=openSUSE-Tumbleweed-NET-riscv64-Media.iso

OpenSBI v0.9
   _  _
  / __ \  / |  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |) | |_) || |_
  \/| .__/ \___|_| |_|_/|/_|
| |
|_|

Platform Name : riscv-virtio,qemu
Platform Features : timer,mfdeleg
Platform HART Count   : 4
Firmware Base : 0x8000
Firmware Size : 124 KB
Runtime SBI Version   : 0.2

Domain0 Name  : root
Domain0 Boot HART : 1
Domain0 HARTs : 0*,1*,2*,3*
Domain0 Region00  : 0x8000-0x8001 ()
Domain0 Region01  : 0x-0x (R,W,X)
Domain0 Next Address  : 0x8020
Domain0 Next Arg1 : 0xbf00
Domain0 Next Mode : S-mode
Domain0 SysReset  : yes

Boot HART ID  : 1
Boot HART Domain  : root
Boot HART ISA : rv64imafdcsu
Boot HART Features: scounteren,mcounteren,time
Boot HART PMP Count   : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count  : 0
Boot HART MHPM Count  : 0
Boot HART MIDELEG : 0x0222
Boot HART MEDELEG : 0xb109


U-Boot 2021.04 (Jun 09 2021 - 00:00:00 +)

CPU:   rv64imafdcsu
Model: riscv-virtio,qemu
DRAM:  8 GiB
In:uart@1000
Out:   uart@1000
Err:   uart@1000
Net:   No ethernet found.
Hit any key to stop autoboot:  0

Device 0: 1af4 VirtIO Block Device
Type: Hard Disk
Capacity: 225.7 MB = 0.2 GB (462376 x 512)
... is now current device
** Invalid partition 3 **
** Invalid partition 4 **
** Invalid partition 2 **
Scanning virtio 0:1...
** Unable to read file / **
Failed to load '/'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk virtio-blk#8...
Found 2 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/bootriscv64.efi
2584576 bytes read in 3 ms (821.6 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Booting /efi\boot\bootriscv64.efi
Welcome to GRUB!

Please press 't' to show the boot menu on this console
error: ../../grub-core/video/video.c:761:no suitable video mode found.


  openSUSE Tumbleweed

 ┌┐
 │ Boot from Hard Disk│
 │*Installation   │
 │ Upgrade│
 │ More ...   │
 ││
 ││
 ││
 ││
 ││
 ││
 ││
 ││
 ││
 └┘

  Use the ▲ and ▼ keys to select which entry is highlighted.
  Press enter to boot the selected OS, `e' to edit the commands
  before booting or `c' for a command-line.

Loading kernel ...
Loading initial ramdisk ...
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: ERROR: Failed to load initrd!
EFI stub: Exiting boot services and installing virtual address map...

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel 

Re: [PATCH] RISC-V: Restore the typcast to 64bit type

2021-03-29 Thread Andreas Schwab
On Mär 28 2021, Khem Raj wrote:

> this makes the type promotions clear and explicit
> It was already typecasted to long but was accidentally dropped in [1]

Note that long is 32-bit on riscv32, so the title is misleading (there
was no cast to 64-bit type before).  The cast really was a no-op, as it
didn't change the resulting type.  The issue is that the types of
sym_addr, target_section_addr and offset are Elf_Addr (aka Elf32_Addr),
which is an unsigned type (image_target->vaddr_offset is signed, but not
wider than Elf32_Addr, so it doesn't change the overall type).  Thus
when the result of the expression is extended to grub_int64_t it is
always a positive value instead of the desired sign-extended one.

> which stated to cause failures on riscv32 as reported in [2]

Most likely the missing addend masked the error.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] riscv64-emu: add __clzdi2 symbol

2019-09-19 Thread Andreas Schwab
On Sep 18 2019, Daniel Kiper  wrote:

> Hmmm... Is __clzdi2() declaration correct?

It doesn't really matter, since nobody is using the prototype.  It's
only used for generating the symbol list.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH v2] riscv64-emu: add __clzdi2 symbol

2019-09-19 Thread Andreas Schwab
This is needed for the zstd module.

Signed-off-by: Andreas Schwab 
---
 configure.ac   | 2 +-
 include/grub/compiler-rt-emu.h | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index e07ba4b56..7d74eba66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1370,7 +1370,7 @@ fi
 
 # Check for libgcc symbols
 if test x"$platform" = xemu; then
-AC_CHECK_FUNCS(__udivsi3 __umodsi3 __divsi3 __modsi3 __divdi3 __moddi3 
__udivdi3 __umoddi3 __ctzdi2 __ctzsi2 __aeabi_uidiv __aeabi_uidivmod 
__aeabi_idiv __aeabi_idivmod __aeabi_ulcmp __muldi3 __aeabi_lmul __aeabi_memcpy 
__aeabi_memcpy4 __aeabi_memcpy8 __aeabi_memclr __aeabi_memclr4 __aeabi_memclr8 
__aeabi_memset __aeabi_lasr __aeabi_llsl __aeabi_llsr _restgpr_14_x __ucmpdi2 
__ashldi3 __ashrdi3 __lshrdi3 __bswapsi2 __bswapdi2 __bzero 
__register_frame_info __deregister_frame_info ___chkstk_ms __chkstk_ms)
+AC_CHECK_FUNCS(__udivsi3 __umodsi3 __divsi3 __modsi3 __divdi3 __moddi3 
__udivdi3 __umoddi3 __ctzdi2 __ctzsi2 __clzdi2 __aeabi_uidiv __aeabi_uidivmod 
__aeabi_idiv __aeabi_idivmod __aeabi_ulcmp __muldi3 __aeabi_lmul __aeabi_memcpy 
__aeabi_memcpy4 __aeabi_memcpy8 __aeabi_memclr __aeabi_memclr4 __aeabi_memclr8 
__aeabi_memset __aeabi_lasr __aeabi_llsl __aeabi_llsr _restgpr_14_x __ucmpdi2 
__ashldi3 __ashrdi3 __lshrdi3 __bswapsi2 __bswapdi2 __bzero 
__register_frame_info __deregister_frame_info ___chkstk_ms __chkstk_ms)
 fi
 
 if test "x$TARGET_APPLE_LINKER" = x1 ; then
diff --git a/include/grub/compiler-rt-emu.h b/include/grub/compiler-rt-emu.h
index b21425d9e..fde620ac1 100644
--- a/include/grub/compiler-rt-emu.h
+++ b/include/grub/compiler-rt-emu.h
@@ -74,6 +74,11 @@ unsigned
 EXPORT_FUNC (__ctzsi2) (grub_uint32_t x);
 #endif
 
+#ifdef HAVE___CLZDI2
+int
+EXPORT_FUNC (__clzdi2) (grub_uint64_t x);
+#endif
+
 #ifdef HAVE___AEABI_UIDIV
 grub_uint32_t
 EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b);
-- 
2.23.0


-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] riscv64-emu: add __clzdi2 symbol

2019-09-09 Thread Andreas Schwab
This is needed for the zstd module.

Signed-off-by: Andreas Schwab 
---
 configure.ac   | 2 +-
 include/grub/compiler-rt-emu.h | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index e07ba4b56..7d74eba66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1370,7 +1370,7 @@ fi
 
 # Check for libgcc symbols
 if test x"$platform" = xemu; then
-AC_CHECK_FUNCS(__udivsi3 __umodsi3 __divsi3 __modsi3 __divdi3 __moddi3 
__udivdi3 __umoddi3 __ctzdi2 __ctzsi2 __aeabi_uidiv __aeabi_uidivmod 
__aeabi_idiv __aeabi_idivmod __aeabi_ulcmp __muldi3 __aeabi_lmul __aeabi_memcpy 
__aeabi_memcpy4 __aeabi_memcpy8 __aeabi_memclr __aeabi_memclr4 __aeabi_memclr8 
__aeabi_memset __aeabi_lasr __aeabi_llsl __aeabi_llsr _restgpr_14_x __ucmpdi2 
__ashldi3 __ashrdi3 __lshrdi3 __bswapsi2 __bswapdi2 __bzero 
__register_frame_info __deregister_frame_info ___chkstk_ms __chkstk_ms)
+AC_CHECK_FUNCS(__udivsi3 __umodsi3 __divsi3 __modsi3 __divdi3 __moddi3 
__udivdi3 __umoddi3 __ctzdi2 __ctzsi2 __clzdi2 __aeabi_uidiv __aeabi_uidivmod 
__aeabi_idiv __aeabi_idivmod __aeabi_ulcmp __muldi3 __aeabi_lmul __aeabi_memcpy 
__aeabi_memcpy4 __aeabi_memcpy8 __aeabi_memclr __aeabi_memclr4 __aeabi_memclr8 
__aeabi_memset __aeabi_lasr __aeabi_llsl __aeabi_llsr _restgpr_14_x __ucmpdi2 
__ashldi3 __ashrdi3 __lshrdi3 __bswapsi2 __bswapdi2 __bzero 
__register_frame_info __deregister_frame_info ___chkstk_ms __chkstk_ms)
 fi
 
 if test "x$TARGET_APPLE_LINKER" = x1 ; then
diff --git a/include/grub/compiler-rt-emu.h b/include/grub/compiler-rt-emu.h
index b21425d9e..661f9876f 100644
--- a/include/grub/compiler-rt-emu.h
+++ b/include/grub/compiler-rt-emu.h
@@ -74,6 +74,11 @@ unsigned
 EXPORT_FUNC (__ctzsi2) (grub_uint32_t x);
 #endif
 
+#ifdef HAVE___CLZDI2
+unsigned
+EXPORT_FUNC (__clzdi2) (grub_uint64_t x);
+#endif
+
 #ifdef HAVE___AEABI_UIDIV
 grub_uint32_t
 EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b);
-- 
2.23.0

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] grub-install: Define default platform for RISC-V

2019-08-15 Thread Andreas Schwab
Signed-off-by: Andreas Schwab 
---
 util/grub-install.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/util/grub-install.c b/util/grub-install.c
index 8a55ad4b8..8970b73aa 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -324,6 +324,14 @@ get_default_platform (void)
return "arm64-efi";
 #elif defined (__amd64__) || defined (__x86_64__) || defined (__i386__)
return grub_install_get_default_x86_platform ();
+#elif defined (__riscv)
+#if __riscv_xlen == 32
+   return "riscv32-efi";
+#elif __riscv_xlen == 64
+   return "riscv64-efi";
+#else
+   return NULL;
+#endif
 #else
return NULL;
 #endif
-- 
2.22.1

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] riscv: fix computation of pc-relative relocation offset

2019-06-26 Thread Andreas Schwab
The offset calculation was missing the relocation addend.

Signed-off-by: Andreas Schwab 
---
 util/grub-mkimagexx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index bc087c2b5..d16ec63a1 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -1232,8 +1232,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct 
section_metadata *smd,
 grub_uint32_t *t32 = (grub_uint32_t *) target;
 grub_uint16_t *t16 = (grub_uint16_t *) target;
 grub_uint8_t *t8 = (grub_uint8_t *) target;
-grub_int64_t off = (long)sym_addr - target_section_addr - 
offset
-   - image_target->vaddr_offset;
+grub_int64_t off;
 
 /*
  * Instructions and instruction encoding are documented in the 
RISC-V
@@ -1243,6 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct 
section_metadata *smd,
  */
 
 sym_addr += addend;
+off = sym_addr - target_section_addr - offset - 
image_target->vaddr_offset;
 
 switch (ELF_R_TYPE (info))
   {
-- 
2.22.0

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v6 00/11] Add RISC-V support

2019-03-06 Thread Andreas Schwab
On Feb 12 2019, Alexander Graf  wrote:

> As part of the plan for total world domination, we would like to make sure
> that booting on RISC-V is in a sane state before anyone goes and does quick
> hacks "just because".
>
> For that reason, U-Boot supports UEFI booting on RISC-V for a while now.
> This patch set is the second part of the puzzle, with grub learning how to
> deal with a UEFI enabled RISC-V target.
>
> The third bit (still missing) is to actually make a working Linux UEFI port.
> But that will come, I'm sure :).
>
> Looking forward to review feedback and testing,

Successfully tested on the HiFive Unleashed.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v3 09/10] RISC-V: Add to build system

2018-11-21 Thread Andreas Schwab
On Nov 21 2018, Daniel Kiper  wrote:

> On Wed, Nov 21, 2018 at 05:26:25PM +0100, Andreas Schwab wrote:
>> On Nov 21 2018, Daniel Kiper  wrote:
>>
>> > s/__riscv/__riscv__/? and s/__riscv_xlen/__riscv_xlen__/?
>>
>> The latter aren't defined.
>
> Both __riscv__ and __riscv_xlen__ are not defined?

Yes.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v3 09/10] RISC-V: Add to build system

2018-11-21 Thread Andreas Schwab
On Nov 21 2018, Daniel Kiper  wrote:

> s/__riscv/__riscv__/? and s/__riscv_xlen/__riscv_xlen__/?

The latter aren't defined.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v3 07/10] RISC-V: Add awareness for RISC-V reloations

2018-11-21 Thread Andreas Schwab
On Nov 21 2018, Daniel Kiper  wrote:

>> +case R_RISCV_BRANCH:
>> +  {
>> +grub_uint32_t *abs_place = place;
>> +grub_ssize_t off = sym_addr - (grub_addr_t) place;
>> +grub_uint32_t imm12 = (off & 0x1000) << (31 - 12);
>> +grub_uint32_t imm11 = (off & 0x800) >> (11 - 7);
>> +grub_uint32_t imm10_5 = (off & 0x7e0) << (30 - 10);
>> +grub_uint32_t imm4_1 = (off & 0x1e) << (11 - 4);
>> +*abs_place = (*abs_place & 0x1fff07f)
>> + | imm12 | imm11 | imm10_5 | imm4_1;
>
> Could not we use some constants instead of numbers here?

These are just where the insn encoding puts the bits.

> If this does not make sense than please name the source of this numbers.

https://github.com/riscv/riscv-isa-manual/blob/master/release/riscv-spec-v2.2.pdf

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v3 10/10] fdt: Add device tree file type

2018-11-19 Thread Andreas Schwab
On Nov 14 2018, Alexander Graf  wrote:

> diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
> index a4c6e8036..d8ebe648e 100644
> --- a/grub-core/loader/efi/fdt.c
> +++ b/grub-core/loader/efi/fdt.c
> @@ -123,7 +123,7 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ 
> ((unused)),
>return GRUB_ERR_NONE;
>  }
>  
> -  dtb = grub_file_open (argv[0]);
> +  dtb = grub_file_open (argv[0], GRUB_FILE_TYPE_DEVICE_TREE);
>if (!dtb)
>  goto out;
>  

Looks like this has been obsoleted by commit dfb1742aab?

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2 09/10] RISC-V: Add to build system

2018-11-14 Thread Andreas Schwab
On Nov 14 2018, Bin Meng  wrote:

> - use riscv32-* toolchain to build riscv64 target (-m64 required)
> - use riscv64-* toolchain to build riscv32 target (-m32 required)

riscv does not use -m64/-m32.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Recent removal of a.out and COFF support for sparc

2018-08-08 Thread Andreas Schwab
On Aug 08 2018, John Paul Adrian Glaubitz  wrote:

> What about elfutils for these purposes? I have been told by gcc people
> that elfutils was supposed to replace binutils in this regard.

BFD is also used by GAS and GPROF.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [Savannah-users] Anonymous commit (empty Author and Committer)

2015-10-31 Thread Andreas Schwab
Kaz Kylheku  writes:

> Nope. They will have a git in which that commit looks like their own
> local work. *Someone* will inadvertently do a "git push" to blast out
> their changes based on that deleted commit, thereby causing it to
> reappear.

Not if another one pushes something different in the mean time.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel