Received: by 10.223.164.202 with SMTP id h10csp641950wrb; Sun, 26 Nov 2017 09:11:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMY8Lm/J3OWDlCP3Oqrlq6OlOepyDA6fnCq2D48r2BIdh6vtRh8cFmLmtsmJEzv8thQrjnVE X-Received: by 10.101.78.2 with SMTP id r2mr35208236pgt.320.1511716280361; Sun, 26 Nov 2017 09:11:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511716280; cv=none; d=google.com; s=arc-20160816; b=hXjubA1P7XuzCDSkSKqr24aEguW4sTGoHK3vT1+pjRpk0f1kWW2Lt7YqpqqxZDUnd5 97ymeEshVwR0x0WqS21MRifH7bBt5G+tnd0akaIbrMunM/XZBwezw0nCR1hs4xqhdeK/ 6EitapFqyDtcpOPL3qX2el55ZCVJWOT2QcppS4XYLZxLTJAkmdMlRUG+RpNDsayRQ3Mh lT6OPNot8RIxEvA6/uqqlZkLhoOhvd6ehzUrQLnOD1cXFGuq92vi7c4d25+85gVtkAA9 V6WsxEfLRhu5Nd0jRw4J3y7YJsRXKbuEVmc8M6wTpK8zCOHrEJ80jH6WrMzH7ubgHph9 mBAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:cc:to :subject:from:arc-authentication-results; bh=T/K4HnOZYQ/odXvYbBzZZQHqi9Dd4BQmX49R0XvaXjE=; b=MViW9ASNcU8v3bpwQ2nkTmQHAwzczDPxVDhaDFAD4ahD6LCN7ajwMUTwhIsNQq+2WU YZIU450oo7FwsYLcHQC4Es8mU8O7Z3ZWocoF8z3c7538A3pG7Z1mm8m8qFRKgKFWC5P5 3kSfJCiVHoRtSEFekw1wQBdyE1sxOR6eTPOZp4v8eTtnkm4ko9zYjhdvuuR0e/rYxZ9O xeBMElDy9BYlSGMPoaHsrhpFl2AZ4RFjLAuy5FHkInLi8SsQDGfneNcmU32hWGb4Yuw+ 4lDUfNYOQu90GJRId2bUSVt3Xc/DhyiCoXgEl4W+t0yMU/Im5sa+24kowj+Y9ple6HiH VmHw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si9884563pgb.546.2017.11.26.09.11.08; Sun, 26 Nov 2017 09:11:20 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752342AbdKZRKT (ORCPT + 77 others); Sun, 26 Nov 2017 12:10:19 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:19039 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752297AbdKZRKS (ORCPT ); Sun, 26 Nov 2017 12:10:18 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAQHABhp025886 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 26 Nov 2017 17:10:11 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAQHABCv006061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 26 Nov 2017 17:10:11 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAQHAATF004802; Sun, 26 Nov 2017 17:10:10 GMT Received: from [10.39.206.47] (/10.39.206.47) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 26 Nov 2017 09:10:10 -0800 From: Boris Ostrovsky Subject: Xen PV breakage after IRQ stack code refactoring To: Andy Lutomirski Cc: =?UTF-8?Q?Juergen_Gro=c3=9f?= , xen-devel , "linux-kernel@vger.kernel.org" Message-ID: Date: Sun, 26 Nov 2017 12:10:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy, (Can't find the original patch in my mailbox) This hunk from 1d3e53e8624a ("x86/entry/64: Refactor IRQ stacks and make them NMI-safe") diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index a9a8027..0d4483a 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -447,6 +447,59 @@ ENTRY(irq_entries_start) .endr END(irq_entries_start) +.macro DEBUG_ENTRY_ASSERT_IRQS_OFF +#ifdef CONFIG_DEBUG_ENTRY + pushfq + testl $X86_EFLAGS_IF, (%rsp) + jz .Lokay_\@ + ud2 +.Lokay_\@: + addq $8, %rsp +#endif +.endm + makes Xen PV guests somewhat unhappy because IF flag will be set. I was hoping to use ALTERNATIVE instruction but when we hit this for the first time we haven't rewritten instructions yet. Moving check_bugs() a bit higher helps but because this is common code I don't know how well it will work on other architectures (and, in fact, whether it is even safe on x86 in general, although that can be verified). Another option is to also add a parameter to DEBUG_ENTRY_ASSERT_IRQS_OFF (or to ENTER_IRQ_STACK) from xen_do_hypervisor_callback (which is where the failure happens) but this looks pretty fragile in that it assumes that xen_do_hypervisor_callback is the only place where we use this codepath before alt instructions are set. Any other suggestions? -boris From 1585195037878411497@xxx Mon Nov 27 05:16:34 +0000 2017 X-GM-THRID: 1584925162670558686 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread