Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp430478lqo; Fri, 10 May 2024 04:33:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVI/tDCnSyhnQQF102WMtZDjAENeK4C+MauOnipaMF3ZaP9Pb9ldx/qGPabGyP+O2LUXznj5bflOUbmX2SwSou+/vHD5qdVNe9OJnH4bA== X-Google-Smtp-Source: AGHT+IHmJo0fty0WSKJBCb1KxTz6pDrxgEy40UclH9yM7omil/alcGchQDtgpcdsgLNiDG2BdBEP X-Received: by 2002:a05:6358:71c3:b0:18e:7a94:2bd4 with SMTP id e5c5f4694b2df-193bb612bc5mr233534255d.10.1715340826922; Fri, 10 May 2024 04:33:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715340826; cv=pass; d=google.com; s=arc-20160816; b=UTbKlDXPcShjr3nZtFj/41UuBPsGNRYz971adtX7X/X7K+kZ1UfOeU2TbJco8ZalVu qBfFsgLK/58jOH65m4eXuTt5bnZVfW/L1RNrtEkddnh1RXcOiUXRA0JQuMzldtEp6MSP sXlrVDWzzsrra3NNSTSiLAuI8lV+ItkBjS5x45S6dl9+bxrm4iOkC3iiHz5Qxw54WgDn d8gj4fcMruaNyxWoDYz7w0e23Yt1qdGsXxex1DZL6aMy9kxX1JLz+ZVH/zPACzCVNtTX hrJ5kNr+q3qCcXw3eVOsCoDVCJpWWLz7rHIGZHMD2qrAgFMKN9pnbvIMz/511yzrxYMi TnaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=zNXwSOWeBMueOtABnUo69wqjco2rwqNtJ/nGjlKDC3g=; fh=A04ElM46wIj5GRzlVNanAYfiRPkUpSXqkrpKGqyHYp8=; b=tZRvGhCrTROXJ8mQdQ4GeyO44ooMADI3zQSXQQs4tzzrVQKXuw3Fa+UTZus0TyxpB0 h3KylmP2TYo4o0T6nwVR4RN2GRj98+D1XrG0POt/cjIK3WOsTfeL6F0+IJ+5rwDia+O/ 0F/KQHKzc5zvTbdUIqgQrywnMNmo1kkbVeBTZpwHd+qZk6im1c/K35c4Sr5jqqCB0S98 V0PkT1FieBXg9FclW9JM7v6QObNrtSAIo5qTUzveBEOWkT1xuwttbqyu+4IP8ki2YCjQ 1khWoHEW2tTH9zqXb2LucKLyJa7vZaHddRrhEybN9CH8FqEtLMkpNh+Nn9vD+y+9BqzO zJnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=esPKBCkP; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-175669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340b2a0772si3519072a12.208.2024.05.10.04.33.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 04:33:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=esPKBCkP; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-175669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 249872867AF for ; Fri, 10 May 2024 11:31:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0117F178CF6; Fri, 10 May 2024 11:27:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="esPKBCkP" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE2F1171E7D for ; Fri, 10 May 2024 11:27:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715340462; cv=none; b=dHjS8CoY1kR3jOCdfmZEZyz2l0ux5RbOktDqEiGaGqAG6T3M2yEGjQC0IrB2VVIMyj4kSflLJTx6ELrSI+bjvYI6G/dFMF+4swYl0HIp94kmv4NcDBe4WMIxHYdL1A2p5LBvW5DBcOFR3t8OABMwmdJ6nQQ9O6/0ap96dvJpvqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715340462; c=relaxed/simple; bh=zNXwSOWeBMueOtABnUo69wqjco2rwqNtJ/nGjlKDC3g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nwHQ/C+1a3cDvSlBpB+hXInUMCM+6wWLfK16ctabwBUsLmAw+lMZO+i1kCrqLb5qM3iHSDLM88voQBQrm35Wo76coLl9u+zeS1G7sJ7a0F9L/x8F/B3ZEPo1EEbUDEUgq9R/UMxC73HF9bDx7LozAcGvi4sgMwni1tkW9glMB2k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=esPKBCkP; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a59b81d087aso474980966b.3 for ; Fri, 10 May 2024 04:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1715340458; x=1715945258; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zNXwSOWeBMueOtABnUo69wqjco2rwqNtJ/nGjlKDC3g=; b=esPKBCkP7bBK7iPHa/ipNqAmhGzxdtQaZC9mLpj2zYIyTClXdxfgcBX8gRK5mRc1qt xmTcu9T7Ip+xWL8I5FPoNVvnxv4bXzLfFKqqZgPG0N9L36a85vuTLAtmC5R40i3DOTk7 jEki5Les6qHJZlFdONe/8r7esYGgqHWrIGYIX2RSmQ22WbdEaSGIUDr2oB3kiahHowfd /XsdHSb4z9s1iYf13qZK8AIPsys5NzMb/ZEPuq00sJdaeaZPbOZenJeQoK2cPw/ki+rR 79zGzHLpz0R0cSdOd3Eh3TOf6+YQ9droAkmB4BBubg1agX9gM7sIn/2drvoNSJQNcVw/ 7P4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715340458; x=1715945258; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zNXwSOWeBMueOtABnUo69wqjco2rwqNtJ/nGjlKDC3g=; b=H4dmbWsJu92DJ2I8VVdY2lsh9rv44xlsv55VR33YSmXsglUD/yZPuVYpwPAObT9H9I ytIrTh8OZoqTuoc1A09c3kwtTtx09yLdvT6QbH/VvwWxnjWehXRipPA/tYN8o6waOXd/ 1sfbHZOK/j7Y5GFURruU5Xxadglakxqn0P5iGj/kBXXFJKW8b2RxRvPyBLiVX2KxM6KZ HbBrKR633xuWtOjYFoH2vncp9jwFfFHqNu0XzBlBt4uK8g9SLIXRL6H4KmH473ngCBMk IMSZ/rFN5zh+oN+HGmQflobwNdlXzQiXoXPc0Cz6pRfaksLiogeOsJ7Vls7AZmDMBlm1 +qQg== X-Forwarded-Encrypted: i=1; AJvYcCXkJKXWv9rbYhmOMbvLhq9Yefw7Mzw27m2VQfATwTSORS8QNFyDctrE8IrkMKhJ+ns6/2qJJPdJuqlZuBiG54kwKSU19Dn9U3FuS4/C X-Gm-Message-State: AOJu0YxiRmCH9gowwtZNdDD8iP+YnZnX4tGygpBKIdMRwAxewQltDfw1 XFH/Xxju4B4hs2bo1PYla5asfLv9ZFdzGbNwPIiDF2l5Uef6YAXYyOoeetsVmjU= X-Received: by 2002:a50:d583:0:b0:572:637b:c7e1 with SMTP id 4fb4d7f45d1cf-5734d5f48b1mr2421443a12.21.1715340458312; Fri, 10 May 2024 04:27:38 -0700 (PDT) Received: from ?IPV6:2003:e5:873c:a500:6aaf:b7a7:7c29:ae5c? (p200300e5873ca5006aafb7a77c29ae5c.dip0.t-ipconnect.de. [2003:e5:873c:a500:6aaf:b7a7:7c29:ae5c]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733bea651asm1706341a12.11.2024.05.10.04.27.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 May 2024 04:27:38 -0700 (PDT) Message-ID: <0aac68ac-cf40-4c3d-ac02-95b9a37aaa11@suse.com> Date: Fri, 10 May 2024 13:27:37 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC KERNEL PATCH v6 3/3] xen/privcmd: Add new syscall to get gsi from irq To: "Chen, Jiqian" Cc: Stefano Stabellini , Bjorn Helgaas , "Rafael J . Wysocki" , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "xen-devel@lists.xenproject.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "Huang, Ray" References: <20240419033616.607889-1-Jiqian.Chen@amd.com> <20240419033616.607889-4-Jiqian.Chen@amd.com> <79666084-fc2f-4637-8f0b-3846285601b8@suse.com> Content-Language: en-US From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10.05.24 12:32, Chen, Jiqian wrote: > On 2024/5/10 18:21, Jürgen Groß wrote: >> On 10.05.24 12:13, Chen, Jiqian wrote: >>> On 2024/5/10 17:53, Jürgen Groß wrote: >>>> On 10.05.24 11:06, Chen, Jiqian wrote: >>>>> Hi, >>>>> >>>>> On 2024/5/10 14:46, Jürgen Groß wrote: >>>>>> On 19.04.24 05:36, Jiqian Chen wrote: >>>>>>> + >>>>>>> +    info->type = IRQT_PIRQ; >>>>> I am considering whether I need to use a new type(like IRQT_GSI) here to distinguish with IRQT_PIRQ, because function restore_pirqs will process all IRQT_PIRQ. >>>> >>>> restore_pirqs() already considers gsi == 0 to be not GSI related. Isn't this >>>> enough? >>> No, it is not enough. >>> xen_pvh_add_gsi_irq_map adds the mapping of gsi and irq, but the value of gsi is not 0, >>> once restore_pirqs is called, it will do PHYSDEVOP_map_pirq for that gsi, but in pvh dom0, we shouldn't do PHYSDEVOP_map_pirq. >> >> Okay, then add a new flag to info->u.pirq.flags for that purpose? > I feel like adding "new flag to info->u.pirq.flags" is not as good as adding " new type to info->type". > Because in restore_pirqs, it considers " info->type != IRQT_PIRQ", if adding " new flag to info->u.pirq.flags", we need to add a new condition in restore_pirqs. > And actually this mapping(gsi and irq of pvh) doesn't have pirq, so it is not suitable to add to u.pirq.flags. Does this mean there is no other IRQT_PIRQ related activity relevant for those GSIs/IRQs? In that case I agree to add IRQT_GSI. Juergen