Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1240167imm; Tue, 2 Oct 2018 05:15:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tHs4yG7BoxO0fM0BfaiMUFepzpEV0nFCr1L2wO6whe5ETw76sQfOUT0HQ3NKxF49FSiag X-Received: by 2002:a62:2bc2:: with SMTP id r185-v6mr99499pfr.21.1538482512878; Tue, 02 Oct 2018 05:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538482512; cv=none; d=google.com; s=arc-20160816; b=Q4/TssYgBVhPJaLEj6QewPN6SRAm1l4TMs9sHosfRT/1lxF7QBQzsJxQb18NZ+bQ1W NCf/Tz6PZRf9Wp35Iy+HBVKBL5Y7fU9jOJAb7KuaEWmLugPzG8Ea9cgMqPToDJShS3e2 5OX7XT0ezfpL6L64UnJImFJluAX2RgqhYWTqSyEhKEgYNn9N6r6CshXaZvqK9NBwNVFl Nhp5TAUTUU6+SuAjoSZSkSEvrptoQqjvD6rm3jQ4p1E6ybb2AAGTBn5Ag03VpA4tIQbF GRk6Gmg2oy3hT86QVlrmuO8SWPkZbxpbTO/PIIyJWREUHsgX0gtOT5F+8kWCgyhkQBUS gamw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=J5WPZWG/h0NV32YkdIvPGQn3v1K58X3fVQOyDyJADDU=; b=uliIoBgAvQvHN3XVOAT5e4quW9o7Ibhlqz4YMy8FW/OMxjWVeeiyWbdnj8wdDx/XV4 jS50udrJFw8v6KKyQR600qPeCLKmB5DARoKm/iobIFHWkrhF9pZ5F68oH779+3fAyscS JiOmiPhL9yld7jTeBWZ3eAXUzP/NaxGkZv35pbzFJ9Xl0cKLdobxHwkE2m1kPVAcZtxm 79bmZnADfQ4Lptd2wDGcrmPQTDgD3Ik+l6PZLcKUNQBwAIt4zwG2CLZKU9M8Z8N517vG 5yqciUpQ/+gppr07ddF+I6FcUU6LUAFum4KpN7OYlb23lWSzJ6UsOBztli/BR9GbIyut rGeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4-v6si15581631pfa.285.2018.10.02.05.14.58; Tue, 02 Oct 2018 05:15:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727832AbeJBS4U (ORCPT + 99 others); Tue, 2 Oct 2018 14:56:20 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59904 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727742AbeJBS4U (ORCPT ); Tue, 2 Oct 2018 14:56:20 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g7JYC-0001G4-6h; Tue, 02 Oct 2018 14:13:16 +0200 Date: Tue, 2 Oct 2018 14:13:14 +0200 (CEST) From: Thomas Gleixner To: Juergen Gross cc: linux-kernel@vger.kernel.org, mingo@kernel.org, sthemmin@microsoft.com, mikelley@microsoft.com, kys@microsoft.com, haiyangz@microsoft.com, yi.y.sun@linux.intel.com, hpa@zytor.com Subject: Re: [tip:x86/hyperv] x86/hyperv: Enable PV qspinlock for Hyper-V In-Reply-To: <0005fc50-4415-87a0-1954-fb15a1f8bd0b@suse.com> Message-ID: References: <1538028104-114050-3-git-send-email-yi.y.sun@linux.intel.com> <0005fc50-4415-87a0-1954-fb15a1f8bd0b@suse.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Oct 2018, Juergen Gross wrote: > Sorry for noticing this only now, but I have been fighting with > Xen PV qspinlocks last weekend: > > > + /* > > + * Read HV_X64_MSR_GUEST_IDLE MSR can trigger the guest's > > + * transition to the idle power state which can be exited > > + * by an IPI even if IF flag is disabled. > > + */ > > What if interrupts are enabled? Won't a kick happening here just > interrupt and then the following rdmsr result in a hang? > > I believe the correct way would be to: > > - disable interrupts before above READ_ONCE() and restore them > after the rdmsrl() > > - return early if in_nmi() > > similar as the kvm specific variant is doing it. Interesting question. I zapped the last commit for now until this is clarified. Thanks, tglx