From patchwork Thu Mar 3 01:09:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8487051 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E7FCF9F372 for ; Thu, 3 Mar 2016 01:09:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30F85201FE for ; Thu, 3 Mar 2016 01:09:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4899D202FF for ; Thu, 3 Mar 2016 01:09:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754997AbcCCBJ4 (ORCPT ); Wed, 2 Mar 2016 20:09:56 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:36303 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbcCCBJy (ORCPT ); Wed, 2 Mar 2016 20:09:54 -0500 Received: by mail-pa0-f44.google.com with SMTP id fi3so2364476pac.3 for ; Wed, 02 Mar 2016 17:09:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sEQ5KUJPQnMYteVe07OdAUA0dRwBhNvApxfY3xWpvhE=; b=e+zsvXTGpxm/xR6saSvUlVZfwzFknDJcczgwoYTZT22XNxvauhGBgLpmggnAmzmgdY zFNvobnEsbfZOuFWI4HlAdM5BGpY99dp9HRbdeWlf3EShQm82QzvBIufIyyxrM56OgiI gyBN7tnAfS52JGFaocK1Lo/Kj9WiVBujXbaRr8JiH5VS2yARfa2SuQRMomA+EaZ1eELV Bnit7YMQ7ggHMsLpZuxpwtCX1T2LBu2PPE3UG2neFEXzaAuKK4ZxTtF09+JU2MGJiv+Y zrisneWmQYphWdLQVFMZiGQBlWZXXBMkihCeZbw4vCk09JamzDicmZJHj+ZYaHrjB9oE l2zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sEQ5KUJPQnMYteVe07OdAUA0dRwBhNvApxfY3xWpvhE=; b=R6zhgqfx6j7TEb3ukgMHjQlt8c1P9Np8h9w0u49EfXVPiU+hhQ5UAOWUuwVEtD4kvw 9T0bQLegZsOa0LCc6+lfnt5btXB9cs46Pbk6AnJ9bTMc/oEIANNzzODc6/Pch54ZXjri vIcLg552YC5uBu79+Z07vctzJmcC74fzGMHg9gIaMoyWIR+tH8mzeCMdQgbwzjOpYk6u Ki4XQfFI/LavoBcdrLmzriaKcP/3ivD8TuVbReIFUuuEM+D/5dzDcna5JttTSU4eTQsU nG4qeUL/oBz62siWTikrLasHZzfEAuts/wMsY0+iYG0PkSMeR3kj4Ru4gqErQbZwGFCY QrcA== X-Gm-Message-State: AD7BkJI7gfOjcuw5jAdP0S+RXKfB4foBEfF2E2BCaVcLIrslpd8u0Lwlqy/27bI5+hYwFjRA X-Received: by 10.67.14.138 with SMTP id fg10mr43383460pad.145.1456967393265; Wed, 02 Mar 2016 17:09:53 -0800 (PST) Received: from localhost ([2620:0:1009:3:10b2:1b3a:febc:1b15]) by smtp.gmail.com with ESMTPSA id 81sm38901059pfa.12.2016.03.02.17.09.51 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 02 Mar 2016 17:09:52 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: pfeiner@google.com Subject: [kvm-unit-tests v2 4/8] x86: eventinj: make test work with -O0 Date: Wed, 2 Mar 2016 17:09:34 -0800 Message-Id: <1456967378-6367-5-git-send-email-pfeiner@google.com> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1456967378-6367-1-git-send-email-pfeiner@google.com> References: <1456867658-10937-1-git-send-email-pfeiner@google.com> <1456967378-6367-1-git-send-email-pfeiner@google.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With optimizations disabled, the compiler generated a call for irq_enable() -- rather than just inlining an sti instruction as expected. Thus the irq_enable ret would run in the sti shadow and the vectors would fire in the wrong order. Signed-off-by: Peter Feiner --- x86/eventinj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x86/eventinj.c b/x86/eventinj.c index bddedce..202ac19 100644 --- a/x86/eventinj.c +++ b/x86/eventinj.c @@ -296,8 +296,7 @@ int main() apic_self_ipi(32); flush_stack(); io_delay(); - irq_enable(); - asm volatile ("int $33"); + asm volatile ("sti; int $33"); irq_disable(); printf("After vec 32 and int $33\n"); report("vec 32/int $33", test_count == 2);