[PATCH] target/i386: Change CR4 before CR0 in SVM

2023-01-27 Thread Bernhard Kauer
Resend as attachment as the previous version gots corrupted.From abea41b457aff4c04c3aa397b88847b66aaff1ad Mon Sep 17 00:00:00 2001 From: Bernhard Kauer Date: Fri, 20 Jan 2023 21:33:04 + Subject: [PATCH 2/2] target/i386: Change CR4 before CR0 in SVM There is a dependency in cpu_x86_update_cr0

[PATCH] target/i386: translate GPA to HPA even in unpaged mode

2023-01-20 Thread Bernhard Kauer
Guest to host page translation is missing if the guest runs in unpaged mode. See last sentence in AMD SDM rev 3.40 section 15.25.5. Signed-off-by: Bernhard Kauer --- target/i386/tcg/sysemu/excp_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/tcg/sysemu/excp_helper.c

[PATCH] target/i386: translate GPA to HPA even in unpaged mode

2023-01-20 Thread Bernhard Kauer
Guest to host page translation should be done even if the guest runs in unpaged mode. See last sentence in AMD SDM rev 3.40 section 15.25.5. Signed-off-by: Bernhard Kauer ---  target/i386/tcg/sysemu/excp_helper.c | 3 +++  1 file changed, 3 insertions(+) diff --git a/target/i386/tcg/sysemu

Patch: target/i386: Change CR4 before CR0 in SVM

2023-01-20 Thread Bernhard Kauer
 There is a dependency in cpu_x86_update_cr0() to the current value of CR4  to enable or disable long-mode.  This value is outdated when switching into  or out of SVM. This leads to invalid CPU state when returning from an unpaged  VM when EFER.LME is set.     Signed-off-by: Bernhard Kauer diff

Re: [Qemu-devel] [PATCH] fix curses update - v2

2010-05-21 Thread Bernhard Kauer
On Fri, May 21, 2010 at 02:02:43PM +0200, andrzej zaborowski wrote: > I pushed a modified patch to preserve attributes such as background > colour. Good idea. > Please check if this works for you. Yes, this works. Thanks, Bernhard Kauer

[Qemu-devel] [PATCH] fix curses update - v2

2010-05-20 Thread Bernhard Kauer
On Mon, May 03, 2010 at 01:06:46PM -0500, Anthony Liguori wrote: > On 04/22/2010 09:08 AM, Bernhard Kauer wrote: > >Hi, > > > >>I believe this issue has come up before with a similar patch but > >well i've submitted such a patch more than two years ago. Unfortu

Re: [Qemu-devel] [PATCH] fix curses update

2010-04-22 Thread Bernhard Kauer
Hi, > I believe this issue has come up before with a similar patch but well i've submitted such a patch more than two years ago. Unfortunatelly it got never applied, so that I have to patch my Qemu on every update... > someone checked their ncurses and they didn't see the same issue. > I just

[Qemu-devel] [PATCH] fix curses update

2010-04-20 Thread Bernhard Kauer
zeros the VGA text buffer and later pokes single characters, the console output can become unreadable. The attached patch corrects this bug. Bernhard Kauer Signed-off-by: Bernhard Kauer diff --git a/curses.c b/curses.c index ed3165e..9bf9265 100644 --- a/curses.c +++ b/curses.c

Re: [Qemu-devel] [PATCH] allow update of MSR_EFER_SVM

2008-02-29 Thread Bernhard Kauer
VMM should always prevent guests from writing EFER. Therefore i think the wrmsr-code is just fine, as it is in my patch. Bernhard Kauer

Re: [Qemu-devel] [PATCH] allow update of MSR_EFER_SVM

2008-02-29 Thread Bernhard Kauer
s zero, the SVM instructions cause #UD exceptions. The bit was called MSR_EFER_SVME_MASK in svm.h before, I renamed it in the attached patch to MSR_EFER_SVME to match the style of the other definitions in cpu.h. BTW, triggering the above mentioned #UD is missing in the code... Bernhard

[Qemu-devel] [PATCH] allow update of MSR_EFER_SVM

2008-02-27 Thread Bernhard Kauer
The wrmsr_helper should allow to set the SVM flag in EFER. Bernhard Kauer Index: target-i386/helper.c === RCS file: /sources/qemu/qemu/target-i386/helper.c,v retrieving revision 1.101 diff -u -r1.101 helper.c --- target-i386

[Qemu-devel] [PATCH] fix ncurses output

2008-02-25 Thread Bernhard Kauer
line-buffer. Please note that this change affects other consoles as well and is perhaps undesirable. Comments? Bernhard Kauer Index: console.h --- console.h 10 Feb 2008 16:33:13 - 1.2 +++ console.h 25 Feb 2008 17:25:53 - @@ -104,7 +104,8 @@ typedef unsigned long console_ch_t

[Qemu-devel] [PATCH] fix SVM event injection

2008-01-23 Thread Bernhard Kauer
The SVM event injection mechanism for NMI and INTRs should not be handled as software interrupts. Bernhard Kauer Index: target-i386/helper.c --- target-i386/helper.c 24 Dec 2007 13:36:00 - 1.98 +++ target-i386/helper.c 23 Jan 2008 22:37:49 - @@ -4124,7 +4193,7 @@ case

Re: [Qemu-devel] [PATCH]SVM CR8 undefined bug fix

2008-01-17 Thread Bernhard Kauer
pter 8... Bernhard Kauer

[Qemu-devel] [PATCH] SVM enabled processor should provide cpuid Fn8000_000A

2007-12-18 Thread Bernhard Kauer
An SVM enabled processor should provide the CPUID extended leaf Fn8000_000A (see AMD documentation #25481). The attached patch add this feature. Bernhard Kauer Index: target-i386/helper.c === RCS file: /sources/qemu/qemu

[Qemu-devel] [PATCH] fix cmpxchg8b translation

2007-12-18 Thread Bernhard Kauer
The cmpxchg8b opcode is only valid if the nnn bits in the mod/rm byte are 001, otherwise an #UD should be generated. The attached patch fixes this. Bernhard Kauer Index: target-i386/translate.c --- target-i386/translate.c 8 Nov 2007 14:25:03 - 1.74 +++ target-i386/translate.c 18 Dec

Re: [Qemu-devel] [PATCH] SVM IOIO intercept does not check all bits

2007-12-08 Thread Bernhard Kauer
> > That was the one. Thank you. Unfortunately there is another bug in this line. As there is only a single byte read from the permission bitmap, an unaligned 4-byte access to port 0x7 would be possible even when the access to port 0x8-0xa is not allowed. The updated patch fixes also

Re: [Qemu-devel] [PATCH] SVM IOIO intercept does not check all bits

2007-12-07 Thread Bernhard Kauer
On Fri, Dec 07, 2007 at 02:10:35PM +0100, Alexander Graf wrote: > Could you please make this more readable? Not easy by a one liner. I splitted the mask calculation in a separate line. Is it better now? > Apart from that the patch is fine if the highest bit in the IOIO vector is > to be set. I co

[Qemu-devel] [PATCH] SVM IOIO intercept does not check all bits

2007-12-06 Thread Bernhard Kauer
The SVM IOIO intercept does not check all bits in the IO permission map for in/outs with word or long operand size. The attached patch fix this. Bernhard Kauer Index: target-i386/helper.c --- target-i386/helper.c 18 Nov 2007 01:44:38 - 1.95 +++ target-i386/helper.c 6 Dec 2007 19:22

[Qemu-devel] [PATCH] add rdpmc intercept for SVM

2007-12-05 Thread Bernhard Kauer
The attached patch adds an SVM intercept for rdpmc to qemu, thus allowing a VMM to virtualize them. Please note that performance counters are currently unimplemented in qemu. Bernhard Kauer Index: target-i386/helper.c --- target-i386/helper.c 18 Nov 2007 01:44:38 - 1.95 +++ target

Re: [Qemu-devel] [Patch] set boot sequence from command line

2007-10-25 Thread Bernhard Kauer
It is perhaps not the best idea to read behind the end of the boot_device string. It would be safer to declare boot_device as 'static char boot_device[4]' and use a strncpy. Bernhard > diff --git a/hw/pc.c b/hw/pc.c > index a0c824f..3c552ff 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > +

Re: [Qemu-devel] BIOS: ACPI Tables: wrong memory pointer

2007-09-14 Thread Bernhard Kauer
from Sep 10 on the Bochs developer mailinglist for a patch. Bernhard Kauer

Re: [Qemu-devel] [PATCH] SVM support

2007-08-30 Thread Bernhard Kauer
implement skinit, but did not had the time to finish that work, yet. Please note that this patch requires a two line patch to the tpm-emulator to understand the localities. Bernhard Kauer Index: Makefile.target === RCS file:

Re: [Qemu-devel] Patch: let qemu work with latest bochsbios

2007-08-17 Thread Bernhard Kauer
Has somebody besides me tested the patch? Bernhard Kauer On Wed, Aug 01, 2007 at 05:42:17PM +0200, Bernhard Kauer wrote: > The boot_device is not communicated to the bochsbios > through the CMOS. The following patch allows to boot > via network on the newest bochsbios.

Re: [Qemu-devel] Why not use exit() instead of abort()?

2007-08-17 Thread Bernhard Kauer
On Mon, Aug 06, 2007 at 07:21:21AM +0930, Dan Shearer wrote: > On Sun, Aug 05, 2007 at 11:13:55PM +0200, Bernhard Kauer wrote: > > There are a couple of places in qemu, where abort() is called. > > The most commonly used one is perhaps cpu_abort() which is called > > e.g

[Qemu-devel] Why not use exit() instead of abort()?

2007-08-05 Thread Bernhard Kauer
cursor is invisible. Are there any reasons not to use exit(1) in cpu_abort()? Bernhard Kauer Index: exec.c === RCS file: /sources/qemu/qemu/exec.c,v retrieving revision 1.103 diff -u -r1.103 exec.c --- exec.c 1 Jul 2007 18:21

Re: [Qemu-devel] Patch: let qemu work with latest bochsbios

2007-08-04 Thread Bernhard Kauer
On Wed, Aug 01, 2007 at 11:02:58AM -0500, Anthony Liguori wrote: > Bernhard Kauer wrote: >> -boot_device = 'c'; /* to prevent confusion by the BIOS */ >> +//boot_device = 'c'; /* to prevent confusion by the BIOS */ >> } >> > >

[Qemu-devel] Patch: let qemu work with latest bochsbios

2007-08-01 Thread Bernhard Kauer
The boot_device is not communicated to the bochsbios through the CMOS. The following patch allows to boot via network on the newest bochsbios. Bernhard Kauer Index: vl.c === RCS file: /sources/qemu/qemu/vl.c,v retrieving

[Qemu-devel] Patch: let qemu work with latest bochsbios

2007-08-01 Thread Bernhard Kauer
The boot_device is not communicated to the bochsbios through the CMOS. The following patch allows to boot via network on the newest bochsbios. Bernhard Kauer

[Qemu-devel] Patch: PIC-i8259 mode transition wrong

2007-07-31 Thread Bernhard Kauer
The PIC initilization should respect the fourth byte init bit in single mode. Bernhard Kauer Index: hw/i8259.c === RCS file: /sources/qemu/qemu/hw/i8259.c,v retrieving revision 1.22 diff -u -r1.22 i8259.c --- hw/i8259.c 7

[Qemu-devel] Patch: fix init of old_exception

2007-07-31 Thread Bernhard Kauer
The old_exception field is initialized on startup with 0. Therefore the very first fault (e.g. #GP) could be converted to a double fault on an application processor. The attached patch initialize old_exception on every CPU reset with -1. Bernhard Kauer Index: target-i386/helper2.c

Re: [Qemu-devel] Qemu / KQemu on 64-bit (x86_64) host systems

2007-04-17 Thread Bernhard Kauer
e where this wrong sign extension happend needs still to be found. Bernhard Kauer

[Qemu-devel] Patch: ptable calculation broken for 32bit code under x86_64

2007-04-10 Thread Bernhard Kauer
The calculation of pdpe and pde addresses is broken, when running 32bit code under x86_64-qemu. The code assumes that the addr parameter is 32bit wide. This assumption does not hold for x86_64 as target. Bernhard Kauer Index: target-i386/helper2.c

[Qemu-devel] Patch: generate double and triple faults

2007-03-31 Thread Bernhard Kauer
On Wed, Mar 28, 2007 at 02:39:31PM +0200, Bernhard Kauer wrote: > On Wed, Mar 28, 2007 at 10:13:49AM +0200, Sebastian Kaliszewski wrote: > > Bernhard Kauer wrote: > > >Qemu does not generate a double fault (DBF) on x86, if a general protection > > >fault could not be del

[Qemu-devel] Patch: PIC-i8259 does not work in single mode

2007-03-29 Thread Bernhard Kauer
The PIC-i8259 does not work in single mode, where only the master PIC is used. The attached patch fixes the initialization part for single mode. Bernhard Kauer Index: i8259.c === RCS file: /sources/qemu/qemu/hw/i8259.c,v

Re: [Qemu-devel] Patch: generate a DBF when a GPF could not be delivered on x86

2007-03-28 Thread Bernhard Kauer
On Wed, Mar 28, 2007 at 10:13:49AM +0200, Sebastian Kaliszewski wrote: > Bernhard Kauer wrote: > >Qemu does not generate a double fault (DBF) on x86, if a general protection > >fault could not be delivered. Instead it hangs in a loop. > > > >The patch fix this bug

[Qemu-devel] Patch: generate a DBF when a GPF could not be delivered on x86

2007-03-27 Thread Bernhard Kauer
Qemu does not generate a double fault (DBF) on x86, if a general protection fault could not be delivered. Instead it hangs in a loop. The patch fix this bug by checking whether we are already in a GPF exception. Bernhard Kauer Index: helper.c

Re: [Qemu-devel] Patch: ltr for x86_64 should check the upper descriptor type

2007-03-26 Thread Bernhard Kauer
On Mon, Mar 26, 2007 at 01:54:43PM +, Julian Seward wrote: > > Does this fix some specific bug you encountered? I have some code here that runs on Qemu but not on real hardware due to this missing check. Bernhard > On Monday 26 March 2007 14:53, Bernhard Kauer wrote: >

[Qemu-devel] Patch: ltr for x86_64 should check the upper descriptor type

2007-03-26 Thread Bernhard Kauer
The Intel manual states for LTR and 64-Bit Exceptions: #GP(selector) If the descriptor type of the upper 8-byte of the 16-byte descriptor is non-zero. Qemu currently does not check this. The attached patch fixes the bug. Bernhard Kauer --- helper.c.orig 2007-03-26

[Qemu-devel] [PATCH] TPM TIS device model

2007-03-25 Thread Bernhard Kauer
name Greetings, Bernhard Kauer diff -N -r -u qemu.old/Makefile.target qemu/Makefile.target --- qemu.old/Makefile.target2007-03-09 02:46:14.024009410 +0100 +++ qemu/Makefile.target2007-03-09 01:03:53.0 +0100 @@ -372,6 +372,7 @@ VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o

[Qemu-devel] [PATCH] i386 return APIC ID with cpuid

2007-03-20 Thread Bernhard Kauer
Hi, cpuid(01H) on i386 does not return the initial APIC id. The following patch correct this. Bernhard Kauer Index: hw/apic.c === RCS file: /sources/qemu/qemu/hw/apic.c,v retrieving revision 1.12 diff -u -r1.12 apic.c --- hw

[Qemu-devel] [PATCH] TPM TIS device model

2007-03-12 Thread Bernhard Kauer
name Greetings, Bernhard Kauer diff -N -r -u qemu.old/Makefile.target qemu/Makefile.target --- qemu.old/Makefile.target2007-03-09 02:46:14.024009410 +0100 +++ qemu/Makefile.target2007-03-09 01:03:53.0 +0100 @@ -372,6 +372,7 @@ VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o