From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbdJDOot (ORCPT ); Wed, 4 Oct 2017 10:44:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43485 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270AbdJDOor (ORCPT ); Wed, 4 Oct 2017 10:44:47 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BB26AFEBD Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=rkrcmar@redhat.com Date: Wed, 4 Oct 2017 16:44:44 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Wanpeng Li Cc: "linux-kernel@vger.kernel.org" , kvm , Paolo Bonzini , Wanpeng Li Subject: Re: [PATCH v2 4/4] KVM: LAPIC: Don't silently accept bad vectors Message-ID: <20171004144444.GI21107@flask> References: <1506647099-2688-1-git-send-email-wanpeng.li@hotmail.com> <1506647099-2688-5-git-send-email-wanpeng.li@hotmail.com> <20171003175341.GD21107@flask> <20171004120146.GC20277@flask> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 04 Oct 2017 14:44:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-10-04 22:16+0800, Wanpeng Li: > 2017-10-04 20:01 GMT+08:00 Radim Krčmář : > > 2017-10-04 15:56+0800, Wanpeng Li: > >> 2017-10-04 1:53 GMT+08:00 Radim Krčmář : > >> > 2017-09-28 18:04-0700, Wanpeng Li: > >> >> @@ -946,6 +965,11 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, > >> >> int result = 0; > >> >> struct kvm_vcpu *vcpu = apic->vcpu; > >> >> > >> >> + if (unlikely(vector < 16) && delivery_mode == APIC_DM_FIXED) { > >> >> + apic_error(apic, APIC_ESR_RECVILL); > >> > > >> > The error is also triggered if lowest priority is supported and tries to > >> > deliver an invalid vector. > >> > >> Could you point out this in SDM? :) > > > > In section 10.5.3 Error Handling: > > > > If the local APIC does not support the sending of lowest-priority IPIs > > and software writes the ICR to send a lowest-priority IPI with an > > illegal vector, the local APIC sets only the “redirectible IPI” error > > bit. > > > > Hence, if local APIC does support lowest-priority, then it throws the > > same error as fixed. (KVM does support lowest-priority.) > > Yeah, I read the section before but I misunderstand it. It seems that > the section means it just occurs when the local APIC does not support > the sending of lowest-priority IPIs? I think so.