From patchwork Tue Sep 18 09:45:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1471541 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F3BA4DF24C for ; Tue, 18 Sep 2012 09:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757697Ab2IRJo6 (ORCPT ); Tue, 18 Sep 2012 05:44:58 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:57743 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757694Ab2IRJo5 (ORCPT ); Tue, 18 Sep 2012 05:44:57 -0400 Received: by wibhr14 with SMTP id hr14so3698661wib.1 for ; Tue, 18 Sep 2012 02:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=VVZvkaQLEdueR3WeD6QSKz+IdNLcXhvQYr8I+LWuRn0=; b=AL3zZAZpIFeJCBm6R74/oeGPNgVr4J8Y6OpmEaEgPCGrhzkxE1DT01kJo5RW3S6r9K xUGaM892PGLfspmWhweZD9KxldJQg26ohNeHSGwEUGbQwcssczwIy+IPoeD0yI3Lj4G4 FMkEW7uiHYJSPpiUzt7N/Tm0TuJ4IKgbtTleZi9ILTF22eO6bhlrwYNGVcjLmqazzTn0 YikLJ8vK8/CIURixgZ/stBFRPG/AUOcFCYbAPf6/Y3UWV46MMFI7sOtEz19yRsbZx/VN IRZTj2aKsQJYUq52nOYxEt2y9skqCJW8cbhOhraeVrTV9bRp/7jS1AWjntvsZudmYvAJ 71FQ== Received: by 10.180.24.197 with SMTP id w5mr22072316wif.22.1347961495738; Tue, 18 Sep 2012 02:44:55 -0700 (PDT) Received: from localhost.localdomain ([37.46.33.122]) by mx.google.com with ESMTPS id q4sm22016305wix.9.2012.09.18.02.44.52 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 02:44:54 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, Sasha Levin Subject: [PATCH] kvm tools: don't exit on debug ioport write Date: Tue, 18 Sep 2012 11:45:13 +0200 Message-Id: <1347961513-2016-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org While it shouldn't happen on regular guests, we sometimes hit it when fuzzing within the guest, which would cause the lkvm process to exit - which is undesired. Our PIT tests were using the debug port to trigger a reboot. Instead of using that port we now use the reboot line of our i8042 controller. Signed-off-by: Sasha Levin --- tools/kvm/tests/pit/tick.S | 14 +++----------- tools/kvm/x86/ioport.c | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/kvm/tests/pit/tick.S b/tools/kvm/tests/pit/tick.S index b9e5a80..635dc8d 100644 --- a/tools/kvm/tests/pit/tick.S +++ b/tools/kvm/tests/pit/tick.S @@ -4,15 +4,6 @@ #define TIMER_FREQ 1193182 #define TIMER_DIV(x) ((TIMER_FREQ+(x)/2)/(x)) -/* - * hpa noted: - * - * 0xe0..0xef are "motherboard specific", but 0xe9 is - * used for Bochs debugging and 0xed is the Phoenix-reserved - * delay port - */ -#define DBG_PORT 0xe0 - #define TEST_COUNT 0x0200 .code16gcc @@ -82,8 +73,9 @@ test_ok: mov $(msg2_end-msg2), %cx cs rep/outsb - /* not a valid port to force exit */ - outb %al, $DBG_PORT + /* Reboot by using the i8042 reboot line */ + mov $0xfe, %al + outb %al, $0x64 timer_isr: cli diff --git a/tools/kvm/x86/ioport.c b/tools/kvm/x86/ioport.c index 86302e6..4ea0091 100644 --- a/tools/kvm/x86/ioport.c +++ b/tools/kvm/x86/ioport.c @@ -5,7 +5,7 @@ static bool debug_io_out(struct ioport *ioport, struct kvm *kvm, u16 port, void *data, int size) { - exit(EXIT_SUCCESS); + return 0; } static struct ioport_operations debug_ops = {