From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8877C10F0E for ; Mon, 15 Apr 2019 20:17:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 713F22070D for ; Mon, 15 Apr 2019 20:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbfDOURN (ORCPT ); Mon, 15 Apr 2019 16:17:13 -0400 Received: from mga12.intel.com ([192.55.52.136]:43725 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728148AbfDOURN (ORCPT ); Mon, 15 Apr 2019 16:17:13 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Apr 2019 13:17:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,354,1549958400"; d="scan'208";a="142976309" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.181]) by orsmga003.jf.intel.com with ESMTP; 15 Apr 2019 13:17:12 -0700 Date: Mon, 15 Apr 2019 13:17:12 -0700 From: Sean Christopherson To: nadav.amit@gmail.com Cc: Paolo Bonzini , kvm@vger.kernel.org Subject: Re: [kvm-unit-tests PATCH] x86: Fix INIT during boot Message-ID: <20190415201712.GM24010@linux.intel.com> References: <20190415191120.9472-1-nadav.amit@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190415191120.9472-1-nadav.amit@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Apr 15, 2019 at 12:11:20PM -0700, nadav.amit@gmail.com wrote: > From: Nadav Amit > > INIT is a level event and the trigger mode should be marked as such. In > addition, the SDM says that INIT deassertion should specify the "all > including-self" shorthand. > > Signed-off-by: Nadav Amit > --- > x86/cstart64.S | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/x86/cstart64.S b/x86/cstart64.S > index 21db10f..57c3552 100644 > --- a/x86/cstart64.S > +++ b/x86/cstart64.S > @@ -284,8 +284,8 @@ smp_init: > mov $(sipi_end - sipi_entry), %rcx > rep/movsb > mov $APIC_DEFAULT_PHYS_BASE, %eax > - movl $(APIC_DEST_ALLBUT | APIC_DEST_PHYSICAL | APIC_DM_INIT | APIC_INT_ASSERT), APIC_ICR(%rax) > - movl $(APIC_DEST_ALLBUT | APIC_DEST_PHYSICAL | APIC_DM_INIT), APIC_ICR(%rax) > + movl $(APIC_DEST_ALLBUT | APIC_DEST_PHYSICAL | APIC_DM_INIT | APIC_INT_ASSERT | APIC_INT_LEVELTRIG), APIC_ICR(%rax) > + movl $(APIC_DEST_ALLINC | APIC_DEST_PHYSICAL | APIC_DM_INIT | APIC_INT_LEVELTRIG), APIC_ICR(%rax) Level vs. Edge is ignored for everything except the de-assert IPI, i.e. it's just as wrong to send the INIT as level triggered. Selects the trigger mode when using the INIT level de-assert delivery mode: edge (0) or level (1). It is ignored for all other delivery modes. (This flag has no meaning in Pentium 4 and Intel Xeon processors, and will always be issued as a 0.) And KVM simply ignores the de-assert IPI (when it's correctly formed). In other words, we can simply remove the malformed de-assert IPI. > movl $(APIC_DEST_ALLBUT | APIC_DEST_PHYSICAL | APIC_DM_STARTUP), APIC_ICR(%rax) > call fwcfg_get_nb_cpus > 1: pause > -- > 2.17.1 >