Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2856501pxb; Thu, 10 Feb 2022 07:06:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFzTv388W73G5eAktqRSM2zAPS9WwaotnKAVL++km3vHXR99pZwqweXmX/RcxY71ku4vLi X-Received: by 2002:a17:902:9698:: with SMTP id n24mr8000179plp.60.1644505561517; Thu, 10 Feb 2022 07:06:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644505561; cv=pass; d=google.com; s=arc-20160816; b=fgu3ucBKpAH3apasCgNH2D6gmNprumhktxRQQrjWyuPNQK06pfs3WDSwgKP6ZleBM9 +YfjhmgIVg4kM1Ir134HCswjGPduIchK3qSzzoXKgV1O9+rr5r+2Fq1CBpy8NABjflSq c16SRUQeZ2y0CAtNILDvkfz9UzXdh36aas6In7IJ1s/UH9EtGgEuMiri9SAqMdZd/2K3 qEa2ClbF6YK/D8q8DOPIzMv1effaY9JFqMGO5PjoQimVcD7SqUaezzXdY+1ZM9+hm8DG 6aDYrKzjOLP75pry1+Mgt8AXrhUbyjO+AmVsHrDFkKYGPKk95HSRYemRyyYgLpIt0qdt 2g4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject:date :message-id:dkim-signature:dkim-signature; bh=Tus0124XqOoj0fvHq9TmPa2z5itSeMn54MsAmqMBUbA=; b=KvAOhsEmW73mtieekC1REfysKFt9jQoOne/WhLZOgou5WDrLR9m8gHrKTNt5M7HLcj BkDYoyUuqhAWXlGXPjM0YnU/Mv1/rm4V6qejay2YQUUznXBx1czuFq8GxtOoOOLOIPJx qYGrFsJPXvihcntRShKRY9MpA1M/8s92koHnmN0kTReN7ulsZSVoIlF6lSJ4hIKd8xVW J0Nohc2ObLJ7V/6zl6OX/teJhoyADUJCH4yTkEKCqzRQrzM9WbYRosDbSK4sA0OlYXNm jNC4qgsBcgF0nf1akxlbfgeC7LG/dpDZ8HowPd4TODdOQqSTnITcfJreZP1ZsIYrht7D JxEg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=Mge+M6wO; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=opOVmbZj; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kx1si1643701pjb.157.2022.02.10.07.05.47; Thu, 10 Feb 2022 07:06:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=Mge+M6wO; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=opOVmbZj; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241508AbiBJMSE (ORCPT + 99 others); Thu, 10 Feb 2022 07:18:04 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232947AbiBJMSC (ORCPT ); Thu, 10 Feb 2022 07:18:02 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D864B54; Thu, 10 Feb 2022 04:18:03 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21AC9CLd013346; Thu, 10 Feb 2022 12:17:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=Tus0124XqOoj0fvHq9TmPa2z5itSeMn54MsAmqMBUbA=; b=Mge+M6wOHtqWPhQ8/j+UEmLLKrd6gYl91qjPRNzq4q/QoR6Xfie0zj8tvGvf1jFAbM1S ZXtDNMraCu9Tsp/1FqlJR8Lf59RIOpdfQJxbrvyNeIfornHwJSNhRIJlWPEo/aULanYb 9fXHmPNQNrRgFLyPzkS7fgOFEgaPcGvl9h1yztgv3ECpzf4lPLBlfkT6RdZ67GZNpE4o CMPmFDZsQGOHPQGBaWVpZac/D6bZEGx4QZIGZexrPzmDI2NgkfQC7K7ADu7TJ0j+P9Jv 0OWR+xo61m4QxkZ4H/XdAlGFkRDJFkM+MFwGe4bHIorAt56NTzm9FsvZydNy07xzLtRw pQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3e368u0wq6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Feb 2022 12:17:24 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 21ACGp3u167374; Thu, 10 Feb 2022 12:17:23 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2172.outbound.protection.outlook.com [104.47.58.172]) by userp3020.oracle.com with ESMTP id 3e1jpv4q7e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Feb 2022 12:17:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O9DUDjKRf3zBBQ0dY1xP+L9XQ0r6wi1+VfdknSYqSFXcMMWigPMINv0XaxPl/5Xrg5Xp6xokjzsukcqtDYROaSRMiGxW7Ck0MVenaoQE+5oJtc9rdUIE5V+56Ngo+qJPdwOA1z8C/9g6pG7zskTNYCbG6y2M4NHOOYSW86Bb0rpmn1YBb3/zjOluCsAJHjQoHXso+5Lb20tdF7cILDEiYT/OfSnmFptZvjwjueCgo5vOfAfspkF6PZnk3+zHLir72nXLgUrg2okHrvMbeyKn2HYcXwfZlbzthibILbGd/dLgVUXSF8YxI82NmXiLhcmnAqFaHOMNQyxYOzjrUeB50w== 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=Tus0124XqOoj0fvHq9TmPa2z5itSeMn54MsAmqMBUbA=; b=dn6GkY5MuKAtBUuqXoiZsSRgYgLujt1htfbVIokMFN+7kouEQ49i5T1+4Hu+peNMbDe00J0JH19WG/SSR2A1N4JvIUgCg4aYpRFb6O19hBp8xO2Q4UH2Q6IJIFplzvkoxulRZn3yxXKdZ6qbGsEYSQXmKTrOpEgV8uVaXvkN6AobrGJfI4aB5IQA5rmJz14x+fQdMk7eY46drI2Qqt142e2SxYqtZdDlZToqlOrFv6EaqrqMaS6rRQyuF78TQaqAGNzJd3vsS+slIlv3D9rRpvew7lHOgbv47gVyFW11vgC+ZbfRCt/fIl/kiL9jjIiemZlEV2iQ5/S/bXp94Kka6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tus0124XqOoj0fvHq9TmPa2z5itSeMn54MsAmqMBUbA=; b=opOVmbZjD6I4jSgijScNU0o7OptdkrC9XQzh8rmZ0ExnYof5CewRtafr2kXXH2RhrxHE+26cWkog7ofY3oiqf/Dx7s2kfx1Hcu+4uhTzccs5r47wNLB98jEw2Ne9cKyiBnjpTHbfOdqAIODTwAFOe7N4kR5/M5O7gvJei620ReI= Received: from BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) by DM6PR10MB2651.namprd10.prod.outlook.com (2603:10b6:5:b9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 10 Feb 2022 12:17:21 +0000 Received: from BLAPR10MB4835.namprd10.prod.outlook.com ([fe80::4910:964a:4156:242a]) by BLAPR10MB4835.namprd10.prod.outlook.com ([fe80::4910:964a:4156:242a%5]) with mapi id 15.20.4975.011; Thu, 10 Feb 2022 12:17:20 +0000 Message-ID: <97b17522-ec57-3ad5-b9cf-037835158e48@oracle.com> Date: Thu, 10 Feb 2022 12:17:12 +0000 Subject: Re: [PATCH RFC 15/39] KVM: x86/xen: handle PV spinlocks slowpath Content-Language: en-US To: David Woodhouse Cc: Ankur Arora , Boris Ostrovsky , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, metikaya@amazon.co.uk, linux-kernel@vger.kernel.org References: <20190220201609.28290-1-joao.m.martins@oracle.com> <20190220201609.28290-16-joao.m.martins@oracle.com> From: Joao Martins In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0062.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::26) To BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4082cc3a-d7ca-4e5b-e1a8-08d9ec8f495e X-MS-TrafficTypeDiagnostic: DM6PR10MB2651:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EfCfUb09sg04YAEedxy/O5FjWH6iXhCYGm9P5iLN1SFmXwubLsY9cpPO5TPvKR0ai0OOHIYkqGv0p/sH4OMwRPCCcRZnCxdJX1mZvU8oAMLo+obdqVRgEsrx5UZG9S48ziCF9LIxuPtS7rXjWZsb589kVGNqv0aAnFwQj8vAGYkPyOoUVK29HnWRiodyoUdGNAesWBGWlKPtuhrr8PK0Tr/ky9/8ern0I6V/KQ7s5HpNJpXvUMbX8xrnx7h3+Oo0ldGYhhRi+FywsQs2aBwROQFt9pCkiFyGCdfHWkzHlDBLt6nrR7bc4vke06dRynLSQZDgGRioh2kKCLGnEe4Pak1SJL+vK5/9c4M+f/JXUhAjkmWS9pCIulPL0EumuvrTTOqwshlKsnDGBzEQLJXCOQI76WCM3OyhL8MgZg7S1uGeNTcgJiyvNVwsT9gYJNQ2lZCWbh/Q3jJ1YBbXzMZx+h6FtWJ+4Dy6TM9+6ik+JC0xFcjGSMo2j5ZbD5q5JhTPlWqTYyc/N5R++lcHMtm2zVgPpaOrhGUN+s9n1l9ufPy8YfiAD0Q66aElSXK4dHEgScITQAeEC6iJsQ5HsFMp2d0Wj2LM8D1Wn7fTGoFAcKK8qjZfd7+PhFbGpbsJrnrn88xJEGq+xI6xPLwj++NcMKW2bMR5WiiAHhXyXxjC9xMMH9LVI1rwC7GF1j6ssSzKx9MKbcxwMBIzNKyPk6luzdt8JA7aLmfNqx6RZqkKxa76T78WZ8nfoAsKNlsWC7CJlLU1dbXZlpbGuminCUUZQTBEW6RBgyjbnkcdG5WcKgA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB4835.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2616005)(31686004)(186003)(66946007)(26005)(6512007)(53546011)(6666004)(316002)(86362001)(6506007)(2906002)(508600001)(38100700002)(8936002)(966005)(7416002)(6486002)(5660300002)(8676002)(66476007)(54906003)(6916009)(31696002)(4326008)(66556008)(83380400001)(36756003)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YXl1clo2czNkOW9nclpNcENmSlBXMnFvSnVtd25EODFKVGZFR3JsZTlWRXY3?= =?utf-8?B?NVVtVzFuWDA1NjEwNXRBNTdMUlREZ01PMzNwWWJxaDVydk5UeHIrOXZmblE1?= =?utf-8?B?RVpIVktEV3N6eXpGNDM3VXNSL0RpVGV4Rld0c1BIZXNDbWM2M1dUOG1RZW9v?= =?utf-8?B?UTllM2h6WEN2WHhUd0ZFUHdFYTdMUlY0RDU5Ny8vOW1zYW9lUXpvT2xSUXpp?= =?utf-8?B?S21xR3FqYytYUXNhVE5rMEszNmM0a1RBVkkwcXZuOVFHbCtrL3JhTmRBc2g5?= =?utf-8?B?MnB6dGptakhTME1BN0JrNlE0VTdUTVhXVDBJWWNlQlE1VFExNG5SWGxoZ0Fq?= =?utf-8?B?dmpjZ0c2SVNUTi9QbWdTdEFwZWVEOHdqWjcydkQxcUxEM2JCMGY1ZTl6ZDIw?= =?utf-8?B?alpOUE1rRkdkRmFidDRYdnJudWxBNXNmYTM5VmJoNEE2RzJycml4a2MzOXNz?= =?utf-8?B?WkRZLys3RTNmcXo2SnYxUHdMb3N2ZjZINis3WEkrV0drL294RzFJT0owNStZ?= =?utf-8?B?SW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f495e X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB4835.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 12:17:20.8819 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: t8U4GrF33bdAP55xL7FN2S1vLj6PbLaIA9HZz3XaNIz0EC/iWBpYwJAzIRtssjDmpNkv7+1ixHIoU2ynMgTVAhDE0dEiuYpdun56+xwMZ5o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB2651 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10253 signatures=673431 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202100067 X-Proofpoint-ORIG-GUID: EwRclCI1NL68tWvKy43i54wBlMZjltJY X-Proofpoint-GUID: EwRclCI1NL68tWvKy43i54wBlMZjltJY X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/8/22 12:36, David Woodhouse wrote: > On Wed, 2019-02-20 at 20:15 +0000, Joao Martins wrote: >> From: Boris Ostrovsky >> >> Add support for SCHEDOP_poll hypercall. >> >> This implementation is optimized for polling for a single channel, which >> is what Linux does. Polling for multiple channels is not especially >> efficient (and has not been tested). >> >> PV spinlocks slow path uses this hypercall, and explicitly crash if it's >> not supported. >> >> Signed-off-by: Boris Ostrovsky >> --- > > ... > >> +static void kvm_xen_check_poller(struct kvm_vcpu *vcpu, int port) >> +{ >> + struct kvm_vcpu_xen *vcpu_xen = vcpu_to_xen_vcpu(vcpu); >> + >> + if ((vcpu_xen->poll_evtchn == port || >> + vcpu_xen->poll_evtchn == -1) && >> + test_and_clear_bit(vcpu->vcpu_id, vcpu->kvm->arch.xen.poll_mask)) >> + wake_up(&vcpu_xen->sched_waitq); >> +} > > ... > >> + if (sched_poll.nr_ports == 1) >> + vcpu_xen->poll_evtchn = port; >> + else >> + vcpu_xen->poll_evtchn = -1; >> + >> + if (!wait_pending_event(vcpu, sched_poll.nr_ports, ports)) >> + wait_event_interruptible_timeout( >> + vcpu_xen->sched_waitq, >> + wait_pending_event(vcpu, sched_poll.nr_ports, ports), >> + sched_poll.timeout ?: KTIME_MAX); > > Hm, this doesn't wake on other interrupts, does it? Hmm, I don't think so? This was specifically polling on event channels, not sleeping or blocking. > I think it should. > Shouldn't it basically be like HLT, with an additional wakeup when the > listed ports are triggered even when they're masked? > I am actually not sure. Quickly glancing at the xen source, this hypercall doesn't appear to really block the vcpu, but rather just looking if the evtchn ports are pending and if a timeout is is specified it sets up a timer. And ofc, wake any evtchn pollers. But it doesn't appear to actually block the VCPU. It should be IIRC, the functional equivalent of KVM_HC_VAPIC_POLL_IRQ but for event channels. > At https://git.infradead.org/users/dwmw2/linux.git/commitdiff/ddfbdf1af > I've tried to make it use kvm_vcpu_halt(), and kvm_xen_check_poller() > sets KVM_REQ_UNBLOCK when an event is delivered to a monitored port. > > I haven't quite got it to work yet, but does it seem like a sane > approach? > Joao