From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0427DCA9EAF for ; Mon, 21 Oct 2019 13:03:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4FB1214B2 for ; Mon, 21 Oct 2019 13:03:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728828AbfJUNC7 (ORCPT ); Mon, 21 Oct 2019 09:02:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36206 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbfJUNC7 (ORCPT ); Mon, 21 Oct 2019 09:02:59 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C846E796E7 for ; Mon, 21 Oct 2019 13:02:58 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id e25so6687346wra.9 for ; Mon, 21 Oct 2019 06:02:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eF2g6ycIsvHZKXf5+W5UwvelEhbKRjaOcX8P7/jfVL0=; b=f9AKbVWQCyo544H9mauYpzDLnD4bBtowfNiWMIKcWPkm4U1WH2ELxWI/owcrQJF+A5 zbOqQSj2o7s8SwFlQM7tgU44AODTiKbjeTLzXz8QyxMx4viAbhDDsO0ZSH5OvBIRDgOy uFmQkVTr+EZXeTmiBA31djJXgWLurKw1Lx5j59J2rlX5ykY0sBBzeYg34iBE/xlARrmE HPICSy1Zz94jH8fBaLxYeK11vfvIMIwHq7T+HepnUUgv29BR4+of2YQ4nZRQhJCX2jyw hBK2S6KSk8CxIc3928pK6mg7OrrU3muItAGkvtzYTXEj/iCeHAIS2Inou9e6aS8lY15V F6+g== X-Gm-Message-State: APjAAAXOkJkBcZIZf7MmaKxpZc6RCoMrO93rgIl7ku/oi2EMKVnTK1M7 3B9CXk6q6F9tw9X55g4eJYyRNNVvioDlFqqPLbbku5GxpWxcGExfVho4SXo5+OLkRK9t7QfvGQg lZ/w5JcGfpcie X-Received: by 2002:a5d:464f:: with SMTP id j15mr6154808wrs.366.1571662970588; Mon, 21 Oct 2019 06:02:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8eEoQCOsr7dhBRnnc9WFPQaqin+Qyx8So9afzziGxaMtUTqnyeqqzNX6YHHVvA66ycTY3Jg== X-Received: by 2002:a5d:464f:: with SMTP id j15mr6154764wrs.366.1571662970264; Mon, 21 Oct 2019 06:02:50 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:566:fc24:94f2:2f13? ([2001:b07:6468:f312:566:fc24:94f2:2f13]) by smtp.gmail.com with ESMTPSA id c8sm1383182wml.44.2019.10.21.06.02.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Oct 2019 06:02:49 -0700 (PDT) Subject: Re: [PATCH v9 09/17] x86/split_lock: Handle #AC exception for split lock To: Sean Christopherson Cc: Xiaoyao Li , Thomas Gleixner , Fenghua Yu , Ingo Molnar , Borislav Petkov , H Peter Anvin , Peter Zijlstra , Andrew Morton , Dave Hansen , Radim Krcmar , Ashok Raj , Tony Luck , Dan Williams , Sai Praneeth Prakhya , Ravi V Shankar , linux-kernel , x86 , kvm@vger.kernel.org References: <20190925180931.GG31852@linux.intel.com> <3ec328dc-2763-9da5-28d6-e28970262c58@redhat.com> <57f40083-9063-5d41-f06d-fa1ae4c78ec6@redhat.com> <3a12810b-1196-b70a-aa2e-9fe17dc7341a@redhat.com> <20191016154116.GA5866@linux.intel.com> <20191016162337.GC5866@linux.intel.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Mon, 21 Oct 2019 15:02:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191016162337.GC5866@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 16/10/19 18:23, Sean Christopherson wrote: >> Yes we can get fancy, but remember that KVM is not yet supporting >> emulation of locked instructions. Adding it is possible but shouldn't >> be in the critical path for the whole feature. > Ah, didn't realize that. I'm surprised emulating all locks with cmpxchg > doesn't cause problems (or am I misreading the code?). It would cause problems if something was trying to do crazy stuff such as locked operations on MMIO registers, or more plausibly (sort of...) SMP in big real mode on pre-Westmere processors. I've personally never seen X86EMUL_CMPXCHG_FAILED happen in the real world. Paolo > reading the code correctly, the #AC path could kick all other vCPUS on > emulation failure and then retry emulation to "guarantee" success. Though > that's starting to build quite the house of cards. >