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  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:	Thu, 18 Apr 2013 00:50:28 +0000
From:	"Zhang, Yang Z" <yang.z.zhang@...el.com>
To:	Randy Dunlap <rdunlap@...radead.org>
CC:	David Rientjes <rientjes@...gle.com>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	Gleb Natapov <gleb@...hat.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	"x86@...nel.org" <x86@...nel.org>,
	"linux-next@...r.kernel.org" <linux-next@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	KVM <kvm@...r.kernel.org>
Subject: RE: [patch] x86, kvm: fix build failure with CONFIG_SMP disabled

Randy Dunlap wrote on 2013-04-18:
> On 04/17/13 17:35, Zhang, Yang Z wrote:
>> David Rientjes wrote on 2013-04-18:
>>> On Wed, 17 Apr 2013, Randy Dunlap wrote:
>>> 
>>>> On 04/17/13 16:12, David Rientjes wrote:
>>>>> The build fails when CONFIG_SMP is disabled:
>>>>> 
>>>>> 	arch/x86/kvm/vmx.c: In function 'vmx_deliver_posted_interrupt':
>>>>> 	arch/x86/kvm/vmx.c:3950:3: error: 'apic' undeclared (first use in
>>>>> this function)
>>>>> 
>>>>> Fix it by including the necessary header.
>>>> 
>>>> Sorry, i386 build still fails with the same error message plus this one:
>>>> 
>>>> ERROR: "apic" [arch/x86/kvm/kvm-intel.ko] undefined!
>>>> 
>>> 
>>> Ahh, that's because you don't have CONFIG_X86_LOCAL_APIC as you already
>>> mentioned.  So it looks like this error can manifest in two different ways
>>> and we got different reports.
>>> 
>>> This failure came from "KVM: VMX: Add the deliver posted interrupt
>>> algorithm", so adding Yang to the cc to specify the dependency this has on
>>> apic and how it can be protected without CONFIG_X86_LOCAL_APIC on i386.
>> How about the follow patch?
>> 
>> commit a49dd819f502c1029c5a857e87201ef25ec06ce6
>> Author: Yang Zhang <yang.z.zhang@...el.com>
>> Date:   Wed Apr 17 05:34:07 2013 -0400
>> 
>>     KVM: x86: Don't sending posted interrupt if not config CONFIG_SMP
>>     
>>     In UP, posted interrupt logic will not work. So we should not send
>>     posted interrupt and let vcpu to pick the pending interrupt before
>>     vmentry.
>>     
>>     Signed-off-by: Yang Zhang <yang.z.zhang@...el.com>
> 
> Missing Reported-by: and the patch does not apply cleanly (looks like
> lots of spaces instead of tabs in it)... but it does build now after
> massaging the patch.
Thanks.
Just copy it to you for a quick testing. I will resend a formal patch.

> Thanks.
> 
> Acked-by: Randy Dunlap <rdunlap@...radead.org>
> 
> 
>> 
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index
>> 52b21da..d5c6b95 100644 --- a/arch/x86/kvm/vmx.c +++
>> b/arch/x86/kvm/vmx.c @@ -3946,10 +3946,12 @@ static void
>> vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
>> 
>>         r = pi_test_and_set_on(&vmx->pi_desc);
>>         kvm_make_request(KVM_REQ_EVENT, vcpu); +#ifdef CONFIG_SMP if
>>         (!r && (vcpu->mode == IN_GUEST_MODE))
>>                 apic->send_IPI_mask(get_cpu_mask(vcpu->cpu),
>>                                 POSTED_INTR_VECTOR);
>>         else
>> +#endif
>>                 kvm_vcpu_kick(vcpu);
>>  }
>> Best regards,
>> Yang
>> 
>> 
> 
> 
> --
> ~Randy
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Best regards,
Yang


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists