Received: by 10.223.164.202 with SMTP id h10csp4136306wrb; Wed, 29 Nov 2017 01:21:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMYGgCaoPnXBuUysNhZSDoIJsAPBfG4Dwcwmcr7RJBQK6Jpr9QntldmnwPeRY2XgPoTR3yNn X-Received: by 10.159.202.130 with SMTP id p2mr2168398plo.309.1511947298096; Wed, 29 Nov 2017 01:21:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511947298; cv=none; d=google.com; s=arc-20160816; b=0PGnmH04fJxXtnzoBEubC3vpMLN22sREDCR31kbZ9c/J198fg2+LlfFNsJ/U6s2Eit embTihh8f+rBt/qFsn/ypRVBYWPGTGy5QIb4OVzeiMPG6s7X5z3zm2NhNSs7XOu8qUw9 iKhzcGqy4T4aOqbwtIJbKMWnVxw/KHiRoEE3iA6vH4F0/UF46xtxEB5Gp3VaOvUuG4Pu TwBzThwUy2nBM4TFuqdFEyw5d0x+Gl/DYenBjhgCRnW9yapH5tuU86nKFVcIbbIWPOCM G88Xc7wD1QmAq9zEDr6qCuOkBGhB/xlDI/P/90e5135P9B1xBpM2g/xjFXJnI1nWGojh R25A== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=ZvR5u9ARFKuV4WcpP9d5X5uxgN1I9dl644Xu1H9mr6k=; b=LlTUQqfp/ZAm8g51ikLrKoeb+4MLDkmJjGY+LzuLg6f7XHsycAC76MEPEjKfPAVN64 5PkO6n9LhwpAAVcxeZdm3rduCQtS2aMbxwbXxYrA4YdwDcFzRV+QtfRzdGxyZ8phukga nM8vqyvDVwRdKcusKQziqawRFr/xObUpgqtnR9hbqnlyivAOjdO1pMbDQZNDX++S770+ F5NTbFYnJVbxVIzeE3lAZb4Ug4obpibLRFWVNP+8lg+5HHGndHDciefilpWYZfr0qcPi a3u3XzObF2fMBDBV5FsbyCvdH+smU4fqaiQXjeDwJHE3umotEGDbsiQGOmxMjnfdC7YZ r1Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SlIFxg3f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si971786pgp.66.2017.11.29.01.21.27; Wed, 29 Nov 2017 01:21:38 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SlIFxg3f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752515AbdK2JUp (ORCPT + 70 others); Wed, 29 Nov 2017 04:20:45 -0500 Received: from mail-ot0-f170.google.com ([74.125.82.170]:41608 "EHLO mail-ot0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443AbdK2JUl (ORCPT ); Wed, 29 Nov 2017 04:20:41 -0500 Received: by mail-ot0-f170.google.com with SMTP id b54so2435126otd.8; Wed, 29 Nov 2017 01:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZvR5u9ARFKuV4WcpP9d5X5uxgN1I9dl644Xu1H9mr6k=; b=SlIFxg3fIQFl1n+GCqzFTHnDvubI0whftGhyI0aDTpPDRyf0Dr9XtelimrhFGp0/hY xJMQXY5grAlMyXfXAz676guwz5VhtcOmJLjY9v0tfYB1yy4JFLmaRkfxGn83uqUe5n19 EnJmPOOGBrBoVVJUTnMURe6qgQlpuOUiw2KDHzYoUa0XPybMteiVp3Lze5JBOMNjkhgo m3cS8qj+0DIihLKH/S7FtehlPd6f1aekuB0zwi9tyS3WrOOikxP3LrdFaBfWFgUnb62R Kyu5bLsl9Bt2ysXAYPfjWlRwv5Hgg2bgHQM0/+nYSLe1Sw0LKD/L0R7zSfFnIg7iBH9C rXVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZvR5u9ARFKuV4WcpP9d5X5uxgN1I9dl644Xu1H9mr6k=; b=e4rLyvNN7/8Kyj+9722+aRlBFFJzK6WGPwYm9iGADqnD/oM5kzZL4KEA2J2PW+DoSz NQ0AOlAbhWpXS0Xu84PLiQU2h35onJWZnJDUvPXtQjygcYL+uRXivlmzTLwTTb0Rp0jj 8PUzqxyBPx/sKF62sZJY2Rk8vZZZJM6ZOa1SH+Z1H9HI0+qTA6xEnCJe5CZM8MkVBSQe jTO2+68uvHCFKMQ7uPug/RPiVVd9vprG6YbQTi0DFCt40qZNAkicp667tpct7LcSQr9a sdwu/OjQpIXi7b3gtUV+UMUT9smH1pbYUSM1Y5JERS7TRNCxg+jkVIAALDYXvJR5v5Tl y/tQ== X-Gm-Message-State: AJaThX4J8IHLjarSrnHE1Y6Lb5o74p1mZAWimUed+jopgrUpTv49MYzo mzMzf+2mlqB7ksR9uOK/1FoWqlZfcbXO+BBAH5k= X-Received: by 10.157.49.40 with SMTP id e37mr1760431otc.45.1511947241059; Wed, 29 Nov 2017 01:20:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.209.8 with HTTP; Wed, 29 Nov 2017 01:20:40 -0800 (PST) In-Reply-To: References: <1511935673-7371-1-git-send-email-wanpeng.li@hotmail.com> <5ce1fb8a-05e1-3122-9194-73194a851da4@redhat.com> From: Wanpeng Li Date: Wed, 29 Nov 2017 17:20:40 +0800 Message-ID: Subject: Re: [PATCH] KVM: VMX: Cache IA32_DEBUGCTL in memory To: Paolo Bonzini Cc: "linux-kernel@vger.kernel.org" , kvm , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li , Jim Mattson Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-29 17:13 GMT+08:00 Paolo Bonzini : > On 29/11/2017 09:51, Wanpeng Li wrote: >> 2017-11-29 16:48 GMT+08:00 Paolo Bonzini : >>> On 29/11/2017 07:07, Wanpeng Li wrote: >>>> From: Wanpeng Li >>>> >>>> MSR_IA32_DEBUGCTLMSR is zeroed on VMEXIT, so it is saved/restored >>>> each time during world switch. Jim from Google pointed out that >>>> when running schbench in L2, vmx_vcpu_run will occupy 4% cpu time, >>>> and the 25% of vmx_vcpu_run cpu time is occupied by get_debugctlmsr(). >>>> This patch caches the host IA32_DEBUGCTL MSR and saves/restores >>>> the host IA32_DEBUGCTL msr when guest/host switches to avoid to >>>> save/restore each time during world switch. >>>> >>>> Suggested-by: Jim Mattson >>>> Cc: Jim Mattson >>>> Cc: Paolo Bonzini >>>> Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 >>>> Signed-off-by: Wanpeng Li >>> >>> The update_debugctlmsr should stay in vmx_vcpu_run so that tracing >>> features work correctly. However, the get_debugctlmsr indeed can be >> >> The tracing can't run except vCPU is schedule out, so why >> update_debugctlmsr should stay in vmx_vcpu_run? > > For example your patch is disabling BTS (branch trace store) after the > first vmexit, isn't it? I see. Thanks for pointing out. :) Regards, Wanpeng Li From 1585391334800541789@xxx Wed Nov 29 09:16:37 +0000 2017 X-GM-THRID: 1585379526281584765 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread