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: <a7d28775-2dbe-7d97-7053-e182bd5be51c@redhat.com>
Date:   Mon, 11 Apr 2022 19:40:25 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     Isaku Yamahata <isaku.yamahata@...il.com>,
        isaku.yamahata@...el.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jim Mattson <jmattson@...gle.com>,
        erdemaktas@...gle.com, Connor Kuehl <ckuehl@...hat.com>
Subject: Re: [RFC PATCH v5 092/104] KVM: TDX: Handle TDX PV HLT hypercall

On 4/8/22 16:51, Sean Christopherson wrote:
>> It also documents how it has to be used.  So this looks more or less okay,
>> just rename "vmxip" to "interrupt_pending_delivery".
> 
> If we're keeping the call back into SEAM, then this belongs in the path of
> apic_has_interrupt_for_ppr(), not in the HLT-exit path.  To avoid multiple SEAMCALLS
> in a single exit, VCPU_EXREG_RVI can be added.

But apic_has_interrupt_for_ppr takes a PPR argument and that is not 
available.

So I suppose you mean kvm_apic_has_interrupt?  You would change that to 
a callback, like

         if (!kvm_apic_present(vcpu))
                 return -1;

	return static_call(kvm_x86_apic_has_interrupt)(vcpu);
}

and the default version would also be inlined in kvm_get_apic_interrupt, 
like

-       int vector = kvm_apic_has_interrupt(vcpu);
         struct kvm_lapic *apic = vcpu->arch.apic;
         u32 ppr;

-       if (vector == -1)
+       if (!kvm_apic_present(vcpu))
                 return -1;
+       __apic_update_ppr(apic, &ppr);
+	vector = apic_has_interrupt_for_ppr(apic, ppr);

Checking the SEAM state (which would likewise not be VCPU_EXREG_RVI, but 
more like VCPU_EXREG_INTR_PENDING) would be done in the tdx case of 
kvm_x86_apic_has_interrupt.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ