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] [day] [month] [year] [list]
Date:   Tue, 25 Oct 2016 10:52:55 +0800
From:   Wanpeng Li <kernellwp@...il.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Wanpeng Li <wanpeng.li@...mail.com>,
        Ingo Molnar <mingo@...nel.org>, Mike Galbraith <efault@....de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Radim Krcmar <rkrcmar@...hat.com>
Subject: Re: [PATCH] x86/smp: Add irq_enter/exit() in smp_reschedule_interrupt()

2016-10-24 22:32 GMT+08:00 Paolo Bonzini <pbonzini@...hat.com>:
>
>
> On 19/10/2016 16:30, Wanpeng Li wrote:
>> Cc Radim,
>> 2016-10-19 22:10 GMT+08:00 Paolo Bonzini <pbonzini@...hat.com>:
>>>
>>>
>>> On 19/10/2016 16:01, Wanpeng Li wrote:
>>>> 2016-10-18 8:01 GMT+08:00 Wanpeng Li <kernellwp@...il.com>:
>>>>> 2016-10-17 18:08 GMT+08:00 Paolo Bonzini <pbonzini@...hat.com>:
>>>>> [...]
>>>>>>>> Something like the below avoids all that. Paravirt will still need fixing.
>>>>>>>
>>>>>>> kvm_guest_apic_eoi_write
>>>>>>>  -> native_apic_msr_write
>>>>>>
>>>>>> kvm_guest_apic_eoi_write can use native_apic_msr_eoi_write too:
>>>>>>
>>>>>> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
>>>>>> index f5aaf6c83222..9769d76a62c4 100644
>>>>>> --- a/arch/x86/include/asm/apic.h
>>>>>> +++ b/arch/x86/include/asm/apic.h
>>>>>> @@ -174,7 +174,7 @@ static inline void disable_local_APIC(void) { }
>>>>>>  static inline void lapic_update_tsc_freq(void) { }
>>>>>>  #endif /* !CONFIG_X86_LOCAL_APIC */
>>>>>>
>>>>>> -#ifdef CONFIG_X86_X2APIC
>>>>>> +#if defined CONFIG_X86_X2APIC || defined CONFIG_KVM_GUEST
>>>>>
>>>>> If CONFIG_X86_X2APIC is undefined and CONFIG_KVM_GUEST is defined,
>>>>> there are undefined reference warning for x2apic_mode and check_x2apic
>>>>> etc since they are extern variables and just define under
>>>>> CONFIG_X86_X2APIC.
>>>>
>>
>> This results in undefined reference warning.
>>
>>>>
>>>>>
>>>>> If -cpu host,-x2apic we should go through mmio when writes xapic EOI.
>>>>
>>>> Any ideas? :)
>>>
>>> Make apic_set_eoi_write return the old pointer?
>>
>> Could you elaborate? :)
>
> No, that won't work due to how struct apic works and how
> apic_set_eoi_write patches it.  One possibility then is to add a
>
>         void (*native_eoi_write)(u32 reg, u32 v);
>
> field to struct apic, and make apic_set_eoi_write set
>
>         (*drv)->native_eoi_write = (*drv)->eoi_write;
>         (*drv)->eoi_write = eoi_write;
>
> Then kvm.c can call
>
>         apic->native_eoi_write(reg, v);

It works. Thanks Paolo. :)

Regards,
Wanpeng Li

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ