From patchwork Thu Apr 21 00:39:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas K Lengyel X-Patchwork-Id: 8895571 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D2891BF29F for ; Thu, 21 Apr 2016 00:41:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0EDE20295 for ; Thu, 21 Apr 2016 00:41:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10D4320260 for ; Thu, 21 Apr 2016 00:41:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1at2ec-0007MO-1l; Thu, 21 Apr 2016 00:39:34 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1at2ea-0007MI-IY for xen-devel@lists.xenproject.org; Thu, 21 Apr 2016 00:39:32 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id F5/18-03149-34128175; Thu, 21 Apr 2016 00:39:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeJIrShJLcpLzFFi42K5GHp1va6zokS 4waR+NovvWyYzOTB6HP5whSWAMYo1My8pvyKBNePu3WnsBadEKiYtu87SwPiat4uRi0NIYCaj xOEFJ1m7GDk5JATesUh8vxAEYcdIrHs6nw3CLpX41nOPGcQWEtCQuH2zkR2ieQaTxOXpXYwgC TYBbYm217vABokIKEncWzWZCaSIWWAho8Srj7vYQRLCAtYSD24+ZgGxWQRUJVbP3wDWzCvgLP F1y39miG1yEueP/2SewMi7gJFhFaNGcWpRWWqRrqG5XlJRZnpGSW5iZo6uoYGxXm5qcXFiemp OYlKxXnJ+7iZGYEgwAMEOxpenPQ8xSnIwKYnyvvglHi7El5SfUpmRWJwRX1Sak1p8iFGGg0NJ gjdLQSJcSLAoNT21Ii0zBxicMGkJDh4lEd45IGne4oLE3OLMdIjUKUZjji2/r61l4tg29d5aJ iGWvPy8VClx3kyQUgGQ0ozSPLhBsKi5xCgrJczLCHSaEE9BalFuZgmq/CtGcQ5GJWHeSpApPJ l5JXD7XgGdwgR0Cv9dUZBTShIRUlINjG4xvZ+u//5yPuWCoFffpjWxc9yjQ6Q/z2L2vczCGzr v0u/dpj2zqq3PVM2R3ZDKFae/X+LK7N62BqacTRN5Pe23T7SuK2s87lU0i8v7/pGzO6deDZnN nmrJIv6loHxO1KtLxXeeqOjWG33asmJfUmrey4Sr/xcsuHpjx43W200KBe/Xluv7SSqxFGckG moxFxUnAgC06hJalQIAAA== X-Env-Sender: tamas.k.lengyel@gmail.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1461199170!35703702!1 X-Originating-IP: [209.85.213.175] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25679 invoked from network); 21 Apr 2016 00:39:30 -0000 Received: from mail-ig0-f175.google.com (HELO mail-ig0-f175.google.com) (209.85.213.175) by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 21 Apr 2016 00:39:30 -0000 Received: by mail-ig0-f175.google.com with SMTP id f1so143786246igr.1 for ; Wed, 20 Apr 2016 17:39:30 -0700 (PDT) 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; bh=JPNXdIzHqIDxT6g6BtPynsYjuIOCjw/210pYhWpTw8U=; b=SjrrjSY3zsT6zDq5mkV3szHXNf5fdqqVPyjKiqh1qaXL2AXi9rJD1tVIcGU7318h3m 7dN25cc+RXfLODtIVcjA34s6P79oj9rGUsmBS1OIofC6lvkGQuIbQ4mU3r06r5rHTIuh JJQ6dL8VZT5j9c29Gh2NnPGKBkQgbcof+Y4Dn8Zm0MqRUqpwdKitcGFhkdCQh82NnTko WWVLkxAyKwJ7bwdj+1i3n7pWpBtWYVwNfjhNeiEov96HvSf6eU/CDAwXxnbBLPVvjcwK nvq/mfh5MLitG65x5K/rAa46sg45NrNp+cqAHoArxCUFu0lDLPYd4B7XxnxlbXX0jDZ0 VOqQ== X-Gm-Message-State: AOPr4FUN7pgnBGMG91Fi1QO5ui4Xd3sANB2e7rjnYzfzLDDSrm8p4D2eQ4RKpLQrhQ13EQ== X-Received: by 10.50.30.101 with SMTP id r5mr155261igh.2.1461199169605; Wed, 20 Apr 2016 17:39:29 -0700 (PDT) Received: from localhost.localdomain (c-73-14-35-59.hsd1.co.comcast.net. [73.14.35.59]) by smtp.gmail.com with ESMTPSA id o15sm5966125igi.9.2016.04.20.17.39.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 17:39:28 -0700 (PDT) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Wed, 20 Apr 2016 18:39:25 -0600 Message-Id: <1461199165-20427-1-git-send-email-tamas@tklengyel.com> X-Mailer: git-send-email 2.1.4 Cc: Wei Liu , Tamas K Lengyel , Ian Jackson , Razvan Cojocaru Subject: [Xen-devel] [PATCH] xenaccess: minor fixes and extra printouts X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable 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 Without specifying the altp2m flag on the response the view never got switched. Also, add extra information printouts that can be useful during debugging. Signed-off-by: Tamas K Lengyel Acked-by: Razvan Cojocaru --- Cc: Razvan Cojocaru Cc: Ian Jackson Cc: Wei Liu --- tools/tests/xen-access/xen-access.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c index ef89246..f26e723 100644 --- a/tools/tests/xen-access/xen-access.c +++ b/tools/tests/xen-access/xen-access.c @@ -598,7 +598,7 @@ int main(int argc, char *argv[]) } printf("PAGE ACCESS: %c%c%c for GFN %"PRIx64" (offset %06" - PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u, altp2m view %u)\n", + PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u [%c], altp2m view %u)\n", (req.u.mem_access.flags & MEM_ACCESS_R) ? 'r' : '-', (req.u.mem_access.flags & MEM_ACCESS_W) ? 'w' : '-', (req.u.mem_access.flags & MEM_ACCESS_X) ? 'x' : '-', @@ -609,13 +609,14 @@ int main(int argc, char *argv[]) (req.u.mem_access.flags & MEM_ACCESS_FAULT_IN_GPT) ? 'y' : 'n', (req.u.mem_access.flags & MEM_ACCESS_FAULT_WITH_GLA) ? 'y': 'n', req.vcpu_id, + (req.flags & VM_EVENT_FLAG_VCPU_PAUSED) ? 'p' : 'r', req.altp2m_idx); if ( altp2m && req.flags & VM_EVENT_FLAG_ALTERNATE_P2M) { DPRINTF("\tSwitching back to default view!\n"); - rsp.flags |= VM_EVENT_FLAG_TOGGLE_SINGLESTEP; + rsp.flags |= (VM_EVENT_FLAG_ALTERNATE_P2M | VM_EVENT_FLAG_TOGGLE_SINGLESTEP); rsp.altp2m_idx = 0; } else if ( default_access != after_first_access ) @@ -652,9 +653,10 @@ int main(int argc, char *argv[]) break; case VM_EVENT_REASON_SINGLESTEP: - printf("Singlestep: rip=%016"PRIx64", vcpu %d\n", + printf("Singlestep: rip=%016"PRIx64", vcpu %d, altp2m %u\n", req.data.regs.x86.rip, - req.vcpu_id); + req.vcpu_id, + req.altp2m_idx); if ( altp2m ) {