[PATCH 1/2] target/hexagon: Remove unused TCG temporary from predicated loads

2021-10-02 Thread Philippe Mathieu-Daudé
The gen_pred_cancel() function, introduced in commit a646e99cb90 (Hexagon macros) doesn't use the 'one' TCG temporary; remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/hexagon/macros.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/hexagon/macros.h b/target/hexagon/macros

[PATCH 2/2] target/hexagon: Use tcg_constant_*

2021-10-02 Thread Philippe Mathieu-Daudé
Replace uses of tcg_const_* with the allocate and free close together. Inspired-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/hexagon/gen_tcg.h| 6 ++--- target/hexagon/macros.h | 3 +-- target/hexagon/genptr.c | 39 +++-

[PATCH 0/2] target/hexagon: Use tcg_constant_*

2021-10-02 Thread Philippe Mathieu-Daudé
Replace temporary TCG registers by tcg_constant_*() when possible. Philippe Mathieu-Daudé (2): target/hexagon: Remove unused TCG temporary from predicated loads target/hexagon: Use tcg_constant_* target/hexagon/gen_tcg.h| 6 ++--- target/hexagon/macros.h | 5 + target/h

[PATCH] target/mips: Remove unused register from MSA 2R/2RF instruction format

2021-10-02 Thread Philippe Mathieu-Daudé
MSA 2R/2RF instructions don't use any target vector register. Remove the unused TCG temporaries. Fixes: cbe50b9a8e7 ("target-mips: add MSA VEC/2R format instructions") Fixes: 3bdeb68866e ("target-mips: add MSA 2RF format instructions") Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/ms

Re: [PATCH 3/3] target/nios2: Use tcg_constant_*

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/3/21 01:30, Philippe Mathieu-Daudé wrote: > Replace uses of tcg_const_* with the allocate and free close together. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/nios2/translate.c | 14 -- > 1 file changed, 4 insertions(+), 10 deletions(-) > @@ -448,9 +445,8 @@ stati

[PATCH 3/3] target/nios2: Use tcg_constant_*

2021-10-02 Thread Philippe Mathieu-Daudé
Replace uses of tcg_const_* with the allocate and free close together. Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/translate.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 8524a2f6dd8..8d4

[PATCH 1/3] target/nios2: Replace load_zero() by zero constant in DisasContext

2021-10-02 Thread Philippe Mathieu-Daudé
Instead of using a temporary for $zero, keep a reference to the constant pool. Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/translate.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 08d7a

[PATCH 2/3] target/nios2: Use DisasContext::zero constant instead of temporary

2021-10-02 Thread Philippe Mathieu-Daudé
We already have a register holding the zero value in the constant pool, use it instead of a temporary. Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c ind

[PATCH 0/3] target/nios2: Use tcg_constant_*

2021-10-02 Thread Philippe Mathieu-Daudé
Replace temporary TCG registers by tcg_constant_*() when possible. Philippe Mathieu-Daudé (3): target/nios2: Replace load_zero() by zero constant in DisasContext target/nios2: Use DisasContext::zero constant instead of temporary target/nios2: Use tcg_constant_* target/nios2/translate.c | 3

[PATCH 1/2] hw/adc: Add basic Aspeed ADC model

2021-10-02 Thread pdel
From: Andrew Jeffery This model implements enough behaviour to do basic functionality tests such as device initialisation and read out of dummy sample values. The sample value generation strategy is similar to the STM ADC already in the tree. This patch was originally created by Andrew Jeffery,

[PATCH 2/2] hw/arm: Integrate ADC model into Aspeed SoC

2021-10-02 Thread pdel
From: Andrew Jeffery Signed-off-by: Andrew Jeffery Signed-off-by: Cédric Le Goater Signed-off-by: Peter Delevoryas --- hw/arm/aspeed_ast2600.c | 11 +++ hw/arm/aspeed_soc.c | 11 +++ include/hw/arm/aspeed_soc.h | 2 ++ 3 files changed, 24 insertions(+) diff --git

[PATCH 0/2] hw/adc: Add basic Aspeed ADC model

2021-10-02 Thread pdel
From: Peter Delevoryas Following up from https://lore.kernel.org/qemu-devel/20210930004235.1656003-1-p...@fb.com/ This is a resubmission of Andrew Jeffery's ADC model, but with the registers converted from typed-member-fields to a regs[] array. Otherwise, it should be pretty much equivalent. R

[PATCH] hw/misc: applesmc: use host osk as default on macs

2021-10-02 Thread Pedro Tôrres
When running on a Mac, QEMU is able to get the host OSK and use it as the default value for the AppleSMC device. The OSK query operation doesn't require administrator privileges and can be executed by any user on the system. This patch is based on open-source code from Apple, just like the implemen

Re: [PATCH] target/mips: remove gen_mfc0_load64() and use tcg_gen_ld32s_tl()

2021-10-02 Thread Richard Henderson
On 10/2/21 9:37 AM, Philippe Mathieu-Daudé wrote: -static inline void gen_mfc0_load64(TCGv arg, target_ulong off) -{ -tcg_gen_ld_tl(arg, cpu_env, off); -tcg_gen_ext32s_tl(arg, arg); -} - static inline void gen_mtc0_store32(TCGv arg, target_ulong off) { TCGv_i32 t0 = tcg_temp_new

Re: [RFC PATCH 0/4] Misc OHCI patches

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, BALATON Zoltan wrote: Interestingly on pegasos2 which has UHCI instead of OHCI MorphOS does not even correctly detect the emulated usb-audio device and trying to get info makes it freeze so looks like the UHCI model may also have some problems of its own. So it's not the U

Re: [PATCH] target/mips: remove gen_mfc0_load64() and use tcg_gen_ld32s_tl()

2021-10-02 Thread Richard Henderson
On 10/2/21 9:37 AM, Philippe Mathieu-Daudé wrote: From: Leon Alrae Remove misleading gen_mfc0_load64() which actually loads 32 or 64 bits depending whether MIPS32 or MIPS64 and also replace the pair of tcg_gen_ld_tl() + tcg_gen_ext32s_tl() with single tcg_gen_ld32s_tl(). Patch partly generated

Re: [PULL 00/13] QAPI patches patches for 2021-10-02

2021-10-02 Thread Richard Henderson
On 10/2/21 5:56 AM, Markus Armbruster wrote: The following changes since commit 5f992102383ed8ed97076548e1c897c7034ed8a4: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2021-10-01 13:44:36 -0400) are available in the Git repository at: git://repo.or.cz/qe

Re: [PATCH] target/mips: remove gen_mfc0_load64() and use tcg_gen_ld32s_tl()

2021-10-02 Thread Jiaxun Yang
在 2021/10/2 14:37, Philippe Mathieu-Daudé 写道: From: Leon Alrae Remove misleading gen_mfc0_load64() which actually loads 32 or 64 bits depending whether MIPS32 or MIPS64 and also replace the pair of tcg_gen_ld_tl() + tcg_gen_ext32s_tl() with single tcg_gen_ld32s_tl(). Patch partly generated

[PATCH v3 2/3] hw/mips/boston: Allow loading elf kernel and dtb

2021-10-02 Thread Jiaxun Yang
ELF kernel allows us debugging much easier with DWARF symbols. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé -- v2: Use g_autofree v3: Remove unused kernel_low and uint64_t cast (BALATON) --- hw/mips/boston.c | 35 +++ 1 file changed, 31 insertio

[PATCH v3 1/3] hw/mips/boston: Massage memory map information

2021-10-02 Thread Jiaxun Yang
Use memmap array to uinfy address of memory map. That would allow us reuse address information for FDT generation. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé -- v2: Fix minor style issue, fix uart map size --- hw/mips/boston.c | 95 ---

[PATCH v3 0/3] hw/mips/boston: ELF kernel support

2021-10-02 Thread Jiaxun Yang
Jiaxun Yang (3): hw/mips/boston: Massage memory map information hw/mips/boston: Allow loading elf kernel and dtb hw/mips/boston: Add FDT generator hw/mips/boston.c | 348 +++ 1 file changed, 320 insertions(+), 28 deletions(-) -- 2.30.2

[PATCH v3 3/3] hw/mips/boston: Add FDT generator

2021-10-02 Thread Jiaxun Yang
Generate FDT on our own if no dtb argument supplied. Avoid introducing unused device in FDT with user supplied dtb. Signed-off-by: Jiaxun Yang -- v2: Address f4bug cmments (Thanks!) --- hw/mips/boston.c | 234 +-- 1 file changed, 226 insertions(+), 8 d

Re: [RFC PATCH 0/4] Misc OHCI patches

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Howard Spoelstra wrote: Both have issues communicating with endpoint 4 (the hid controls volume up/down and mute). Endpoint 1 should receive the isochronous audio stream, but never does. After some experimentation with unplugging/plugging the headset and probing the usb stack

Re: [PATCH] docs/devel: memory: Document MemoryRegionOps requirement

2021-10-02 Thread Bin Meng
On Thu, Sep 9, 2021 at 4:17 AM Philippe Mathieu-Daudé wrote: > > On 9/8/21 8:50 PM, Peter Xu wrote: > > On Mon, Sep 06, 2021 at 03:01:54PM +0200, Philippe Mathieu-Daudé wrote: > >> On 9/6/21 2:20 PM, Bin Meng wrote: > >>> It's been a requirement that at least one function pointer for read > >>> an

Re: [RFC PATCH 0/4] Misc OHCI patches

2021-10-02 Thread BALATON Zoltan
On Fri, 1 Oct 2021, BALATON Zoltan wrote: Posted as RFC because it's unfinfished and untested as there seems to be some regression with mac99 so it does not boot for me for some reason I haven't debugged yet. Hope Howard can test it and see if it changes any of the traces seen before. I've now

Re: [PATCH v3 39/41] target/sparc: Make sparc_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for sparc. > > This makes all of the code in mmu_helper.c sysemu only, so remove > the ifdefs and move the file to sparc_softmmu_ss. Remove the code > from cpu_loop that handled TT_DFAULT and TT_TFAULT.

Re: [PATCH v3 41/41] accel/tcg: Restrict TCGCPUOps::tlb_fill() to sysemu

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > We have replaced tlb_fill with record_sigsegv for user mod. Typo "user mode"? > Move the declaration to restrict it to system emulation. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > include/hw/core/tcg-cpu-ops.

Re: [PATCH v3 40/41] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for xtensa. > Remove the code from cpu_loop that raised SIGSEGV. > > Cc: Max Filippov > Signed-off-by: Richard Henderson > --- > target/xtensa/cpu.h | 2 +- > linux-user/xtensa/cpu_loop.c |

Re: [PATCH v3 35/41] target/riscv: Make riscv_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for riscv. > Remove the code from cpu_loop that raised SIGSEGV. > > Cc: qemu-ri...@nongnu.org > Signed-off-by: Richard Henderson > --- > linux-user/riscv/cpu_loop.c | 7 --- > target/riscv/cpu.c

Re: [PATCH v3 33/41] target/openrisc: Make openrisc_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for openrisc. > This makes all of the code in mmu.c sysemu only, so remove > the ifdefs and move the file to openrisc_softmmu_ss. > Remove the code from cpu_loop that handled EXCP_DPF. > > Cc: Stafford Ho

Re: [PATCH v3 31/41] target/nios2: Implement nios2_cpu_record_sigsegv

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Because the linux-user kuser page handling is currently implemented > by detecting magic addresses in the unnamed 0xaa trap, we cannot > simply remove nios2_cpu_tlb_fill and rely on the fallback code. > > Signed-off-by: Richard Henderson > --- > targe

Re: [PATCH v3 30/41] target/mips: Make mips_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for mips linux-user. > This means we can remove tcg/user/tlb_helper.c entirely. > Remove the code from cpu_loop that raised SIGSEGV. > > Signed-off-by: Richard Henderson > --- > target/mips/tcg/tcg-inte

Re: [PATCH v3 28/41] target/m68k: Make m68k_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for m68k-linux-user. > Remove the code from cpu_loop that handled EXCP_ACCESS. > > Signed-off-by: Richard Henderson > --- > linux-user/m68k/cpu_loop.c | 10 -- > target/m68k/cpu.c | 2

Re: [PATCH v3 22/41] target/arm: Use cpu_loop_exit_segv for mte tag lookup

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Use the new os interface for raising the exception, > rather than calling arm_cpu_tlb_fill directly. > > Signed-off-by: Richard Henderson > --- > target/arm/mte_helper.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Phili

Re: [PATCH v3 21/41] target/alpha: Make alpha_cpu_tlb_fill sysemu only

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > The fallback code in raise_sigsegv is sufficient for alpha-linux-user. Renamed to TCGCPUOps.record_sigsegv in patch #19 of this series. Otherwise: Reviewed-by: Philippe Mathieu-Daudé > Remove the code from cpu_loop that handled EXCP_MMFAULT. > > Sig

Re: [PATCH v3 11/41] linux-user/host/arm: Populate host_signal.h

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Split host_signal_pc and host_signal_write out of user-exec.c. > Drop the *BSD code, to be re-created under bsd-user/ later. > > Signed-off-by: Richard Henderson > --- > linux-user/host/arm/host-signal.h | 30 - > accel/tcg/user-ex

Re: [PATCH v3 10/41] linux-user/host/sparc: Populate host_signal.h

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/1/21 19:11, Richard Henderson wrote: > Split host_signal_pc and host_signal_write out of user-exec.c. > Drop the *BSD code, to be re-created under bsd-user/ later. > Drop the Solais code as completely unused. Typo 'Solaris'. > > Signed-off-by: Richard Henderson > --- > linux-user/host/sp

Re: [RFC PATCH 0/4] Misc OHCI patches

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Howard Spoelstra wrote: Hi all, I've booted Fedora12 and MacOS 9.2/OSX10.4 ppc with these patches applied. All boot OK. (Fedora12 requires -mac99,via=pmu. Here there seems to be some interference with the kbd, due to via=pmu presenting usb mouse and kdb to the guest. So I cou

Re: [PATCH 12/12] q800: wire macfb IRQ to separate video interrupt on VIA2

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 13:00, Mark Cave-Ayland wrote: > Whilst the in-built Quadra 800 framebuffer exists within the Nubus address > space for slot 9, it has its own dedicated interrupt on VIA2. Force the > macfb device to occupy slot 9 in the q800 machine and wire its IRQ to the > separate video interrupt sin

Re: [PATCH 07/12] macfb: add qdev property to specify display type

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 13:00, Mark Cave-Ayland wrote: > Since the available resolutions and colour depths are determined by the > attached > display type, add a qdev property to allow the display type to be specified. > > The main resolutions of interest are high resolution 1152x870 with 8-bit > colour > an

Re: [PATCH 05/12] macfb: add trace events for reading and writing the control registers

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 13:00, Mark Cave-Ayland wrote: > Signed-off-by: Mark Cave-Ayland > --- > hw/display/macfb.c | 8 +++- > hw/display/trace-events | 4 > 2 files changed, 11 insertions(+), 1 deletion(-) > @@ -289,7 +290,10 @@ static uint64_t macfb_ctrl_read(void *opaque, >

Re: [PATCH 04/12] macfb: use memory_region_init_ram() in macfb_common_realize() for the framebuffer

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 12:59, Mark Cave-Ayland wrote: > Currently macfb_common_realize() defines the framebuffer RAM memory region as > being non-migrateable but then immediately registers it for migration. Replace > memory_region_init_ram_nomigrate() with memory_region_init_ram() which is > clearer > and doe

Re: [PATCH 02/12] macfb: fix invalid object reference in macfb_common_realize()

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 12:59, Mark Cave-Ayland wrote: > During realize memory_region_init_ram_nomigrate() is used to initialise the > RAM > memory region used for the framebuffer but the owner object reference is > incorrect since MacFbState is a typedef and not a QOM type. > > Change the memory region owner

Re: [PATCH 01/12] macfb: handle errors that occur during realize

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 12:59, Mark Cave-Ayland wrote: > Make sure any errors that occur within the macfb realize chain are detected > and handled correctly to prevent crashes and to ensure that error messages are > reported back to the user. > > Signed-off-by: Mark Cave-Ayland > --- > hw/display/macfb.c | 1

Re: [PATCH 2/2] nubus-device: ensure that name is freed after use in nubus_device_realize()

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 14:31, Mark Cave-Ayland wrote: > Coverity points out that there is memory leak because name is never freed > after > use in nubus_device_realize(). > > Fixes: Coverity CID 1464062 > Signed-off-by: Mark Cave-Ayland > --- > hw/nubus/nubus-device.c | 1 + > 1 file changed, 1 insertion(+

Re: [PATCH 1/2] nubus.h: add ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE

2021-10-02 Thread Philippe Mathieu-Daudé
On 10/2/21 14:31, Mark Cave-Ayland wrote: > Coverity thinks that the slot_offset multiplications in nubus_device_realize() > might overflow because the resulting hwaddr is 64-bit whilst the > multiplication > is only done at 32-bits. > > Add an explicit ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUB

[PATCH] target/mips: remove gen_mfc0_load64() and use tcg_gen_ld32s_tl()

2021-10-02 Thread Philippe Mathieu-Daudé
From: Leon Alrae Remove misleading gen_mfc0_load64() which actually loads 32 or 64 bits depending whether MIPS32 or MIPS64 and also replace the pair of tcg_gen_ld_tl() + tcg_gen_ext32s_tl() with single tcg_gen_ld32s_tl(). Patch partly generated using the following spatch script: @@ expr

Re: [RFC PATCH: v3 1/2] add mi device in qemu

2021-10-02 Thread Padmakar Kalghatgi
On Wed, Sep 29, 2021 at 06:37:54AM +0200, Klaus Jensen wrote: On Aug 3 12:54, Padmakar Kalghatgi wrote: From: padmakar This patch contains the implementation of certain commands of nvme-mi specification.The MI commands are useful to manage/configure/monitor the device.Eventhough the MI comman

Re: [PATCH v3 6/6] tests/qapi-schema: Test cases for aliases

2021-10-02 Thread Markus Armbruster
Kevin Wolf writes: > Am 17.09.2021 um 10:26 hat Markus Armbruster geschrieben: [...] >> >> We actually require much less: for QMP chardev-add, we need >> >> 'data.addr.data.FOO' and nothing else, and for CLI -chardev, we need >> >> 'FOO' and nothing else (I think). The unneeded ones become acc

Re: hexagon container update

2021-10-02 Thread Richard Henderson
On 10/1/21 1:59 PM, Brian Cain wrote: If there's any trust concerns we can verify the download in the dockerfile using the hash file for the tarball and/or the gpg signature. That's true, I should have thought of that. r~

[PATCH v3 20/22] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot

2021-10-02 Thread Philippe Mathieu-Daudé
From: Dov Murik Add the sev_add_kernel_loader_hashes function to calculate the hashes of the kernel/initrd/cmdline and fill a designated OVMF encrypted hash table area. For this to work, OVMF must support an encrypted area to place the data which is advertised via a special GUID in the OVMF rese

[PATCH v3 18/22] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev() & hmp_info_sev()() from monitor.c to sev.c and make sev_get_info() static. We don't need the stub anymore, remove it. Add a stub for hmp_info_sev(). Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 3 --- target/i386/monitor.c | 38 +

[PATCH v3 15/22] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_sev_inject_launch_secret() from monitor.c to sev.c and make sev_inject_launch_secret() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/monitor.c | 31 --- target/i386/sev-sysemu-stub.c | 6 +++-

[PATCH v3 22/22] MAINTAINERS: Cover AMD SEV files

2021-10-02 Thread Philippe Mathieu-Daudé
Add an entry to list SEV-related files. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 50435b8d2f5..733a5201e76 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3038,6 +3038,13 @@ F: hw/core/clock-vms

[PATCH v3 13/22] target/i386/sev: Remove stubs by using code elision

2021-10-02 Thread Philippe Mathieu-Daudé
Only declare sev_enabled() and sev_es_enabled() when CONFIG_SEV is set, to allow the compiler to elide unused code. Remove unnecessary stubs. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/sev.h| 14 +- target/i386/sev_i386.h | 3 --- target/i386/cpu.c | 16

[PATCH v3 21/22] x86/sev: generate SEV kernel loader hashes in x86_load_linux

2021-10-02 Thread Philippe Mathieu-Daudé
From: Dov Murik If SEV is enabled and a kernel is passed via -kernel, pass the hashes of kernel/initrd/cmdline in an encrypted guest page to OVMF for SEV measured boot. Co-developed-by: James Bottomley Signed-off-by: James Bottomley Signed-off-by: Dov Murik Reviewed-by: Daniel P. Berrangé Me

[PATCH v3 11/22] target/i386/sev: Restrict SEV to system emulation

2021-10-02 Thread Philippe Mathieu-Daudé
SEV is irrelevant on user emulation, so restrict it to sysemu. Some stubs are still required because used in cpu.c by x86_register_cpudef_types(), so move the sysemu specific stubs to sev-sysemu-stub.c instead. This will allow us to simplify monitor.c (which is not available in user emulation) in t

[PATCH v3 17/22] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev_launch_measure() from monitor.c to sev.c and make sev_get_launch_measurement() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 1 - target/i386/monitor.c | 17 - target/i386/s

[PATCH v3 16/22] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev_capabilities() from monitor.c to sev.c and make sev_get_capabilities() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 1 - target/i386/monitor.c | 5 - target/i386/sev-sysemu-stub.c | 4 +

[PATCH v3 06/22] target/i386/cpu: Add missing 'qapi/error.h' header

2021-10-02 Thread Philippe Mathieu-Daudé
Commit 00b81053244 ("target-i386: Remove assert_no_error usage") forgot to add the "qapi/error.h" for &error_abort, add it now. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH v3 09/22] target/i386/sev: Mark unreachable code with g_assert_not_reached()

2021-10-02 Thread Philippe Mathieu-Daudé
The unique sev_encrypt_flash() invocation (in pc_system_flash_map) is protected by the "if (sev_enabled())" check, so is not reacheable. Replace the abort() call in sev_es_save_reset_vector() by g_assert_not_reached() which meaning is clearer. Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mat

[PATCH v3 14/22] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c

2021-10-02 Thread Philippe Mathieu-Daudé
Move qmp_query_sev_attestation_report() from monitor.c to sev.c and make sev_get_attestation_report() static. We don't need the stub anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h| 2 -- target/i386/monitor.c | 6 -- target/i386/sev-sys

[PATCH v3 04/22] target/i386/kvm: Restrict SEV stubs to x86 architecture

2021-10-02 Thread Philippe Mathieu-Daudé
SEV is x86-specific, no need to add its stub to other architectures. Move the stub file to target/i386/kvm/. Signed-off-by: Philippe Mathieu-Daudé --- {accel => target/i386}/kvm/sev-stub.c | 0 accel/kvm/meson.build | 1 - target/i386/kvm/meson.build | 2 ++ 3 files cha

Re: [PULL v2 00/33] x86 and misc changes for 2021-09-28

2021-10-02 Thread Richard Henderson
On 10/2/21 6:09 AM, Peter Maydell wrote: On Sat, 2 Oct 2021 at 01:41, Richard Henderson wrote: On 9/30/21 10:57 AM, Paolo Bonzini wrote: The following changes since commit ba0fa56bc06e563de68d2a2bf3ddb0cfea1be4f9: Merge remote-tracking branch 'remotes/vivier/tags/q800-for-6.2-pull-reque

[PATCH v3 10/22] target/i386/sev: sev_get_attestation_report use g_autofree

2021-10-02 Thread Philippe Mathieu-Daudé
From: "Dr. David Alan Gilbert" Removes a whole bunch of g_free's and a goto. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Reviewed-by: Brijesh Singh Message-Id: <20210603113017.34922-1-dgilb...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev.c | 11 +

[PATCH v3 07/22] target/i386/sev_i386.h: Remove unused headers

2021-10-02 Thread Philippe Mathieu-Daudé
Declarations don't require these headers, remove them. Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 4 target/i386/sev-stub.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h

[PATCH v3 02/22] qapi/misc-target: Group SEV QAPI definitions

2021-10-02 Thread Philippe Mathieu-Daudé
There is already a section with various SEV commands / types, so move the SEV guest attestation together. Signed-off-by: Philippe Mathieu-Daudé --- qapi/misc-target.json | 80 +-- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/qapi/misc-ta

[PATCH v3 19/22] monitor: Restrict 'info sev' to x86 targets

2021-10-02 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/monitor/hmp-target.h | 1 + include/monitor/hmp.h | 1 - target/i386/sev-sysemu-stub.c | 2 +- target/i386/sev.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/monitor/hmp-target.h b/include/mon

[PATCH v3 01/22] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines

2021-10-02 Thread Philippe Mathieu-Daudé
Wrap long lines before 70 characters for legibility. Suggested-by: Markus Armbruster Reviewed-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- qapi/misc-target.json | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qapi/misc-target.json b/qap

[PATCH v3 08/22] target/i386/sev: Remove sev_get_me_mask()

2021-10-02 Thread Philippe Mathieu-Daudé
Unused dead code makes review harder, so remove it. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev_i386.h | 1 - target/i386/sev-stub.c | 5 - target/i386/sev.c | 9 - 3 files changed, 15 deletions(-) di

[PATCH v3 03/22] target/i386/kvm: Introduce i386_softmmu_kvm Meson source set

2021-10-02 Thread Philippe Mathieu-Daudé
Introduce the i386_softmmu_kvm Meson source set to be able to add features dependent on CONFIG_KVM. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/meson.build | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/i386/kvm/meson.build b/target/i386/kvm/meson.b

[PATCH v3 12/22] target/i386/sev: Declare system-specific functions in 'sev_i386.h'

2021-10-02 Thread Philippe Mathieu-Daudé
While prefixed with sysemu, 'sysemu/sev.h' contains the architecture specific declarations. The system specific parts are declared in 'sev_i386.h'. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/sev.h | 6 -- target/i386/sev_i386.h | 7 +++ hw/i386/pc_sysfw.c | 2 +- 3 fi

[PATCH v3 05/22] target/i386/monitor: Return QMP error when SEV is disabled in build

2021-10-02 Thread Philippe Mathieu-Daudé
If the management layer tries to inject a secret, it gets an empty response in case the binary built without SEV: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 } } { "return": { } } Make it clearer

[PATCH v3 00/22] target/i386/sev: Housekeeping SEV + measured Linux SEV guest

2021-10-02 Thread Philippe Mathieu-Daudé
Hi, While testing James & Dov patch: https://www.mail-archive.com/qemu-devel@nongnu.org/msg810571.html I wasted some time trying to figure out how OVMF was supposed to behave until realizing the binary I was using was built without SEV support... Then wrote this series to help other developers to

[PATCH 1/2] nubus.h: add ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE

2021-10-02 Thread Mark Cave-Ayland
Coverity thinks that the slot_offset multiplications in nubus_device_realize() might overflow because the resulting hwaddr is 64-bit whilst the multiplication is only done at 32-bits. Add an explicit ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE to ensure that the multiplication is

[PATCH 2/2] nubus-device: ensure that name is freed after use in nubus_device_realize()

2021-10-02 Thread Mark Cave-Ayland
Coverity points out that there is memory leak because name is never freed after use in nubus_device_realize(). Fixes: Coverity CID 1464062 Signed-off-by: Mark Cave-Ayland --- hw/nubus/nubus-device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-devi

[PATCH 0/2] nubus: a couple of Coverity fixes

2021-10-02 Thread Mark Cave-Ayland
These patches fix a couple of issues found by Coverity in the recent nubus patchset as reported by Peter. Signed-off-by: Mark Cave-Ayland Mark Cave-Ayland (2): nubus.h: add ULL suffix to NUBUS_SUPER_SLOT_SIZE and NUBUS_SUPER_SLOT_SIZE nubus-device: ensure that name is freed after use in

Re: [PATCH 04/12] macfb: use memory_region_init_ram() in macfb_common_realize() for the framebuffer

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Mark Cave-Ayland wrote: Currently macfb_common_realize() defines the framebuffer RAM memory region as being non-migrateable but then immediately registers it for migration. Replace memory_region_init_ram_nomigrate() with memory_region_init_ram() which is clearer and does exac

Re: [PATCH 02/12] macfb: fix invalid object reference in macfb_common_realize()

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Mark Cave-Ayland wrote: During realize memory_region_init_ram_nomigrate() is used to initialise the RAM memory region used for the framebuffer but the owner object reference is incorrect since MacFbState is a typedef and not a QOM type. Change the memory region owner to be th

Re: [PATCH 01/12] macfb: handle errors that occur during realize

2021-10-02 Thread BALATON Zoltan
On Sat, 2 Oct 2021, Mark Cave-Ayland wrote: Make sure any errors that occur within the macfb realize chain are detected and handled correctly to prevent crashes and to ensure that error messages are reported back to the user. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 11 +

Re: [PATCH v12 16/16] machine: Make smp_parse return a boolean

2021-10-02 Thread Markus Armbruster
Paolo Bonzini writes: > On 01/10/21 19:15, Daniel P. Berrangé wrote: >> On Fri, Oct 01, 2021 at 07:08:51PM +0200, Paolo Bonzini wrote: >>> On 29/09/21 04:58, Yanan Wang wrote: @@ -933,8 +935,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name, ret

[PATCH 10/12] macfb: fix 24-bit RGB pixel encoding

2021-10-02 Thread Mark Cave-Ayland
According to Apple Technical Note HW26: "Macintosh Quadra Built-In Video" the in-built framebuffer encodes each 24-bit pixel into 4 bytes. Adjust the 24-bit RGB pixel encoding accordingly which agrees with the encoding expected by MacOS when changing into 24-bit colour mode. Signed-off-by: Mark Ca

[PATCH 06/12] macfb: implement mode sense to allow display type to be detected

2021-10-02 Thread Mark Cave-Ayland
The MacOS toolbox ROM uses the monitor sense to detect the display type and then offer a fixed set of resolutions and colour depths accordingly. Implement the monitor sense using information found in Apple Technical Note HW26: "Macintosh Quadra Built-In Video" along with some local experiments. Si

[PATCH 12/12] q800: wire macfb IRQ to separate video interrupt on VIA2

2021-10-02 Thread Mark Cave-Ayland
Whilst the in-built Quadra 800 framebuffer exists within the Nubus address space for slot 9, it has its own dedicated interrupt on VIA2. Force the macfb device to occupy slot 9 in the q800 machine and wire its IRQ to the separate video interrupt since this is what is expected by the MacOS interrupt

[PATCH 07/12] macfb: add qdev property to specify display type

2021-10-02 Thread Mark Cave-Ayland
Since the available resolutions and colour depths are determined by the attached display type, add a qdev property to allow the display type to be specified. The main resolutions of interest are high resolution 1152x870 with 8-bit colour and SVGA resolution up to 800x600 with 32-bit colour so upda

[PATCH 11/12] macfb: add vertical blank interrupt

2021-10-02 Thread Mark Cave-Ayland
The MacOS driver expects a 60.15Hz vertical blank interrupt to be generated by the framebuffer which in turn schedules the mouse driver via the Vertical Retrace Manager. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 81 ++ include/hw/displa

[PATCH 03/12] macfb: fix overflow of color_palette array

2021-10-02 Thread Mark Cave-Ayland
The palette_current index counter has a maximum size of 256 * 3 to cover a full color palette of 256 RGB entries. Linux assumes that the palette_current index wraps back around to zero after writing 256 RGB entries so ensure that palette_current is reset at this point to prevent data corruption wit

[PATCH 09/12] macfb: fix up 1-bit pixel encoding

2021-10-02 Thread Mark Cave-Ayland
The MacOS driver expects the RGB values for the pixel to be in entries 0 and 1 of the colour palette. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 6a69334565..0c9e181b9b

[PATCH 04/12] macfb: use memory_region_init_ram() in macfb_common_realize() for the framebuffer

2021-10-02 Thread Mark Cave-Ayland
Currently macfb_common_realize() defines the framebuffer RAM memory region as being non-migrateable but then immediately registers it for migration. Replace memory_region_init_ram_nomigrate() with memory_region_init_ram() which is clearer and does exactly the same thing. Signed-off-by: Mark Cave-

[PATCH 08/12] macfb: add common monitor modes supported by the MacOS toolbox ROM

2021-10-02 Thread Mark Cave-Ayland
The monitor modes table is found by experimenting with the Monitors Control Panel in MacOS and analysing the reads/writes. From this it can be found that the mode is controlled by writes to the DAFB_MODE_CTRL1 and DAFB_MODE_CTRL2 registers. Implement the first block of DAFB registers as a register

[PATCH 05/12] macfb: add trace events for reading and writing the control registers

2021-10-02 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 8 +++- hw/display/trace-events | 4 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index e86f64..62c2727a5b 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c

[PATCH 02/12] macfb: fix invalid object reference in macfb_common_realize()

2021-10-02 Thread Mark Cave-Ayland
During realize memory_region_init_ram_nomigrate() is used to initialise the RAM memory region used for the framebuffer but the owner object reference is incorrect since MacFbState is a typedef and not a QOM type. Change the memory region owner to be the corresponding DeviceState to fix the issue a

[PATCH 00/12] macfb: fixes for booting MacOS

2021-10-02 Thread Mark Cave-Ayland
This is the next set of patches to allow users to boot MacOS in QEMU's q800 machine. Patches 1 to 3 are fixes for existing bugs that I discovered whilst developing the remainder of the patchset whilst patch 4 simplifies the registration of the framebuffer RAM. Patch 5 adds trace events to the fra

[PATCH 01/12] macfb: handle errors that occur during realize

2021-10-02 Thread Mark Cave-Ayland
Make sure any errors that occur within the macfb realize chain are detected and handled correctly to prevent crashes and to ensure that error messages are reported back to the user. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 11 +++ 1 file changed, 11 insertions(+) diff --

Re: [PULL 33/44] target/ppc: Fix 64-bit decrementer

2021-10-02 Thread Peter Maydell
On Thu, 30 Sept 2021 at 06:44, David Gibson wrote: > > From: Cédric Le Goater > > The current way the mask is built can overflow with a 64-bit decrementer. > Use sextract64() to extract the signed values and remove the logic to > handle negative values which has become useless. > > Cc: Luis Ferna

Re: [PULL 03/20] nubus-device: expose separate super slot memory region

2021-10-02 Thread Peter Maydell
On Wed, 29 Sept 2021 at 10:49, Laurent Vivier wrote: > > From: Mark Cave-Ayland > > According to "Designing Cards and Drivers for the Macintosh Family" each > physical > nubus slot can access 2 separate address ranges: a super slot memory region > which > is 256MB and a standard slot memory reg

Re: [PULL 11/20] nubus-device: add romfile property for loading declaration ROMs

2021-10-02 Thread Peter Maydell
On Wed, 29 Sept 2021 at 10:53, Laurent Vivier wrote: > > From: Mark Cave-Ayland > > The declaration ROM is located at the top-most address of the standard slot > space. > > Signed-off-by: Mark Cave-Ayland > Reviewed-by: Laurent Vivier > Message-Id: <20210924073808.1041-12-mark.cave-ayl...@iland

Re: [PATCH v3 0/9] hw/nvram: hw/arm: Introduce Xilinx eFUSE and BBRAM

2021-10-02 Thread Peter Maydell
On Fri, 17 Sept 2021 at 06:24, Tong Ho wrote: > > This series implements the Xilinx eFUSE and BBRAM devices for > the Versal and ZynqMP product families. > > Furthermore, both new devices are connected to the xlnx-versal-virt > board and the xlnx-zcu102 board. > > See changes in docs/system/arm/xl

Re: [PULL v2 00/33] x86 and misc changes for 2021-09-28

2021-10-02 Thread Peter Maydell
On Sat, 2 Oct 2021 at 01:41, Richard Henderson wrote: > > On 9/30/21 10:57 AM, Paolo Bonzini wrote: > > The following changes since commit ba0fa56bc06e563de68d2a2bf3ddb0cfea1be4f9: > > > >Merge remote-tracking branch > > 'remotes/vivier/tags/q800-for-6.2-pull-request' into staging (2021-09-29

[PULL 03/13] qapi/parser: fix unused check_args_section arguments

2021-10-02 Thread Markus Armbruster
From: John Snow Pylint informs us we're not using these arguments. Oops, it's right. Correct the error message and remove the remaining unused parameter. Fix test output now that the error message is improved. Fixes: e151941d1b Signed-off-by: John Snow Message-Id: <20210930205716.1148693-4-js.

  1   2   >