lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84646f56-dcb0-b0f8-f485-eb0d69a84c9c@maciej.szmigiero.name>
Date:   Fri, 15 Jul 2022 00:40:58 +0200
From:   "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
To:     Maxim Levitsky <mlevitsk@...hat.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Joerg Roedel <joro@...tes.org>, Ingo Molnar <mingo@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org, Jim Mattson <jmattson@...gle.com>,
        kvm@...r.kernel.org
Subject: Re: [PATCH] KVM: SVM: fix task switch emulation on INTn instruction.

On 14.07.2022 15:57, Maxim Levitsky wrote:
> On Thu, 2022-07-14 at 15:50 +0200, Maciej S. Szmigiero wrote:
>> On 14.07.2022 14:44, Maxim Levitsky wrote:
>>> Recently KVM's SVM code switched to re-injecting software interrupt events,
>>> if something prevented their delivery.
>>>
>>> Task switch due to task gate in the IDT, however is an exception
>>> to this rule, because in this case, INTn instruction causes
>>> a task switch intercept and its emulation completes the INTn
>>> emulation as well.
>>>
>>> Add a missing case to task_switch_interception for that.
>>>
>>> This fixes 32 bit kvm unit test taskswitch2.
>>>
>>> Fixes: 7e5b5ef8dca322 ("KVM: SVM: Re-inject INTn instead of retrying the insn on "failure"")
>>>
>>> Signed-off-by: Maxim Levitsky <mlevitsk@...hat.com>
>>> ---
>>
>> That's a good catch, your patch looks totally sensible to me.
>> People running Win 3.x or OS/2 on top of KVM will surely be grateful for it :)
> 
> Yes and also people who run 32 bit kvm unit tests :)

It looks like more people need to do this regularly :)

> BTW, I do have a win98 VM which I run once in a while under KVM.
> On Intel it works very well, on AMD, only works without NPT and without MMU
> pre-fetching, due to fact that the OS doesn't correctly invalidate TLB entries.

Interesting, maybe it is related to some operation in 90s CPUs implicitly
invalidating (or just replacing) enough TLB entries to actually make it work
(usually) - just a guess.

> I do need to test KVM with OS/2 on one of the weekends.... ;-)
> 
> Thanks for the review,
> 	Best regards,
> 		Maxim Levitsky
> 

Thanks,
Maciej

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ