[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/3] x86/vmx: implement Bus Lock detection
- To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Mon, 6 Jun 2022 13:27:19 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4WNgenD7RO/Hdtc9C1WsobotvwJWZeqx6euE/GeXOac=; b=YPLjZNn33gm/5nYKo3OoiVSuZ9onxF+zicugQlPYmNVHAtX2kWRc43S4ZhfwDhwpzXh4dcl2LqeGsbMXArcz6CX2XcWvL/NTlNNLr0bkxaBNO0SRYiOqO6whtGgeyreufF2WvfvPxrqY4QSNhpjswOB2uk9ev3Y6r1wurr9RNFFdFREFLv+CeoSOgQpY2GSUToE72A/d5oEyxQ8PreGBQIdD2j3a3kzCl+O2JMRtZJaFvCwvJYw4fM4ssKj6Aj89mxqEq2NKjbvXJYl5XbyzVP741deluGuXOPYSQnjL0MP3vplSg+yAQ8bsuvoqX8XbjhuBNexS+/c7s6Csv2aJWQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QNEuvxGjjMbo6BDoRXqF1ZiG/77L9DVq3auEl3LOpOBjV09uEajVRKIX7IZlmWUJyiKpdGsCts7PwaIulNMvEeqXv2bTLTAAP3ghHpCRvi23nVOHUoKwOwFvYnzZNjn451yD4EBN1D3vJHkbCc4ip3Q8LQs+RJ750JUvLQa5xhbREqpN/4kHTgkSvV3YoTy0goympwqVLKciWDjJsXHrup7XBaVxq9/s9icLXmTVgUwS8b5ZduH+R9ogg9HO4b8hfDInbiM6+o/Q0LCGHpJcV+73quTDGDMk/I1ZCH9cTx7hgg1RG9kb4Rv650lFJcrHwqf0uEM2vT83nBWT1hEo9Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Mon, 06 Jun 2022 13:27:31 +0000
- Ironport-data: A9a23:1s5EWqjFVxPbgyOhxBn0T0QHX161QREKZh0ujC45NGQN5FlHY01je htvCjyEb/+DYmP8LdxxaIuzpkxS75PTmIA1TFY+qSFjRiwb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M68wIFqtQw24LhXVvQ4 YmaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YQYvZ/zsl/YwaDBZCn1bBLR/0rXjYkHq5KR/z2WeG5ft69NHKRhseKE9pKNwC2wI8 uEEIjcQaBzFn/ix3L+wVuhrgIIkMdXvO4Qc/HpnyFk1D95/GcyFH/qMuI4ehWhr7ixNNa+2i 84xQDxjdhnfJTZIPU8aEskWl+a0nHjvNTZfrTp5oIJouTmInVMujNABNvLYWNCOTPpxtXyFt 2edxGbkCysdLoSmnG/tHnWEw7WncTnAcJIfEvi0++BnhHWXx3cPE1sGWF2ju/67h0WiHdVFJ CQ8+Dco664790WpT9z0dxy+vHOA+BUbXrJ4EOAk6QfL1qvd5S6YAHQJSnhKb9lOnM08SCEu1 1SJt8j0HjEpu7qQIVqC8p+EoDX0PjIaRVLufgcBRAoBptXm/oc6i0uVSs45SfHuyNroBTv33 jaG6jAkgKkehtIK0KP9+k3bhzWrpd7CSQtdChjrY19JJzhRPOaND7FEI3CChRqcBO51lmW8g UU=
- Ironport-hdrordr: A9a23:cvyZb6zrIq7oGTwD95UuKrPxc+gkLtp133Aq2lEZdPULSKGlfp GV9sjziyWetN9IYgBapTiBUJPwIk81bfZOkMYs1MSZLXPbUQyTXc9fBOrZsnHd8kjFmtK1up 0QFJSWZOeQMbE+t7eD3ODaKadg/DDkytHPuQ629R4EIm9XguNbnn5E422gYy9LrXx9dP4E/e 2nl696TlSbGUg/X4CePD0oTuLDr9rEmNbNehgdHSMq7wGIkHeB9KP6OwLw5GZcbxp/hZMZtU TVmQ3w4auu99uhzAXH6mPV55NK3PP819p4AtCWgMR9EESvtu/oXvUlZ1SxhkFznAid0idtrD AKmWZ4Ay1H0QKUQohym2q05+Cv6kd015ao8y7kvZKqm72EeNt9MbsAuWsRSGqm16Jr1usMr5 5jziaXsYFaAgjHmzm479/UVwtynk7xunY6l/UP5kYvGrf2x4Uh37D30XklWavoJhiKoLzP0d Meef309bJTaxeXfnrZtm5gzJilWWkyBA6PRgwHttaO2zZbkXhlxw9ArfZv00so5dY4Ud1J9u 7EOqNnmPVHSdIXd7t0AKMETdGsAmLATBrQOCaZIEjhFqsAJ3XRwqSHqokd9aWvYtgF3ZEykJ POXBdRsnMzYVvnDYmU0JhC4nn2MROAtPTWu7ZjDrRCy83BreDQQFy+oXgV4ridiuRaBNHHUP CuP58TC+P/LALVaPJ04zE=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYcPF6ki4pJ9UKm0etGSMPsHK7Oa1CcGeA
- Thread-topic: [PATCH v2 1/3] x86/vmx: implement Bus Lock detection
On 26/05/2022 12:11, Roger Pau Monne wrote:
> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> index f08a00dcbb..476ab72463 100644
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -4065,6 +4065,16 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
>
> if ( unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) )
> return vmx_failed_vmentry(exit_reason, regs);
> + if ( unlikely(exit_reason & VMX_EXIT_REASONS_BUS_LOCK) )
> + {
> + /*
> + * Delivery of Bus Lock VM exit was pre-empted by a higher priority
> VM
> + * exit.
> + */
> + exit_reason &= ~VMX_EXIT_REASONS_BUS_LOCK;
> + if ( exit_reason != EXIT_REASON_BUS_LOCK )
> + perfc_incr(buslock);
> + }
I know this post-dates you posting v2, but given the latest update from
Intel, VMX_EXIT_REASONS_BUS_LOCK will be set on all exits.
So the code logic would be simpler as:
if ( exit_reason & VMX_EXIT_REASONS_BUS_LOCK )
{
perfc_incr(buslock);
exit_reason &= ~VMX_EXIT_REASONS_BUS_LOCK;
}
and ...
>
> if ( v->arch.hvm.vmx.vmx_realmode )
> {
> @@ -4561,6 +4571,14 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
> vmx_handle_descriptor_access(exit_reason);
> break;
>
> + case EXIT_REASON_BUS_LOCK:
> + perfc_incr(buslock);
... dropping this perf counter.
With something along these lines, Reviewed-by: Andrew Cooper
<andrew.cooper3@xxxxxxxxxx>
|