Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4239978ybg; Mon, 21 Oct 2019 06:05:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3omBBAEsn0AODGDo0rbWjpdGVmZUUMpX1bUwszvz7kvJW48Bi6ob0/AK0RaVXuUc09C9n X-Received: by 2002:adf:da4a:: with SMTP id r10mr20709803wrl.356.1571663130997; Mon, 21 Oct 2019 06:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571663130; cv=none; d=google.com; s=arc-20160816; b=Mix7b/pJU5A/UfpJsyjzNiWc9Vk7JVvyGH+5cgD51jEVGdWPlrfmsmXopCXQx8IY/f 6Y0HkUNTq4CPF2jB8W9wQUZ9QGQIOdCJQVICMKVhQM5yTsTYCmQ/Sd/c6E0wy9ro+MPM lMS4O88dXESYR07nXYNd7dJQDP3HIvgiE1g2/vZLvx1lqjjjGuO5K9LlR644rRHUH6FO 86ZeyS4lpl6+SZo6K6vk5FNOKQpYG8sP3R1/ZcTmGEhxm0cWZPNU0q0GyzME8E8JqlFz lFNUBCrMs6iL3j2NxXnpcdR+QJH331ghEQMozjU9LKkSnP0Rof6O8a0j3eIS4UyW/GiV Gy1A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=eF2g6ycIsvHZKXf5+W5UwvelEhbKRjaOcX8P7/jfVL0=; b=PRDTuQIDDXrz47qTeLPhvT/VLFopwMAm+J0B205KnCrlu9csTIEfANjyxA2FjHGJcK H0egvnzLDcFyE2Y2DZEb3djscpcGQIlUWL5YSoTDSt1UojA5+6hvp63/2a+9ZhP76f5q K56LyDohvtpvK5N9uO85iV/j500fPkYpGMnYkf1AM6l9ev7jeanwGcTTa6QuC+4pZqgW gKjflG5NP6KULnp2JSFrsOh/MES60GwxuS1kDfl01BdDsjWp4cMAzIffLSiuES/W2c0N PECa80COzAR49eW2d0atX8bnjmr+6AqgsXPL62qa9rMFP0TynRoQn+4xFYvCQzJnhLbL ro4A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si10282079edj.354.2019.10.21.06.04.59; Mon, 21 Oct 2019 06:05:30 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728820AbfJUNCx (ORCPT + 99 others); Mon, 21 Oct 2019 09:02:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60658 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728017AbfJUNCw (ORCPT ); Mon, 21 Oct 2019 09:02:52 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (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 4589987638 for ; Mon, 21 Oct 2019 13:02:52 +0000 (UTC) Received: by mail-wm1-f70.google.com with SMTP id o188so5940984wmo.5 for ; Mon, 21 Oct 2019 06:02:52 -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=P+Xdv9uX34SA9FKNSiWqMNq01iCnlUTseVOSve8//dNduIFo3ZEl1XN1u+1heSgnir p+no/6XyOG0BDtRaVoxtcZ/deySQSpwjgHmVaOfDl4eotoyf6AXvw90Eks/N0C6pqnkr oaE4gYx3wHfgrvyOFsFlTAvbVDTdTlNcLBxThkkbXxtC0KPkM+0dN9CeqQszjbkXc7zJ 1sH0pLr/txjCR9KTmvZRBivVhPnMhUYsJv4WanuV0tRBwfNq7quWOq008dDmnfcMxE0O Hu25ugYAvdg9lotWgt+4O6wLyLG7VufNx5QXh5D96oNwjscWk0b/c8DirtlPRwNfkL9B KwMg== X-Gm-Message-State: APjAAAU9eHeoK/H408p3N5o41jF6cRmBXZi+tOb6zXAaettrstDX0KR4 gbaE/FKlXgvEja/o9xXz2QhZDAGffYP6gStUE0K+nokVxRq2OTMSjaTu07mPgdaIIbyg3pUaMGf 2kp27DPMl5bK/oe3XaOUxkxGN X-Received: by 2002:a5d:464f:: with SMTP id j15mr6154797wrs.366.1571662970587; Mon, 21 Oct 2019 06:02:50 -0700 (PDT) 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. >