From patchwork Thu Feb 11 19:51:00 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: 8284831 Return-Path: X-Original-To: patchwork-xen-devel@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 3DBB39F38B for ; Thu, 11 Feb 2016 19:54:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D3602034C for ; Thu, 11 Feb 2016 19:54:15 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 784F920306 for ; Thu, 11 Feb 2016 19:54:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTxGh-0002q2-4v; Thu, 11 Feb 2016 19:51:11 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTxGg-0002pw-65 for xen-devel@lists.xenproject.org; Thu, 11 Feb 2016 19:51:10 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id A5/E0-06685-D26ECB65; Thu, 11 Feb 2016 19:51:09 +0000 X-Env-Sender: tlengyel@novetta.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1455220268!21854245!1 X-Originating-IP: [209.85.214.172] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60051 invoked from network); 11 Feb 2016 19:51:08 -0000 Received: from mail-ob0-f172.google.com (HELO mail-ob0-f172.google.com) (209.85.214.172) by server-2.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 11 Feb 2016 19:51:08 -0000 Received: by mail-ob0-f172.google.com with SMTP id is5so89616276obc.0 for ; Thu, 11 Feb 2016 11:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=novetta-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ARS/Dc1RNkPcpzozU8MXXxlCk2Lo4yGakvXlN9RvDSI=; b=rR9Q1UCQItq/3smout1jmqVne8yGoUJyhw7qrdTe84V8I/DK5jdSzdCuVICEfcpA2z zVU+zuqm1YlSpRnnOSmn9v35/fVue6DuE/QkWqQL2STNWR0cQiCVpvaH7rJToxuCspao Yh3BPNFkJlQJKTmIR/IpWJP7PU0H+y63DOmZL9zkKvdrAB8A6lbvbE9xLPC/JLqsPKSN yM3AUbfU9wJfhgsTd5WYsAEjcGqYnEnFf3KEaftXX9wOHCBykyhGL35RxKguOla/15Mb nV0uGfrBrewd6U7nWrJ8GVJ2jk/RJWosiY4PC6H+E/ZU8VfoBSg9alCY74qkfypBk7Gj F+hQ== 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=ARS/Dc1RNkPcpzozU8MXXxlCk2Lo4yGakvXlN9RvDSI=; b=RBpkvHchXnrpiUx7pRydAfkwesqaj2O+xef0g2+gH+E99PFsHpjdjf8MR/0GjSeTxT WHr2JC7yG4sWsZBhA2jicPSBRYwIV5BTSgy2/dA388hIGeSx6f5ki28i3TZ8w2/tAnDC FjoxXHYTMfgkZ4zDkO8bRiigtKOaLYGPprUegSp1jnYZjXZhZbA7j+PrX22Ezv8eGRne eQ26+2Zu7TxR87Ty8umfAtKM92l7z2gDhnWAs160RYHxskhi2PYWIs1v/PlKtYhrlruJ LptPuTEOwNso+6/HC3kxo2lrxMrsENuUd4/LoYWrpGpFwNbg71nSG/weSZ8aUFscvhf1 mDYg== X-Gm-Message-State: AG10YORfAvkH5WgxNPGM85UY0uahVsAP0lbs06WVMTPVRIVZk5Kzo7nNg/k1ofZgy7UicWyk X-Received: by 10.182.33.166 with SMTP id s6mr47534812obi.30.1455220267598; Thu, 11 Feb 2016 11:51:07 -0800 (PST) Received: from l1.lan (c-73-14-35-59.hsd1.co.comcast.net. [73.14.35.59]) by smtp.gmail.com with ESMTPSA id fg8sm6276800oeb.16.2016.02.11.11.51.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Feb 2016 11:51:07 -0800 (PST) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Thu, 11 Feb 2016 12:51:00 -0700 Message-Id: <1455220260-5987-1-git-send-email-tlengyel@novetta.com> X-Mailer: git-send-email 2.1.4 Cc: Tamas K Lengyel , Andrew Cooper , Keir Fraser , Jan Beulich , Razvan Cojocaru Subject: [Xen-devel] [PATCH] vm_event: Record FS_BASE/GS_BASE during events X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 While the public vm_event header specifies fs_base/gs_base as registers that should be recorded for each event, that hasn't actually been the case. In this patch we remedy the issue. Signed-off-by: Tamas K Lengyel Cc: Razvan Cojocaru Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper Acked-by: Razvan Cojocaru Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/event.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c index a3d4892..c218f12 100644 --- a/xen/arch/x86/hvm/event.c +++ b/xen/arch/x86/hvm/event.c @@ -28,7 +28,8 @@ static void hvm_event_fill_regs(vm_event_request_t *req) { const struct cpu_user_regs *regs = guest_cpu_user_regs(); - const struct vcpu *curr = current; + struct vcpu *curr = current; + struct segment_register seg; req->data.regs.x86.rax = regs->eax; req->data.regs.x86.rcx = regs->ecx; @@ -55,6 +56,12 @@ static void hvm_event_fill_regs(vm_event_request_t *req) req->data.regs.x86.cr0 = curr->arch.hvm_vcpu.guest_cr[0]; req->data.regs.x86.cr3 = curr->arch.hvm_vcpu.guest_cr[3]; req->data.regs.x86.cr4 = curr->arch.hvm_vcpu.guest_cr[4]; + + hvm_get_segment_register(curr, x86_seg_fs, &seg); + req->data.regs.x86.fs_base = seg.base; + + hvm_get_segment_register(curr, x86_seg_gs, &seg); + req->data.regs.x86.gs_base = seg.base; } static int hvm_event_traps(uint8_t sync, vm_event_request_t *req)