vm events, userspace, the vmgenid driver, and the future [was: the uevent revert thread]

2024-09-18 Thread Jason A. Donenfeld
[broadened subject line and added relevant parties to cc list] On Tue, Sep 17, 2024 at 10:55:20PM +0200, Alexander Graf wrote: > What is still open are user space applications that require event based > notification on VM clone events - and *only* VM clone events. This > mostly caters for tools

Re: [PATCH] hw/loongarch: virt: pass random seed to fdt

2024-09-08 Thread Jason A. Donenfeld
On Mon, Sep 9, 2024 at 3:38 AM gaosong wrote: > > > > 在 2024/9/5 下午11:33, Jason A. Donenfeld 写道: > > If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to > > initialize early. Set this using the usual guest random number > > generation func

Re: [PATCH v2] hw/loongarch: virt: support up to 4 serial ports

2024-09-07 Thread Jason A. Donenfeld
On Sat, Sep 07, 2024 at 04:44:45PM +0200, Jason A. Donenfeld wrote: > On Sat, Sep 07, 2024 at 11:37:09AM +0800, maobibo wrote: > > Hi Jason, > > > > It works well with ELF kernel, however it fails to boot with UEFI BIOS. > > Maybe it is problem of UEFI BIOS, can we c

Re: [PATCH v2] hw/loongarch: virt: support up to 4 serial ports

2024-09-07 Thread Jason A. Donenfeld
On Sat, Sep 07, 2024 at 11:37:09AM +0800, maobibo wrote: > Hi Jason, > > It works well with ELF kernel, however it fails to boot with UEFI BIOS. > Maybe it is problem of UEFI BIOS, can we create UART in reverse order? > so that it can work well on both ELF kernel and UEFI BIOS. > > Also for dev

[PATCH v3] hw/loongarch: virt: support up to 4 serial ports

2024-09-07 Thread Jason A. Donenfeld
In order to support additional channels of communication using `-serial`, add several serial ports, up to the standard 4 generally supported by the 8250 driver. Signed-off-by: Jason A. Donenfeld --- hw/loongarch/acpi-build.c | 23 +++ hw/loongarch/virt.c| 23

Re: LoongArch without CONFIG_ACPI and CONFIG_EFI

2024-09-06 Thread Jason A. Donenfeld
On Sat, Sep 07, 2024 at 09:47:38AM +0800, Huacai Chen wrote: > On Sat, Sep 7, 2024 at 9:44 AM maobibo wrote: > > > > Add huacai who is maintainer of Loongarch Linux kernel. > > > > On 2024/9/6 下午10:55, Jason A. Donenfeld wrote: > > > Hi, > > > > &

LoongArch without CONFIG_ACPI and CONFIG_EFI

2024-09-06 Thread Jason A. Donenfeld
Hi, It appears that as of QEMU 9.1, it's possible to boot LoongArch machines that don't provide EFI or ACPI. Would you consider removing the `select ACPI` and `select EFI` from the arch Kconfig, so that kernels built for this minimal QEMU environment can be a bit leaner and quicker to build? Jas

[PATCH v2] hw/loongarch: virt: support up to 4 serial ports

2024-09-06 Thread Jason A. Donenfeld
In order to support additional channels of communication using `-serial`, add several serial ports, up to the standard 4 generally supported by the 8250 driver. Signed-off-by: Jason A. Donenfeld --- As I don't use ACPI, I haven't tested the ACPI part of this, which Maobibo wrote. hw

Re: [PATCH] hw/loongarch: virt: support up to 4 serial ports

2024-09-06 Thread Jason A. Donenfeld
On Fri, Sep 06, 2024 at 04:34:53PM +0800, maobibo wrote: > > +for (i = 0; i < VIRT_UART_COUNT; ++i) { > How about adding serial_hd(i) checking here, such as >for (i = 0; (i < VIRT_UART_COUNT) && serial_hd(i); ++i) { That doesn't seem to do anything, unfortunately. > > > +hwaddr b

[PATCH] hw/loongarch: virt: support up to 4 serial ports

2024-09-05 Thread Jason A. Donenfeld
In order to support additional channels of communication using `-serial`, add several serial ports, up to the standard 4 generally supported by the 8250 driver. Signed-off-by: Jason A. Donenfeld --- hw/loongarch/virt.c| 24 ++-- include/hw/pci-host/ls7a.h | 9

Re: qemu direct kernel boot on LoongArch

2024-09-05 Thread Jason A. Donenfeld
On Fri, Sep 06, 2024 at 06:04:25AM +0200, Jason A. Donenfeld wrote: > On Fri, Sep 6, 2024 at 3:14 AM maobibo wrote: > > yeap, will submit a patch to expose ACPI GED pm interface with FDT method. > > Clever trick. Works well. > > > > > > > > >> Meanwh

Re: qemu direct kernel boot on LoongArch

2024-09-05 Thread Jason A. Donenfeld
On Fri, Sep 6, 2024 at 3:14 AM maobibo wrote: > yeap, will submit a patch to expose ACPI GED pm interface with FDT method. Clever trick. Works well. > > > > >> Meanwhile, any idea about adding a second serial to the platform? I've > >> been futzing with it for a bit now to no avail. > > > > No i

Re: [PATCH 0/2] Add FDT table support with acpi ged pm register

2024-09-05 Thread Jason A. Donenfeld
This series appears to work in my testing. Tested-by: Jason A. Donenfeld

Re: qemu direct kernel boot on LoongArch

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 04:54:41PM +0200, Jason A. Donenfeld wrote: > On Thu, Sep 05, 2024 at 02:11:32PM +0800, maobibo wrote: > > > > > > On 2024/9/5 下午1:25, Thomas Weißschuh wrote: > > > On 2024-09-05 06:04:12+, Jason A. Donenfeld wrote: > > >> On

[PATCH] hw/loongarch: virt: pass random seed to fdt

2024-09-05 Thread Jason A. Donenfeld
ode somehow already does that, despite not having this patch here, presumably due to some lucky copy and pasting. Signed-off-by: Jason A. Donenfeld --- hw/loongarch/virt.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 29040422aa..0f0b7d

Re: qemu direct kernel boot on LoongArch

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 5, 2024 at 5:16 PM Thomas Weißschuh wrote: > > On 2024-09-05 17:07:22+, Jason A. Donenfeld wrote: > > On Thu, Sep 5, 2024 at 5:05 PM Thomas Weißschuh wrote: > > > > > > On 2024-09-05 16:53:55+, Jason A. Donenfeld wrote: > > > > On Thu

Re: qemu direct kernel boot on LoongArch

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 5, 2024 at 5:05 PM Thomas Weißschuh wrote: > > On 2024-09-05 16:53:55+, Jason A. Donenfeld wrote: > > On Thu, Sep 05, 2024 at 07:25:05AM +0200, Thomas Weißschuh wrote: > > > On 2024-09-05 06:04:12+0000, Jason A. Donenfeld wrote: > > > > On Th

Re: qemu direct kernel boot on LoongArch

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 02:11:32PM +0800, maobibo wrote: > > > On 2024/9/5 下午1:25, Thomas Weißschuh wrote: > > On 2024-09-05 06:04:12+, Jason A. Donenfeld wrote: > >> On Thu, Sep 5, 2024 at 5:45 AM maobibo wrote: > >>> > >>> Jason, > >

Re: qemu direct kernel boot on LoongArch

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 07:25:05AM +0200, Thomas Weißschuh wrote: > On 2024-09-05 06:04:12+0000, Jason A. Donenfeld wrote: > > On Thu, Sep 5, 2024 at 5:45 AM maobibo wrote: > > > > > > Jason, > > > > > > With the latest qemu 9.1 version, elf format

Re: qemu direct kernel boot on LoongArch

2024-09-04 Thread Jason A. Donenfeld
On Thu, Sep 5, 2024 at 5:45 AM maobibo wrote: > > Jason, > > With the latest qemu 9.1 version, elf format booting is supported. Thanks, I just figured this out too, about 4 minutes ago. Excellent. And the 1G minimum ram limit is gone too. Now working on how to trigger resets. Jason

Re: qemu direct kernel boot on LoongArch

2024-09-04 Thread Jason A. Donenfeld
On Tue, Oct 10, 2023 at 09:12:46AM +0800, maobibo wrote: > Thomas, > > Thanks for reporting this issue. > > It is the problem of QEMU for LoongArch system, QEMU does not support > booting vmlinux with elf format without UEFI bios now. We will add > support to boot vmlinux directly on QEMU Loong

Re: [PATCH RESEND] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2024-08-25 Thread Jason A. Donenfeld
On Fri, Aug 23, 2024 at 07:28:43AM +0100, Stafford Horne wrote: > Also, I will wait to see if Jason has anything to say. So long as this doesn't change the assignment of the serial ports to device nodes in Linux, I don't think this should interfere with much. You might want to try it, though. Jas

Re: [RFC PATCH 0/1] Implement entropy leak reporting for virtio-rng

2023-04-11 Thread Jason A. Donenfeld
On Tue, Apr 11, 2023 at 6:19 PM Amit Shah wrote: > > Hey Babis, > > On Mon, 2023-04-03 at 12:52 +0200, Babis Chalios wrote: > > This patchset implements the entropy leak reporting feature proposal [1] > > for virtio-rng devices. > > > > Entropy leaking (as defined in the specification proposal) ty

Re: [RFC PATCH 0/1] Implement entropy leak reporting for virtio-rng

2023-04-03 Thread Jason A. Donenfeld
On Mon, Apr 3, 2023 at 4:15 PM Jason A. Donenfeld wrote: > > Hi Babis, > > Why are you resending this? As I mentioned before, I'm going to move > forward in implementing this feature in a way that actually works with > the RNG. I'll use your RFC patch as a base, but

Re: [RFC PATCH 0/1] Implement entropy leak reporting for virtio-rng

2023-04-03 Thread Jason A. Donenfeld
Hi Babis, Why are you resending this? As I mentioned before, I'm going to move forward in implementing this feature in a way that actually works with the RNG. I'll use your RFC patch as a base, but I think beyond that, I can take it from here. Thanks, Jason

Re: [PATCH RFC 6/7] Revert "x86: return modified setup_data only if read as memory, not as file"

2023-02-09 Thread Jason A. Donenfeld
On Wed, Feb 08, 2023 at 04:12:51PM -0500, Michael S. Tsirkin wrote: > This reverts commit e935b735085dfa61d8e6d276b6f9e7687796a3c7. > > Fixes: e935b73508 ("x86: return modified setup_data only if read as memory, > not as file") > Signed-off-by: Michael S. Tsirkin > --- > include/hw/nvram/fw_cfg

Re: [PATCH] x86: temporarily remove all attempts to provide setup_data

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 08, 2023 at 06:31:20PM +, Daniel P. Berrangé wrote: > On Wed, Feb 08, 2023 at 07:26:05PM +0100, Jason A. Donenfeld wrote: > > On Wed, Feb 08, 2023 at 01:18:37PM -0500, Michael S. Tsirkin wrote: > > > On Wed, Feb 08, 2023 at 03:14:38PM -0300, Jason A. Donenfeld wro

Re: [PATCH] x86: temporarily remove all attempts to provide setup_data

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 08, 2023 at 01:18:37PM -0500, Michael S. Tsirkin wrote: > On Wed, Feb 08, 2023 at 03:14:38PM -0300, Jason A. Donenfeld wrote: > > On Wed, Feb 8, 2023 at 3:13 PM Michael S. Tsirkin wrote: > > > > > > On Wed, Feb 08, 2023 at 03:08:35PM -0300, Jason A. D

Re: [PATCH] x86: temporarily remove all attempts to provide setup_data

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 8, 2023 at 3:13 PM Michael S. Tsirkin wrote: > > On Wed, Feb 08, 2023 at 03:08:35PM -0300, Jason A. Donenfeld wrote: > > All attempts at providing setup_data have been made as an iteration on > > whatever was there before, stretching back to the original > >

Re: [PATCH qemu v3] x86: don't let decompressed kernel image clobber setup_data

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 8, 2023 at 2:54 PM Jason A. Donenfeld wrote: > > Hi Nathan (and MST), > > On Wed, Feb 8, 2023 at 2:45 PM Nathan Chancellor wrote: > > > > Hi Jason, > > > > On Fri, Dec 30, 2022 at 11:07:25PM +0100, Jason A. Donenfeld wrote: > > > The se

[PATCH] x86: temporarily remove all attempts to provide setup_data

2023-02-08 Thread Jason A. Donenfeld
: Dov Murik Cc: Tom Lendacky Cc: Gerd Hoffmann Cc: Daniel P. Berrangé Cc: Paolo Bonzini Cc: Richard Henderson Cc: H. Peter Anvin Cc: Philippe Mathieu-Daudé Cc: Nathan Chancellor Cc: Borislav Petkov Cc: Eric Biggers Signed-off-by: Jason A. Donenfeld --- hw/i386/microvm.c | 15 +

Re: [PATCH qemu v3] x86: don't let decompressed kernel image clobber setup_data

2023-02-08 Thread Jason A. Donenfeld
Hi Nathan (and MST), On Wed, Feb 8, 2023 at 2:45 PM Nathan Chancellor wrote: > > Hi Jason, > > On Fri, Dec 30, 2022 at 11:07:25PM +0100, Jason A. Donenfeld wrote: > > The setup_data links are appended to the compressed kernel image. Since > > the kernel image is typi

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 8, 2023 at 12:49 PM Dov Murik wrote: > /* >* Add the NUL terminator, some padding for the microvm cmdline fiddling >* hack, and then align to 16 bytes as a paranoia measure >*/ > cmdline_size = (strlen(machine->kernel_cmdline) + 1 + > VIRTIO_CMDLINE_TO

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 8, 2023 at 12:49 PM Dov Murik wrote: > Even if the DTB itself doesn't change and the Guest Owner could somehow add > it to the expected cmdline to calculate the hash, the current implementation > adds both the SetupData entry and the dtb itself to the cmdline. The > SetupData > entry

Re: [PATCH 2/2] x86: don't append setup_data to cmdline for SEV guests

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 8, 2023 at 12:38 PM Tom Lendacky wrote: > > On 2/7/23 16:48, Jason A. Donenfeld wrote: > > From: Dov Murik > > > > Modifying the cmdline by appending setup_data breaks measured boot with > > SEV and OVMF, and possibly signed boot. Previously this was

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 8, 2023 at 12:26 PM Tom Lendacky wrote: > However, is the change to the DTB check appropriate? Yes it is appropriate. The reason is that the first setup_data link is already conditionalized on sev: /* * If we're starting an encrypted VM, it will be OVMF based, which uses the

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-08 Thread Jason A. Donenfeld
On Wed, Feb 08, 2023 at 08:20:17AM -0500, Michael S. Tsirkin wrote: > On Wed, Feb 08, 2023 at 01:23:48PM +0200, Dov Murik wrote: > > Hi Michael, > > > > On 08/02/2023 11:11, Michael S. Tsirkin wrote: > > > On Tue, Feb 07, 2023 at 07:33:09PM -0300, Jason A. Donenfe

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-07 Thread Jason A. Donenfeld
Hi Tom, On Tue, Feb 7, 2023 at 8:21 PM Tom Lendacky wrote: > > On 2/7/23 15:45, Michael S. Tsirkin wrote: > > On Tue, Feb 07, 2023 at 08:41:16AM +, Dov Murik wrote: > >> Recent feature to supply RNG seed to the guest kernel modifies the > >> kernel command-line by adding extra data at its end

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-07 Thread Jason A. Donenfeld
On Tue, Feb 07, 2023 at 07:33:09PM -0300, Jason A. Donenfeld wrote: > On Tue, Feb 7, 2023 at 7:31 PM Michael S. Tsirkin wrote: > > > > On Tue, Feb 07, 2023 at 07:17:58PM -0300, Jason A. Donenfeld wrote: > > > On Tue, Feb 07, 2023 at 04:45:19PM -0500, Michael S. Tsirkin wr

[PATCH 1/2] x86: reset rng seed when reading cmdline, not kernel image

2023-02-07 Thread Jason A. Donenfeld
, change the re-randomization over to trigger when selecting the cmdline, rather than the kernel image. Fixes: eac7a7791bb6 ("x86: don't let decompressed kernel image clobber setup_data") Signed-off-by: Jason A. Donenfeld --- hw/i386/x86.c | 8 1 file changed, 4 insertions(+), 4

[PATCH 0/2] x86: fix fallout from switching setup_data from kernel image to cmdline

2023-02-07 Thread Jason A. Donenfeld
e RNG seed when selecting the cmdline. This short series fixes those up. Cc: "Michael S. Tsirkin" Cc: Dov Murik Cc: Tom Lendacky Cc: Gerd Hoffmann Cc: "Daniel P. Berrangé" Cc: Paolo Bonzini Cc: Richard Henderson Dov Murik (1): x86: don't append setup_data to cmdli

[PATCH 2/2] x86: don't append setup_data to cmdline for SEV guests

2023-02-07 Thread Jason A. Donenfeld
his was changed to the cmdline file instead, with the sev_enabled() check left out. Fixes: eac7a7791bb6 ("x86: don't let decompressed kernel image clobber setup_data") Reported-by: Tom Lendacky Signed-off-by: Dov Murik Signed-off-by: Jason A. Donenfeld --- hw/i386/x86.c | 4 ++--

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-07 Thread Jason A. Donenfeld
On Tue, Feb 7, 2023 at 7:31 PM Michael S. Tsirkin wrote: > > On Tue, Feb 07, 2023 at 07:17:58PM -0300, Jason A. Donenfeld wrote: > > On Tue, Feb 07, 2023 at 04:45:19PM -0500, Michael S. Tsirkin wrote: > > > On Tue, Feb 07, 2023 at 08:41:16AM +, Dov Murik wrote: >

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-07 Thread Jason A. Donenfeld
On Tue, Feb 07, 2023 at 04:45:19PM -0500, Michael S. Tsirkin wrote: > On Tue, Feb 07, 2023 at 08:41:16AM +, Dov Murik wrote: > > Recent feature to supply RNG seed to the guest kernel modifies the > > kernel command-line by adding extra data at its end; this breaks > > measured boot with SEV and

Re: [PATCH] x86: Don't add RNG seed to Linux cmdline for SEV guests

2023-02-07 Thread Jason A. Donenfeld
On Tue, Feb 07, 2023 at 08:41:16AM +, Dov Murik wrote: > Recent feature to supply RNG seed to the guest kernel modifies the > kernel command-line by adding extra data at its end; this breaks > measured boot with SEV and OVMF, and possibly signed boot. > > Specifically SEV doesn't miss this fea

Re: [PATCH] x86: fix q35 kernel measurements broken due to rng seeding

2023-02-01 Thread Jason A. Donenfeld
Hi James, On Wed, Feb 1, 2023, 15:39 James Bottomley wrote: > On Wed, 2023-02-01 at 12:51 -0500, Jason A. Donenfeld wrote: > > It's not a secret, but I have so little internet right now that I > > can't even load a webpage, and I'm on my phone, hence the short &g

Re: [PATCH] x86: fix q35 kernel measurements broken due to rng seeding

2023-02-01 Thread Jason A. Donenfeld
23, 10:24 James Bottomley wrote: > On Wed, 2023-02-01 at 10:10 -0500, Jason A. Donenfeld wrote: > > This is already fixed via the patch that MST just sent in his pull. > > So wait a few days for that to be merged and it'll be all set. > > > > No need for this pat

Re: [PATCH] x86: fix q35 kernel measurements broken due to rng seeding

2023-02-01 Thread Jason A. Donenfeld
This patch is not needed. It is already fixed in a pending pull. Do not merge. On Wed, Feb 1, 2023, 09:57 James Bottomley wrote: > On Wed, 2023-02-01 at 14:35 +, Daniel P. Berrangé wrote: > > On Wed, Feb 01, 2023 at 08:57:10AM -0500, James Bottomley wrote: > > > The origin commit for rng see

Re: [PATCH] x86: fix q35 kernel measurements broken due to rng seeding

2023-02-01 Thread Jason A. Donenfeld
This is already fixed via the patch that MST just sent in his pull. So wait a few days for that to be merged and it'll be all set. No need for this patch here. Do not merge. On Wed, Feb 1, 2023, 08:57 James Bottomley wrote: > The origin commit for rng seeding 67f7e426e5 ("hw/i386: pass RNG seed

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread Jason A. Donenfeld
On Mon, Jan 30, 2023 at 03:19:59PM -0500, Michael S. Tsirkin wrote: > From: "Jason A. Donenfeld" > > The setup_data links are appended to the compressed kernel image. Since > the kernel image is typically loaded at 0x10, setup_data lives at > `0x10 + compressed_

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread Jason A. Donenfeld
On Tue, Jan 31, 2023, 15:55 H. Peter Anvin wrote: > On January 30, 2023 12:19:14 PM PST, "Michael S. Tsirkin" > wrote: > >From: "Jason A. Donenfeld" > > > >The setup_data links are appended to the compressed kernel image. Since > >the kernel

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread Jason A. Donenfeld
On Mon, Jan 30, 2023 at 03:19:59PM -0500, Michael S. Tsirkin wrote: > From: "Jason A. Donenfeld" > > The setup_data links are appended to the compressed kernel image. Since > the kernel image is typically loaded at 0x10, setup_data lives at > `0x10 + compressed_

Re: [PATCH qemu v3] x86: don't let decompressed kernel image clobber setup_data

2023-01-23 Thread Jason A. Donenfeld
On Mon, Jan 23, 2023 at 6:12 AM Michael S. Tsirkin wrote: > > On Sun, Jan 22, 2023 at 08:21:30PM -0800, Eric Biggers wrote: > > Hi Michael, > > > > On Tue, Jan 10, 2023 at 12:50:42PM -0500, Michael S. Tsirkin wrote: > > > On Tue, Jan 10, 2023 at 04:34:49P

Re: [PATCH qemu v3] x86: don't let decompressed kernel image clobber setup_data

2023-01-10 Thread Jason A. Donenfeld
Hi Michael, Could you queue up this patch and mark it as a fix for 7.2.1? It is a straight-up bug fix for a 7.2 regression that's now affected several users. - It has two Tested-by tags on the thread. - hpa, the maintainer of the kernel side of this, confirmed on one of the various tributary th

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-31 Thread Jason A. Donenfeld
On Sat, Dec 31, 2022 at 03:24:32PM +0100, Borislav Petkov wrote: > On Sat, Dec 31, 2022 at 02:51:28PM +0100, Jason A. Donenfeld wrote: > > That failure is unrelated to the ident mapping issue Peter and > > I discussed. The original failure is described in the commit message: &g

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-31 Thread Jason A. Donenfeld
On Sat, Dec 31, 2022 at 02:48:12PM +0100, Borislav Petkov wrote: > On Sat, Dec 31, 2022 at 02:44:08PM +0100, Jason A. Donenfeld wrote: > > Are you using patch v1 minus the 62 MiB thing? > > No, I want to see the original failure - the one that prompted you to send > > http

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-31 Thread Jason A. Donenfeld
On Sat, Dec 31, 2022 at 02:40:59PM +0100, Borislav Petkov wrote: > On Fri, Dec 30, 2022 at 05:06:55PM -0800, H. Peter Anvin wrote: > > This needs to be something like: > > > > kernel_add_identity_map(sd_addr, sd_addr + sizeof(*sd)); > > kernel_add_identity_map(sd_addr + sizeof(*sd), > > sd_add

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-31 Thread Jason A. Donenfeld
On Sat, Dec 31, 2022 at 02:35:45PM +0100, Borislav Petkov wrote: > On Sat, Dec 31, 2022 at 01:54:50PM +0100, Jason A. Donenfeld wrote: > > Nothing special... `-kernel bzImage` should be enough to do it. Eric > > reported it, and then I was able to repro trivially. Sure you go

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-31 Thread Jason A. Donenfeld
On Fri, Dec 30, 2022 at 05:06:55PM -0800, H. Peter Anvin wrote: > > > On 12/30/22 14:10, Jason A. Donenfeld wrote: > > On Fri, Dec 30, 2022 at 01:58:39PM -0800, H. Peter Anvin wrote: > >> See the other thread fork. They have identified the problem already. > > &

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-31 Thread Jason A. Donenfeld
On Sat, Dec 31, 2022 at 10:48:16AM +0100, Borislav Petkov wrote: > On Fri, Dec 30, 2022 at 04:59:30PM +0100, Jason A. Donenfeld wrote: > > I'll attach a .config file. Apply the patch at the top of this thread to > > qemu, > > Hmm, so the patch at the top of this thread i

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
On Fri, Dec 30, 2022 at 01:58:39PM -0800, H. Peter Anvin wrote: > See the other thread fork. They have identified the problem already. Not sure I follow. Is there another thread where somebody worked out why this 62meg limit was happening? Note that I sent v2/v3, to fix the original problem in a

[PATCH qemu v3] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
x...@kernel.org Cc: Philippe Mathieu-Daudé Cc: H. Peter Anvin Cc: Borislav Petkov Cc: Eric Biggers Signed-off-by: Jason A. Donenfeld --- Changes v2->v3: - Fix mistakes in string handling. Changes v1->v2: - Append setup_data to cmdline instead of kernel image. hw/i386/microvm.c

Re: [PATCH qemu v2] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
On Fri, Dec 30, 2022 at 07:38:19PM +0100, Jason A. Donenfeld wrote: > The microvm machine has a gross hack where it fiddles with fw_cfg data > after the fact. So this hack is updated to account for this appending, > by reserving some bytes. This is a little derpy. I'll send a v3

[PATCH qemu v2] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
x...@kernel.org Cc: Philippe Mathieu-Daudé Cc: H. Peter Anvin Cc: Borislav Petkov Cc: Eric Biggers Signed-off-by: Jason A. Donenfeld --- hw/i386/microvm.c | 10 hw/i386/x86.c | 50 +++ hw/nvram/fw_cfg.c | 9 +++ in

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
On Wed, Dec 28, 2022 at 03:38:30PM +0100, Jason A. Donenfeld wrote: > The setup_data links are appended to the compressed kernel image. Since > the kernel image is typically loaded at 0x10, setup_data lives at > `0x10 + compressed_size`, which does not get relocated during the &

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
On Fri, Dec 30, 2022 at 6:01 PM Borislav Petkov wrote: > > On Fri, Dec 30, 2022 at 04:54:27PM +0100, Jason A. Donenfeld wrote: > > > Right, with CONFIG_X86_VERBOSE_BOOTUP=y in a guest here, it says: > > > > > > early console in extract_kernel > > > inpu

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
Er, .config attached now. .config Description: Binary data

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
Hi, On Wed, Dec 28, 2022 at 11:31:34PM -0800, H. Peter Anvin wrote: > On December 28, 2022 6:31:07 PM PST, "Jason A. Donenfeld" > wrote: > >Hi, > > > >Read this message in a fixed width text editor with a lot of columns. > > > >On Wed, Dec 28,

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-30 Thread Jason A. Donenfeld
On Thu, Dec 29, 2022 at 01:47:49PM +0100, Borislav Petkov wrote: > On Wed, Dec 28, 2022 at 11:31:34PM -0800, H. Peter Anvin wrote: > > As far as a crash... that sounds like a big and a pretty serious one at > > that. > > > > Could you let me know what kernel you are using and how *exactly* you ar

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-28 Thread Jason A. Donenfeld
Hi, Read this message in a fixed width text editor with a lot of columns. On Wed, Dec 28, 2022 at 03:58:12PM -0800, H. Peter Anvin wrote: > Glad you asked. > > So the kernel load addresses are parameterized in the kernel image > setup header. One of the things that are so parameterized are the s

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-28 Thread Jason A. Donenfeld
HELLO H. PETER ANVIN, E L L O On Wed, Dec 28, 2022 at 05:30:30PM +0100, Jason A. Donenfeld wrote: > > Fix looks good, glad you figured out the problem. > > I mean, kind of. The solution here sucks, especially given that in the > worst case, setup_data just gets dropped. I

Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-28 Thread Jason A. Donenfeld
On Wed, Dec 28, 2022 at 05:02:22PM +0100, Philippe Mathieu-Daudé wrote: > Hi Jason, > > On 28/12/22 15:38, Jason A. Donenfeld wrote: > > The setup_data links are appended to the compressed kernel image. Since > > the kernel image is typically loaded at 0x10, setup_data l

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-28 Thread Jason A. Donenfeld
On Wed, Dec 28, 2022 at 04:07:13AM +0100, Jason A. Donenfeld wrote: > On Tue, Dec 27, 2022 at 02:36:54PM +0100, Jason A. Donenfeld wrote: > > On Mon, Dec 26, 2022 at 05:57:30PM +0100, Jason A. Donenfeld wrote: > > > On Mon, Dec 26, 2022 at 03:43:04PM +0100, Jason A. Donenfeld wro

[PATCH qemu] x86: don't let decompressed kernel image clobber setup_data

2022-12-28 Thread Jason A. Donenfeld
clobbered. One caveat is that this only works for images less than around 64 megabytes, so just bail out in that case. This is unfortunate, but I don't currently have a way of fixing it. Cc: x...@kernel.org Signed-off-by: Jason A. Donenfeld --- hw/i386/x86.c | 30 ++

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-27 Thread Jason A. Donenfeld
On Tue, Dec 27, 2022 at 02:36:54PM +0100, Jason A. Donenfeld wrote: > On Mon, Dec 26, 2022 at 05:57:30PM +0100, Jason A. Donenfeld wrote: > > On Mon, Dec 26, 2022 at 03:43:04PM +0100, Jason A. Donenfeld wrote: > > > On Mon, Dec 26, 2022 at 03:24:07PM +0100, Jason A. Donenfeld

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-27 Thread Jason A. Donenfeld
On Mon, Dec 26, 2022 at 05:57:30PM +0100, Jason A. Donenfeld wrote: > On Mon, Dec 26, 2022 at 03:43:04PM +0100, Jason A. Donenfeld wrote: > > On Mon, Dec 26, 2022 at 03:24:07PM +0100, Jason A. Donenfeld wrote: > > > Hi, > > > > > > I'm currently stumped a

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-26 Thread Jason A. Donenfeld
On Mon, Dec 26, 2022 at 03:43:04PM +0100, Jason A. Donenfeld wrote: > On Mon, Dec 26, 2022 at 03:24:07PM +0100, Jason A. Donenfeld wrote: > > Hi, > > > > I'm currently stumped at the moment, so adding linux-mm@ and x86@. Still > > working on it though. Details of

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-26 Thread Jason A. Donenfeld
On Mon, Dec 26, 2022 at 03:24:07PM +0100, Jason A. Donenfeld wrote: > Hi, > > I'm currently stumped at the moment, so adding linux-mm@ and x86@. Still > working on it though. Details of where I'm at are below the quote below. > > On Sat, Dec 24, 2022 at 05:21:46AM +01

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-26 Thread Jason A. Donenfeld
Hi, I'm currently stumped at the moment, so adding linux-mm@ and x86@. Still working on it though. Details of where I'm at are below the quote below. On Sat, Dec 24, 2022 at 05:21:46AM +0100, Jason A. Donenfeld wrote: > On Sat, Dec 24, 2022 at 04:09:08AM +0100, Jason A. Donenfeld

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-23 Thread Jason A. Donenfeld
On Sat, Dec 24, 2022 at 04:09:08AM +0100, Jason A. Donenfeld wrote: > Hi Eric, > > Replying to you from my telephone, and I'm traveling the next two days, > but I thought I should mention some preliminary results right away from > doing some termux compiles: > > On

Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData

2022-12-23 Thread Jason A. Donenfeld
at 11:31:34AM +0200, Jason A. Donenfeld wrote: > > This reverts 3824e25db1 ("x86: disable rng seeding via setup_data"), but > > for 7.2 rather than 7.1, now that modifying setup_data is safe to do. > > > > Cc: Laurent Vivier > > Cc: Michael S. Tsirkin

Re: [PULL 00/30] target-arm queue

2022-10-26 Thread Jason A. Donenfeld
On Wed, Oct 26, 2022 at 10:49:18AM -0400, Stefan Hajnoczi wrote: > On Tue, 25 Oct 2022 at 12:51, Peter Maydell wrote: > > target-arm queue: > > * Implement FEAT_E0PD > > * Implement FEAT_HAFDBS > > This commit breaks CI: Ah, so when this is respun, there'll be an opportunity for Peter to pull

[PATCH v5] mips/malta: pass RNG seed via env var and re-randomize on reboot

2022-10-25 Thread Jason A. Donenfeld
Daudé Signed-off-by: Jason A. Donenfeld --- Changes v4->v5: - Calculate offset rather than using memmem for updating on reboot. hw/mips/malta.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 0e932988e0..7c3ad0974b 100644 --- a

Re: [PATCH v4 09/11] mips/malta: pass RNG seed via env var and re-randomize on reboot

2022-10-25 Thread Jason A. Donenfeld
Hi Peter, On Tue, Oct 25, 2022 at 6:47 PM Peter Maydell wrote: > So I didn't take this one patch, partly because I don't think No problem - I'm actually quite happy to finally have this one reviewed. I'll send you a follow up. > all our supported build platforms have memmem(), and partly > beca

qemu-devel@nongnu.org

2022-10-25 Thread Jason A. Donenfeld
On Tue, Oct 25, 2022 at 05:39:27PM +0100, Peter Maydell wrote: > On Tue, 25 Oct 2022 at 01:43, Jason A. Donenfeld wrote: > > > > When the system reboots, the rng seed that QEMU passes should be > > re-randomized, so that the new boot gets a new seed. This series wire

Re: [PATCH v4 01/11] reset: allow registering handlers that aren't called by snapshot loading

2022-10-25 Thread Jason A. Donenfeld
On Tue, Oct 25, 2022 at 03:58:06PM +0200, Jason A. Donenfeld wrote: > On Tue, Oct 25, 2022 at 02:54:01PM +0100, Peter Maydell wrote: > > On Tue, 25 Oct 2022 at 13:50, Jason A. Donenfeld wrote: > > > > > > On Tue, Oct 25, 2022 at 2:42 PM Jason A. Donenfeld > >

Re: [PATCH v4 01/11] reset: allow registering handlers that aren't called by snapshot loading

2022-10-25 Thread Jason A. Donenfeld
On Tue, Oct 25, 2022 at 02:54:01PM +0100, Peter Maydell wrote: > On Tue, 25 Oct 2022 at 13:50, Jason A. Donenfeld wrote: > > > > On Tue, Oct 25, 2022 at 2:42 PM Jason A. Donenfeld wrote: > > > > > > On Tue, Oct 25, 2022 at 2:34 PM Peter Maydell > > > w

Re: [PATCH v4 02/11] device-tree: add re-randomization helper function

2022-10-25 Thread Jason A. Donenfeld
On Tue, Oct 25, 2022 at 3:30 PM Philippe Mathieu-Daudé wrote: > > On 25/10/22 02:43, Jason A. Donenfeld wrote: > > When the system reboots, the rng-seed that the FDT has should be > > re-randomized, so that the new boot gets a new seed. Several > > architectures requir

Re: [PATCH v4 01/11] reset: allow registering handlers that aren't called by snapshot loading

2022-10-25 Thread Jason A. Donenfeld
On Tue, Oct 25, 2022 at 2:34 PM Peter Maydell wrote: > > On Tue, 25 Oct 2022 at 13:33, Jason A. Donenfeld wrote: > > > > On Tue, Oct 25, 2022 at 2:26 PM Peter Maydell > > wrote: > > > > > > On Tue, 25 Oct 2022 at 13:09, Jason A. Donenfeld wrote: >

Re: [PATCH v4 01/11] reset: allow registering handlers that aren't called by snapshot loading

2022-10-25 Thread Jason A. Donenfeld
On Tue, Oct 25, 2022 at 2:26 PM Peter Maydell wrote: > > On Tue, 25 Oct 2022 at 13:09, Jason A. Donenfeld wrote: > > > > Hi Markus, > > > > On Tue, Oct 25, 2022 at 08:11:51AM +0200, Markus Armbruster wrote: > > > > diff --git a/qapi/run-state.json b/qa

Re: [PATCH v4 01/11] reset: allow registering handlers that aren't called by snapshot loading

2022-10-25 Thread Jason A. Donenfeld
Hi Markus, On Tue, Oct 25, 2022 at 08:11:51AM +0200, Markus Armbruster wrote: > > diff --git a/qapi/run-state.json b/qapi/run-state.json > > index 49989d30e6..e44c0de914 100644 > > --- a/qapi/run-state.json > > +++ b/qapi/run-state.json > > @@ -86,12 +86,15 @@ > > # ignores --no

Re: [PATCH v3 1/8] reset: allow registering handlers that aren't called by snapshot loading

2022-10-24 Thread Jason A. Donenfeld
On Mon, Oct 24, 2022 at 7:40 PM Markus Armbruster wrote: > > Peter Maydell writes: > > > On Mon, 24 Oct 2022 at 14:20, Markus Armbruster wrote: > >> > >> Peter Maydell writes: > >> > >> > On Mon, 24 Oct 2022 at 13:28, Markus Armbruster > >> > wrote: > >> >> > >> >> Peter Maydell writes: > >>

[PATCH v4 10/11] openrisc: re-randomize rng-seed on reboot

2022-10-24 Thread Jason A. Donenfeld
-off-by: Jason A. Donenfeld --- hw/openrisc/boot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/openrisc/boot.c b/hw/openrisc/boot.c index 128ccbcba2..007e80cd5a 100644 --- a/hw/openrisc/boot.c +++ b/hw/openrisc/boot.c @@ -14,6 +14,7 @@ #include "hw/openrisc/boot.h" #inclu

[PATCH v4 08/11] mips/boston: re-randomize rng-seed on reboot

2022-10-24 Thread Jason A. Donenfeld
: Paul Burton Cc: Philippe Mathieu-Daudé Signed-off-by: Jason A. Donenfeld --- hw/mips/boston.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index d2ab9da1a0..cab63f43bf 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -41,6 +41,7 @@ #include

[PATCH v4 04/11] arm: re-randomize rng-seed on reboot

2022-10-24 Thread Jason A. Donenfeld
-...@nongnu.org Signed-off-by: Jason A. Donenfeld --- hw/arm/boot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index b0b92af188..b106f31468 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -683,6 +683,8 @@ int arm_load_dtb(hwaddr addr, const struct

[PATCH v4 11/11] rx: re-randomize rng-seed on reboot

2022-10-24 Thread Jason A. Donenfeld
-off-by: Jason A. Donenfeld --- hw/rx/rx-gdbsim.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c index 8ffe1b8035..47c17026c7 100644 --- a/hw/rx/rx-gdbsim.c +++ b/hw/rx/rx-gdbsim.c @@ -25,6 +25,7 @@ #include "hw/rx/rx62n.h" #include "

[PATCH v4 03/11] x86: do not re-randomize RNG seed on snapshot load

2022-10-24 Thread Jason A. Donenfeld
Snapshot loading is supposed to be deterministic, so we shouldn't re-randomize the various seeds used. Signed-off-by: Jason A. Donenfeld --- hw/i386/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 1148f70c03..bd50a064a3 100644

[PATCH v4 06/11] m68k/virt: do not re-randomize RNG seed on snapshot load

2022-10-24 Thread Jason A. Donenfeld
Snapshot loading is supposed to be deterministic, so we shouldn't re-randomize the various seeds used. Signed-off-by: Jason A. Donenfeld --- hw/m68k/virt.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 89c41

[PATCH v4 02/11] device-tree: add re-randomization helper function

2022-10-24 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Several architectures require this functionality, so export a function for injecting a new seed into the given FDT. Cc: Alistair Francis Cc: David Gibson Signed-off-by: Jason A

[PATCH v4 09/11] mips/malta: pass RNG seed via env var and re-randomize on reboot

2022-10-24 Thread Jason A. Donenfeld
Daudé Signed-off-by: Jason A. Donenfeld --- hw/mips/malta.c | 25 + 1 file changed, 25 insertions(+) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 0e932988e0..d337de920c 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -26,6 +26,7 @@ #include "qemu/units.h&

  1   2   3   4   5   >