Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4531923rwl; Wed, 28 Dec 2022 05:34:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKEqykBcAPTdQZh44pGpKX2HPIb5qQQha9Ae3dMmpAEXVAN+92lR9cAdb+tzdzvJDgzzVk X-Received: by 2002:a17:906:9616:b0:78d:f457:108f with SMTP id s22-20020a170906961600b0078df457108fmr20734169ejx.76.1672234463534; Wed, 28 Dec 2022 05:34:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672234463; cv=none; d=google.com; s=arc-20160816; b=SToAASh/tHCKOZ080UlxwQnLaYFLeTVBDoHWp4JqIs9qW5xmfiIzP4rdc9Fj9etOWc G5dPnwKBXEE1W3xbI7rjf/6XFd/aguwESspztegbuU69KMO0EjF9DFdPQkPfYoN/CtlR vMLJHzAfgNhD4u6Sglkdxjjl2D5mEzITeljRA15I1I8uWdibBzcCKuQXPzsD+bnNG6mh 3YSlZ9fG8EOMTuo+7ow3Xdh42NGBK367Vpg4WyQ+sem5SCs2SIcLJ9k5ajZHLK8SqzaY 3ruoQhWBqEJIvr2SmKLKHWYWgRlhp6x671o3LQhRcVroUDBJvVFkfVse8lSmog91QN/t DSxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=VoX0fOYy2BDjN7WWcv2XIAfkcDcckcAo0GBCFxmkNWU=; b=GnXgEhfx1bx6Tgfz5eawMZjVzZS5cv/Wplc32ndAZRsEqMIAuOTB2mprXxFQfUGNjI gJBBqso5cFHaDPUmWBBeJHk+Zbtyg0fLn+9UizQ50/yBRSMXzobfn5YsJmrU3eBYSDHh vTKDN9cfMpm0B2UllDTPDcKKx8zy4PFxvHy+C4yBciIGFLg5u1PJLPxYPs1MuYyfMQ6w mZTVbdJJDQNCXNTuisBnoL68FrtwoHk+G8P7v4heFxL9FuNF4xOQ4VoKOrAg/9i8zof/ IiKDsqsG70SGkKg+YGzITzNcwWpaJ0p4PbuUcbGTjZBCEp/hvZ2T2Mrc6cbu+CkGoJCl BSWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fssd/2wD"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf27-20020a1709077f1b00b007bdf57f885esi14822402ejc.37.2022.12.28.05.34.08; Wed, 28 Dec 2022 05:34:23 -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=@redhat.com header.s=mimecast20190719 header.b="fssd/2wD"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbiL1NWr (ORCPT + 64 others); Wed, 28 Dec 2022 08:22:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiL1NWp (ORCPT ); Wed, 28 Dec 2022 08:22:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5C4F007 for ; Wed, 28 Dec 2022 05:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672233716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VoX0fOYy2BDjN7WWcv2XIAfkcDcckcAo0GBCFxmkNWU=; b=fssd/2wDD432zej+UDpql3mB5+yBKcGNhPiZPdKcOF+ZgLjtwel1V/bUjaf+YzOTGUBX3f XugrPRNxcvfaWkX7tC5X5gK+gRPtSoF8MBQWOcl1nYYiVMzF1ku9ae5xz5iJ/kgedhZT54 mbY/hhAS90pexNj7P89Lww6+jdtxSSI= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-22-w9eHhjQePMiFoD9FtLOhXw-1; Wed, 28 Dec 2022 08:21:54 -0500 X-MC-Unique: w9eHhjQePMiFoD9FtLOhXw-1 Received: by mail-ej1-f70.google.com with SMTP id wz4-20020a170906fe4400b0084c7e7eb6d0so1097919ejb.19 for ; Wed, 28 Dec 2022 05:21:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VoX0fOYy2BDjN7WWcv2XIAfkcDcckcAo0GBCFxmkNWU=; b=V86e9EFWSRGZTQl1yrxcbLJ9Ye6jMMJRWwwcoM8ovaQC78V6tggFSGFp24lrDGIDLW QSHvPajHY7h8SS0BIjoD+jPmpM6bQH3Yu3nHOrezoKnc2GSj7U00Jfd0EsUEg25VSpml AQ0VLzLc1TmOu52+IyICvOdXfHCNH/Qj7daCFBNKtBKeIaOaT6G+xLT46PhKn55E9pRB n9FwtJVkbmWQO7/DKPKnku0i5iY5RSSJ/4lES1w49N16X83rDKtkfTRb9392C7uAhMim KaMFD1OTo6vceEzq9i5XTVupIfJsI0G5+hJOCB2g/QNEVUpsHLBD5DgbMFnhYSamPO81 nKcg== X-Gm-Message-State: AFqh2koriczKG4oHTNb/wv4Bc7wlVdJaBVFz+iWDSUbA28uninJE8zVE XyF1KHQZGME7qVJe6P7AGEy7+wbQYWVRpEk2NxNTSfvdGBQRpTrNr8Mvat6i6LnfLtjbx+YFvyV vRCKn0XGbuMXWp3jxhBoNQDl/ X-Received: by 2002:a05:6402:1609:b0:467:7775:ba8 with SMTP id f9-20020a056402160900b0046777750ba8mr22203170edv.1.1672233713542; Wed, 28 Dec 2022 05:21:53 -0800 (PST) X-Received: by 2002:a05:6402:1609:b0:467:7775:ba8 with SMTP id f9-20020a056402160900b0046777750ba8mr22203160edv.1.1672233713355; Wed, 28 Dec 2022 05:21:53 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.googlemail.com with ESMTPSA id dn5-20020a05640222e500b004610899742asm7170937edb.13.2022.12.28.05.21.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Dec 2022 05:21:52 -0800 (PST) Message-ID: <3619dc3b-d1b9-ab76-a008-2c45799d5803@redhat.com> Date: Wed, 28 Dec 2022 14:21:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US To: "Woodhouse, David" Cc: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "seanjc@google.com" , Michal Luczaj References: <62d7c91f-1486-4aea-8764-352efb383326@email.android.com> From: Paolo Bonzini Subject: Re: [PATCH] KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET In-Reply-To: <62d7c91f-1486-4aea-8764-352efb383326@email.android.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 12/28/22 12:55, Woodhouse, David wrote: > > IIRC the send_port and type aren't used from hcall_send so we could > stick those in a union with a 'next' pointer and use it to build a list > instead of having to allocate the array (pathological worst case 32KiB). Yeah I thought about using a list. The union is doable as you say, but I wasn't sure if things were going to change in kvm_xen_evtchn_send later. And the worst case is order 3, which is within PAGE_ALLOC_COSTLY_ORDER, so I decided to go with the array which only consumes memory on reset rather than always; it's much more likely that the array will be smaller than a page. Paolo > Or if the union is a bit icky, we could just add the 'next' pointer > unconditionally. >