From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948752; cv=none; d=zohomail.com; s=zohoarc; b=MTz+gsRCWM7pU9j6WEto2tTX/0H1FlBYhvMCsO+A6zfzDcjpzm2NigNHrmo596f6xWIsvjNVVQ2WxySEzbU/LqDiTKN1EwUtht8o2g8QginkuBXwiKiJHrgw8JzeA3Ne03uNJxAZ9zhD60Ws7WCQ6jrWJMxjhp/VdBhWZn9D3/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948752; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7r9MKTSBwgwttJvbysh5jbQ4GwhF2zf+7qcgRbCi1Lk=; b=F3vI6ldLd0J+RLnu3L0HLByV9yyW1qtpQ28KdDCwAdSh79FalkgYX/G6GbLzpS+3rpkHB9oMkSAyDvrQBHVApfxdPqQ6s2jJSOZIdGMVkiGXAftkPmiEATInmoF1MN/wMnmGfU70PhiP+oeh2sB7dNyycTl0iEViiMOD0LOoNt0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948752366161.60902664575804; Tue, 6 Aug 2024 05:52:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJfg-00056x-J9; Tue, 06 Aug 2024 08:52:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJfe-0004yH-Hv for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:10 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJfc-0008FO-Ga for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:10 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a7a9e25008aso70062566b.0 for ; Tue, 06 Aug 2024 05:52:07 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9ecb129sm544015566b.222.2024.08.06.05.52.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948726; x=1723553526; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7r9MKTSBwgwttJvbysh5jbQ4GwhF2zf+7qcgRbCi1Lk=; b=ZpxCe7GQZdveWiEjicBG/2MYWDl6a/dtfnN4mtDLAuaJNCH3NiIuJjG6PO7dWmQMGb haGe7TNNGligbpo5YOk10a/UzjMX9Z1PlgBBX6T39UKYOFEEYgeTjrMsUL2yTQkp3WnH RcRx4XWN431UrWdCP1eEwhtNVIzXO33An1lNUthCBLmTNbIg04poaXO5G/r1hvLvdIx3 dL/XgPHgbXn/RwUFkLkPEMVJorP3JjKbHMxAHlsgPnHBlkgVq92d/HViXJ0J0C+VvMAV Jay7lPATB7hIFLgejVfHN1OZAWX/uQWyIRFf+IrWfKr3JfZx27G1FOUCXGPR8qBQQXxr PpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948726; x=1723553526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7r9MKTSBwgwttJvbysh5jbQ4GwhF2zf+7qcgRbCi1Lk=; b=N6hJdkU5FNowqQQ86EF65Ns423VMUnhzfyvjJ3mH21JNK6816tSnfG/KUL3Wjb4r+F WRNe4e7bsXi9piJmS2VavBvT4/hA5SM7BCsJQvjexQSAhvilK3Dz96hbTJkpCGwgynlm n7bqFGrKGWpFtygCGZuiThSEL+Ed1iqvxmoRPJaRz5OCCouv6bXpS/gpj0ES0AMzGJRr ORpQkh3vgKaOpe0BnwDc8nLxsmGIgUvXzZCziKhPsS7paCr7OQglQQLXaZOYSopbjRjd uSmH+Bb0tX/POyrPvR3DJs1/VoFzMCEo8S+FOrZEFSOxS+hivuc3SsbTp9P7+xd9bMlK tB6A== X-Gm-Message-State: AOJu0YySuBmpjxQTx5FLv8YGv2t3sjxhM+iwGSZZ3z6MT2AqksAvXI3j YAQbNuPdtZVsYFhOdPtNq0JVR5y8BUBiQ5t9Gn96iVWdazVt+PfrVlqCtg43aYj1c8gRbB4sWjk e X-Google-Smtp-Source: AGHT+IFO3crPfC584RU5U8wdeX1CGSIRxzKXGCnI7vNlfd6YKgtrV6M3MpMwSOV+ViaqMTORlBC+kg== X-Received: by 2002:a17:907:7f21:b0:a7a:9144:e254 with SMTP id a640c23a62f3a-a7dc4d94affmr1109244466b.10.1722948725813; Tue, 06 Aug 2024 05:52:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 01/28] hw/intc/loongson_ipi: Rename LoongsonIPI -> LoongsonIPIState Date: Tue, 6 Aug 2024 14:51:29 +0200 Message-ID: <20240806125157.91185-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948754351116600 From: Bibo Mao We'll have to add LoongsonIPIClass in few commits, so rename LoongsonIPI as LoongsonIPIState for clarity. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-2-philmd@linaro.org> --- include/hw/intc/loongson_ipi.h | 6 +++--- hw/intc/loongson_ipi.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hw/intc/loongson_ipi.h b/include/hw/intc/loongson_ipi.h index 3f795edbf3..efb772f384 100644 --- a/include/hw/intc/loongson_ipi.h +++ b/include/hw/intc/loongson_ipi.h @@ -31,10 +31,10 @@ #define IPI_MBX_NUM 4 =20 #define TYPE_LOONGSON_IPI "loongson_ipi" -OBJECT_DECLARE_SIMPLE_TYPE(LoongsonIPI, LOONGSON_IPI) +OBJECT_DECLARE_SIMPLE_TYPE(LoongsonIPIState, LOONGSON_IPI) =20 typedef struct IPICore { - LoongsonIPI *ipi; + LoongsonIPIState *ipi; MemoryRegion *ipi_mmio_mem; uint32_t status; uint32_t en; @@ -45,7 +45,7 @@ typedef struct IPICore { qemu_irq irq; } IPICore; =20 -struct LoongsonIPI { +struct LoongsonIPIState { SysBusDevice parent_obj; MemoryRegion ipi_iocsr_mem; MemoryRegion ipi64_iocsr_mem; diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 682cec96f3..903483ae80 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -64,7 +64,7 @@ static MemTxResult loongson_ipi_iocsr_readl(void *opaque,= hwaddr addr, uint64_t *data, unsigned size, MemTxAttrs attr= s) { - LoongsonIPI *ipi =3D opaque; + LoongsonIPIState *ipi =3D opaque; IPICore *s; =20 if (attrs.requester_id >=3D ipi->num_cpu) { @@ -160,7 +160,7 @@ static MemTxResult loongson_ipi_core_writel(void *opaqu= e, hwaddr addr, MemTxAttrs attrs) { IPICore *s =3D opaque; - LoongsonIPI *ipi =3D s->ipi; + LoongsonIPIState *ipi =3D s->ipi; int index =3D 0; uint32_t cpuid; uint8_t vector; @@ -214,7 +214,7 @@ static MemTxResult loongson_ipi_iocsr_writel(void *opaq= ue, hwaddr addr, uint64_t val, unsigned size, MemTxAttrs attrs) { - LoongsonIPI *ipi =3D opaque; + LoongsonIPIState *ipi =3D opaque; IPICore *s; =20 if (attrs.requester_id >=3D ipi->num_cpu) { @@ -277,7 +277,7 @@ static const MemoryRegionOps loongson_ipi64_ops =3D { =20 static void loongson_ipi_realize(DeviceState *dev, Error **errp) { - LoongsonIPI *s =3D LOONGSON_IPI(dev); + LoongsonIPIState *s =3D LOONGSON_IPI(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); int i; =20 @@ -320,7 +320,7 @@ static void loongson_ipi_realize(DeviceState *dev, Erro= r **errp) =20 static void loongson_ipi_unrealize(DeviceState *dev) { - LoongsonIPI *s =3D LOONGSON_IPI(dev); + LoongsonIPIState *s =3D LOONGSON_IPI(dev); =20 g_free(s->cpu); } @@ -344,14 +344,14 @@ static const VMStateDescription vmstate_loongson_ipi = =3D { .version_id =3D 2, .minimum_version_id =3D 2, .fields =3D (const VMStateField[]) { - VMSTATE_STRUCT_VARRAY_POINTER_UINT32(cpu, LoongsonIPI, num_cpu, + VMSTATE_STRUCT_VARRAY_POINTER_UINT32(cpu, LoongsonIPIState, num_cp= u, vmstate_ipi_core, IPICore), VMSTATE_END_OF_LIST() } }; =20 static Property ipi_properties[] =3D { - DEFINE_PROP_UINT32("num-cpu", LoongsonIPI, num_cpu, 1), + DEFINE_PROP_UINT32("num-cpu", LoongsonIPIState, num_cpu, 1), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -369,7 +369,7 @@ static const TypeInfo loongson_ipi_types[] =3D { { .name =3D TYPE_LOONGSON_IPI, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(LoongsonIPI), + .instance_size =3D sizeof(LoongsonIPIState), .class_init =3D loongson_ipi_class_init, } }; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948752; cv=none; d=zohomail.com; s=zohoarc; b=m1fzV059CrTz4aB7Opgq0vikukxk58gWoWkGQ9fFgv7MP1P2hZxyaXIaeK6P/M6W/Kw9vUAyWa2CenspXcS/M5jcgvinUcoI/kh2ux0ALtJg0q94DDVVh6Jh5HmezFfjqQYARX0vK9vQcqD5R/xsZHS3aoY/ZWOY+0krCP9kmjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948752; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c3ILWy+ncwfc6QydM5V2TsF6gCu3vRJehqiG1EZoOS0=; b=SKXynC1FDc9jHBw90JL5h8p5f7QWoKG0fmIgbS5SFS3Muo8kUGwvMgWdZ9JmNBiHbDxDMlX/8ZsspnbkywIMsfuIywamFcLvwm4k1EPGcLRI7MUiPdsZj1fYvWFBtYfi+Jkg4HEHCwPXpJCJsPzVwuRttt6BmsJgjmI4BECBmqQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948752842581.0372231815077; Tue, 6 Aug 2024 05:52:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJfj-0005KG-Uw; Tue, 06 Aug 2024 08:52:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJfj-0005Hj-AZ for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:15 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJfh-0008Hi-DR for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:14 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5b5b67d0024so931808a12.0 for ; Tue, 06 Aug 2024 05:52:12 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9bc3cf3sm556585666b.13.2024.08.06.05.52.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948731; x=1723553531; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c3ILWy+ncwfc6QydM5V2TsF6gCu3vRJehqiG1EZoOS0=; b=XfUsLN/1hEwxDPU+Iwe6d6z4GT29++AU6jbVXWtxvl/52+U+1IblRNIS324J2l+yTq dSHX19ySUflsm4YH4/a0tmTXMf+EoXZmEDg+u3/v3Wp4Jpq8f+nsREWh7OIK157tNlEW quEcrIGnIvn6Jl+mfs6wdI4wWwRAaLUXFgE0vPqnbt/szXRBIHRDcAQQ/1daCWHEdqp4 Z+IAyswko3TuUQ3qufXk870/md7pP4hiSprABTgLLioIfy51VBii6IlwiEHXs6oVY4ZW 4dXQ7towbBz6qFOPMH0dLUvIyLeKkvUkfr2yWyyx8mP+EWcZhptBHxgrxh6cVcL4XQGi x+Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948731; x=1723553531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c3ILWy+ncwfc6QydM5V2TsF6gCu3vRJehqiG1EZoOS0=; b=VN9svrnX9S0Zbk7eigtG88q9IjSK/L/t3+rQ76D0gXDVXlBA5OQ5I19TJZf4qwPRAA puQgYaVSBTRXBeXrslwhFsC67+hjcNu4cJux0IJ8S5XqpIZMdvh9KW7oYbtt8Y+ITAC+ aKzPXCESfSoLf37QAv7Aq/NyoUJboPWtm3nUljAgEl1pFtE5PXL6Pfz+BMNfPPEVjsAV YPGbeV2jh0ThJrSafNu3dQu8lRgyG18qqyiTDA08g0+HpA7W1OVtU/Z/p7ufUB6hz2kw osDqmBkia9Q0GEFpZ43VcD3d3Gws5cGNERRFo59nVoJIe6PN7gx+OPEsNt2FZ6enuXUr EuyQ== X-Gm-Message-State: AOJu0YzjXbjkJvXtOGl27PMU12wBdsqrWNo1s1wikroLQ2h+EuM2bqPm tUgd5saLqhMreD6Rvm6gxFf96ubaaxTxBOO5xPRaDb7PqoKUsfWd8FTKLNwbxUbxGFwcb70eiG8 b X-Google-Smtp-Source: AGHT+IF/8iVuUEILhbMKAhGlXHPgFPqIxxY8NDVzXN0S+2jr7J63kyUrpsOJA1ktb622tYALz8sUoQ== X-Received: by 2002:a17:907:2cc2:b0:a7a:a46e:dc3c with SMTP id a640c23a62f3a-a7dc4e50c0cmr962164766b.15.1722948731604; Tue, 06 Aug 2024 05:52:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 02/28] hw/intc/loongson_ipi: Extract loongson_ipi_common_realize() Date: Tue, 6 Aug 2024 14:51:30 +0200 Message-ID: <20240806125157.91185-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948753471116600 From: Bibo Mao In preparation to extract common IPI code in few commits, extract loongson_ipi_common_realize(). Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-3-philmd@linaro.org> --- hw/intc/loongson_ipi.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 903483ae80..8aab7e48e8 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -275,7 +275,7 @@ static const MemoryRegionOps loongson_ipi64_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -static void loongson_ipi_realize(DeviceState *dev, Error **errp) +static void loongson_ipi_common_realize(DeviceState *dev, Error **errp) { LoongsonIPIState *s =3D LOONGSON_IPI(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); @@ -301,30 +301,46 @@ static void loongson_ipi_realize(DeviceState *dev, Er= ror **errp) sysbus_init_mmio(sbd, &s->ipi64_iocsr_mem); =20 s->cpu =3D g_new0(IPICore, s->num_cpu); - if (s->cpu =3D=3D NULL) { - error_setg(errp, "Memory allocation for IPICore faile"); - return; - } - for (i =3D 0; i < s->num_cpu; i++) { s->cpu[i].ipi =3D s; - s->cpu[i].ipi_mmio_mem =3D g_new0(MemoryRegion, 1); - g_autofree char *name =3D g_strdup_printf("loongson_ipi_cpu%d_mmio= ", i); - memory_region_init_io(s->cpu[i].ipi_mmio_mem, OBJECT(dev), - &loongson_ipi_core_ops, &s->cpu[i], name, 0x= 48); - sysbus_init_mmio(sbd, s->cpu[i].ipi_mmio_mem); =20 qdev_init_gpio_out(dev, &s->cpu[i].irq, 1); } } =20 -static void loongson_ipi_unrealize(DeviceState *dev) +static void loongson_ipi_realize(DeviceState *dev, Error **errp) +{ + LoongsonIPIState *s =3D LOONGSON_IPI(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); + Error *local_err =3D NULL; + + loongson_ipi_common_realize(dev, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + + for (unsigned i =3D 0; i < s->num_cpu; i++) { + s->cpu[i].ipi_mmio_mem =3D g_new0(MemoryRegion, 1); + g_autofree char *name =3D g_strdup_printf("loongson_ipi_cpu%d_mmio= ", i); + memory_region_init_io(s->cpu[i].ipi_mmio_mem, OBJECT(dev), + &loongson_ipi_core_ops, &s->cpu[i], name, 0x= 48); + sysbus_init_mmio(sbd, s->cpu[i].ipi_mmio_mem); + } +} + +static void loongson_ipi_common_unrealize(DeviceState *dev) { LoongsonIPIState *s =3D LOONGSON_IPI(dev); =20 g_free(s->cpu); } =20 +static void loongson_ipi_unrealize(DeviceState *dev) +{ + loongson_ipi_common_unrealize(dev); +} + static const VMStateDescription vmstate_ipi_core =3D { .name =3D "ipi-single", .version_id =3D 2, --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948804; cv=none; d=zohomail.com; s=zohoarc; b=f+1kTS3j3t+wCuCAFwqQxQvJjNxsg2k8dcJKGbArJgigAXTs1QHjAZDVyLWPDn3nSPAtZoE+WkwHKw/1IDYw19LruKCviagebcCehFPiF5UV0kpkSj0bNFU3TQF4emdwiCKMwrN4uHdaTQtvuP6UEavnHRH3ZEVJPZ3LxfG5Rqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948804; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0F17jC4A+/jJL8HbEP/nNRp5o1JNsQhvOwNuSlGqlM4=; b=eK3/4JYyOzugUywg12T3geTZCX9olHu3ZQOUNTjsfSg9Lb4j84BOaXz3IMdp848P97qEcDF+Dyh8cIR+iBXMRf9AkB8EioyN2ltCGgF8Vi3bhspCspoR9JtYjQdG+LIyCYGr7WhZNqmnReNMpBegyj+iRE80Wczoem6tSRPj4Q0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172294880423164.07685684843364; Tue, 6 Aug 2024 05:53:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJfs-0005cS-5q; Tue, 06 Aug 2024 08:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJfq-0005b3-Ey for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:22 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJfo-0008Jp-A5 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:22 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-52f00ad303aso1085555e87.2 for ; Tue, 06 Aug 2024 05:52:19 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9ec7266sm547817866b.196.2024.08.06.05.52.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948738; x=1723553538; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0F17jC4A+/jJL8HbEP/nNRp5o1JNsQhvOwNuSlGqlM4=; b=gmpOqZtdO5xy4yfwjKMEzxjMqXEfh8NkT+HtQKoET+m2dK4cmAs2DYbbgfnml63FG3 qRzABhKHY6RlLTJMqXIyYx8gyPlVnj4PY4x1qbvLf682N2NcQA469fEiBZ406on+//RT OiqxDDYfb+YKa/cpoG5lfrozBnYSCoxFxpHCY5/kMAs577ITatfb6+gXbJv+T8YFibI7 0WU7sLD/VzGEBaNuhalHbPxSymJOtGb1MRU3UtUI+wbBVVcySeNJkRmpySjWeSCymBzk Ebt5Xsvp8Mhh+n3ComUFVGC0ohw512GAUV6ownB1jAtNVaFqLIrYDUlu9Jb2bQqOCuSj 3bXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948738; x=1723553538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0F17jC4A+/jJL8HbEP/nNRp5o1JNsQhvOwNuSlGqlM4=; b=v59Ml7QLJbhGKEGYseicylg1MyhSBpzVOtczBsF4B0A5jyz/JdCFTsk5xHD3bjn6Ur N1uBinTqj2NpxzNzCdjdmnFsbC3rFz6lE7JcoL5i5ujtj9bVwQIOzd1gese+7GrONqr8 A//1vyiPqqNGcgpwIdC8nwNICLNIuODAPIfi45AlLcvcugvDieY4xf6OUp8Ga7KGnu6z Y6aczscA+gBvfogH0pwX6voUplffV87QRwkIM9FBvlWM9OMTOX30z3DD+CpC+WU97RTO AiSq6tI3fhS6v0LRNx2dnwrp752XQQlfWEKTTF9ak4nqzfhtdWNHpr2AGG5I+sKqkMIF ysjQ== X-Gm-Message-State: AOJu0Yweral8JXVEbVQCGcBn7wQoFoIGozg5LhV/vMrXM/KWX0GH0LdZ LlA01M/wFTiHDZIoAwYLlgCWCC+BkL2VYXrEJKh20/pmw+HKoiXKPMqYRjq6ykN6EqYPo6IZHdl X X-Google-Smtp-Source: AGHT+IFGYXH9V0V6Q3vQXXLd60L9PLJEUX3bMwKl9wj01AD5JO50TYAEKNeBTAcJnJTzOcJMoySq6Q== X-Received: by 2002:a05:6512:b20:b0:52c:9413:d02f with SMTP id 2adb3069b0e04-530bb397882mr10706304e87.17.1722948737706; Tue, 06 Aug 2024 05:52:17 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 03/28] hw/intc/loongson_ipi: Add TYPE_LOONGSON_IPI_COMMON stub Date: Tue, 6 Aug 2024 14:51:31 +0200 Message-ID: <20240806125157.91185-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948805419116600 From: Bibo Mao Introduce LOONGSON_IPI_COMMON stubs, QDev parent of LOONGSON_IPI. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-4-philmd@linaro.org> --- MAINTAINERS | 4 ++++ include/hw/intc/loongson_ipi.h | 14 ++++++++++++-- include/hw/intc/loongson_ipi_common.h | 26 ++++++++++++++++++++++++++ hw/intc/loongson_ipi.c | 10 +++++++--- hw/intc/loongson_ipi_common.c | 22 ++++++++++++++++++++++ hw/intc/Kconfig | 4 ++++ hw/intc/meson.build | 1 + 7 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 include/hw/intc/loongson_ipi_common.h create mode 100644 hw/intc/loongson_ipi_common.c diff --git a/MAINTAINERS b/MAINTAINERS index e34c2bd4cd..5ca701cf0c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1250,8 +1250,10 @@ F: configs/devices/loongarch64-softmmu/default.mak F: hw/loongarch/ F: include/hw/loongarch/virt.h F: include/hw/intc/loongarch_*.h +F: include/hw/intc/loongson_ipi_common.h F: include/hw/intc/loongson_ipi.h F: hw/intc/loongarch_*.c +F: hw/intc/loongson_ipi_common.c F: hw/intc/loongson_ipi.c F: include/hw/pci-host/ls7a.h F: hw/rtc/ls7a_rtc.c @@ -1386,11 +1388,13 @@ Loongson-3 virtual platforms M: Huacai Chen R: Jiaxun Yang S: Maintained +F: hw/intc/loongson_ipi_common.c F: hw/intc/loongson_ipi.c F: hw/intc/loongson_liointc.c F: hw/mips/loongson3_bootp.c F: hw/mips/loongson3_bootp.h F: hw/mips/loongson3_virt.c +F: include/hw/intc/loongson_ipi_common.h F: include/hw/intc/loongson_ipi.h F: include/hw/intc/loongson_liointc.h F: tests/avocado/machine_mips_loongson3v.py diff --git a/include/hw/intc/loongson_ipi.h b/include/hw/intc/loongson_ipi.h index efb772f384..9c9030761e 100644 --- a/include/hw/intc/loongson_ipi.h +++ b/include/hw/intc/loongson_ipi.h @@ -8,6 +8,8 @@ #ifndef HW_LOONGSON_IPI_H #define HW_LOONGSON_IPI_H =20 +#include "qom/object.h" +#include "hw/intc/loongson_ipi_common.h" #include "hw/sysbus.h" =20 /* Mainy used by iocsr read and write */ @@ -31,7 +33,7 @@ #define IPI_MBX_NUM 4 =20 #define TYPE_LOONGSON_IPI "loongson_ipi" -OBJECT_DECLARE_SIMPLE_TYPE(LoongsonIPIState, LOONGSON_IPI) +OBJECT_DECLARE_TYPE(LoongsonIPIState, LoongsonIPIClass, LOONGSON_IPI) =20 typedef struct IPICore { LoongsonIPIState *ipi; @@ -45,8 +47,16 @@ typedef struct IPICore { qemu_irq irq; } IPICore; =20 +struct LoongsonIPIClass { + LoongsonIPICommonClass parent_class; + + DeviceRealize parent_realize; + DeviceUnrealize parent_unrealize; +}; + struct LoongsonIPIState { - SysBusDevice parent_obj; + LoongsonIPICommonState parent_obj; + MemoryRegion ipi_iocsr_mem; MemoryRegion ipi64_iocsr_mem; uint32_t num_cpu; diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongs= on_ipi_common.h new file mode 100644 index 0000000000..70ac69d0ba --- /dev/null +++ b/include/hw/intc/loongson_ipi_common.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Loongson ipi interrupt header files + * + * Copyright (C) 2021 Loongson Technology Corporation Limited + */ + +#ifndef HW_LOONGSON_IPI_COMMON_H +#define HW_LOONGSON_IPI_COMMON_H + +#include "qom/object.h" +#include "hw/sysbus.h" + +#define TYPE_LOONGSON_IPI_COMMON "loongson_ipi_common" +OBJECT_DECLARE_TYPE(LoongsonIPICommonState, + LoongsonIPICommonClass, LOONGSON_IPI_COMMON) + +struct LoongsonIPICommonState { + SysBusDevice parent_obj; +}; + +struct LoongsonIPICommonClass { + SysBusDeviceClass parent_class; +}; + +#endif diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 8aab7e48e8..7d15c28e94 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -374,9 +374,12 @@ static Property ipi_properties[] =3D { static void loongson_ipi_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + LoongsonIPIClass *lic =3D LOONGSON_IPI_CLASS(klass); =20 - dc->realize =3D loongson_ipi_realize; - dc->unrealize =3D loongson_ipi_unrealize; + device_class_set_parent_realize(dc, loongson_ipi_realize, + &lic->parent_realize); + device_class_set_parent_unrealize(dc, loongson_ipi_unrealize, + &lic->parent_unrealize); device_class_set_props(dc, ipi_properties); dc->vmsd =3D &vmstate_loongson_ipi; } @@ -384,8 +387,9 @@ static void loongson_ipi_class_init(ObjectClass *klass,= void *data) static const TypeInfo loongson_ipi_types[] =3D { { .name =3D TYPE_LOONGSON_IPI, - .parent =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_LOONGSON_IPI_COMMON, .instance_size =3D sizeof(LoongsonIPIState), + .class_size =3D sizeof(LoongsonIPIClass), .class_init =3D loongson_ipi_class_init, } }; diff --git a/hw/intc/loongson_ipi_common.c b/hw/intc/loongson_ipi_common.c new file mode 100644 index 0000000000..43002fe556 --- /dev/null +++ b/hw/intc/loongson_ipi_common.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Loongson IPI interrupt common support + * + * Copyright (C) 2021 Loongson Technology Corporation Limited + */ + +#include "qemu/osdep.h" +#include "hw/sysbus.h" +#include "hw/intc/loongson_ipi_common.h" + +static const TypeInfo loongarch_ipi_common_types[] =3D { + { + .name =3D TYPE_LOONGSON_IPI_COMMON, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(LoongsonIPICommonState), + .class_size =3D sizeof(LoongsonIPICommonClass), + .abstract =3D true, + } +}; + +DEFINE_TYPES(loongarch_ipi_common_types) diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig index 58b6d3a710..a2a0fdca85 100644 --- a/hw/intc/Kconfig +++ b/hw/intc/Kconfig @@ -87,8 +87,12 @@ config GOLDFISH_PIC config M68K_IRQC bool =20 +config LOONGSON_IPI_COMMON + bool + config LOONGSON_IPI bool + select LOONGSON_IPI_COMMON =20 config LOONGARCH_PCH_PIC bool diff --git a/hw/intc/meson.build b/hw/intc/meson.build index afd1aa51ee..a09a527207 100644 --- a/hw/intc/meson.build +++ b/hw/intc/meson.build @@ -69,6 +69,7 @@ specific_ss.add(when: 'CONFIG_XIVE', if_true: files('xive= .c')) specific_ss.add(when: ['CONFIG_KVM', 'CONFIG_XIVE'], if_true: files('spapr_xive_kvm.c')) specific_ss.add(when: 'CONFIG_M68K_IRQC', if_true: files('m68k_irqc.c')) +specific_ss.add(when: 'CONFIG_LOONGSON_IPI_COMMON', if_true: files('loongs= on_ipi_common.c')) specific_ss.add(when: 'CONFIG_LOONGSON_IPI', if_true: files('loongson_ipi.= c')) specific_ss.add(when: 'CONFIG_LOONGARCH_PCH_PIC', if_true: files('loongarc= h_pch_pic.c')) specific_ss.add(when: 'CONFIG_LOONGARCH_PCH_MSI', if_true: files('loongarc= h_pch_msi.c')) --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949271; cv=none; d=zohomail.com; s=zohoarc; b=bufgnNyHS/pGYmaJxT2vtfqUMQM0m6MvVB2XlqCdbkjDRT7FwyIIrKf/gpktTdr3ipkXKhvhtjTN4rJQj3t/THDgoq+wbwqpEU0FQAxZugwV0T0KJEiZpEdz6QFEZuPIzO4fI9UOr0IE/gVE38BC9HN2KZLvdV/sh7Mzpoh+0wM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949271; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=O8RRMhLXR56plds6R4QKKiZtLeNwl7BDBlyuBOky7w8=; b=CXBYfRulvBonFEeKdYQuDO2zp5CjPjDrVqWQL2p2nnt8T/hsGJorOnrGYnIrh/QyoTYHtqUtCyT0aj3W4MqN5G2umnEjM5R9uoxi4/Egqk36tk+tAsSDoHqSU8gEoJUH4L8rU9Umdzx1IxeRIWrlMvr0duETFIgAdQjCo4kmhrU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949271758863.2622010304826; Tue, 6 Aug 2024 06:01:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJfx-0005lj-Ig; Tue, 06 Aug 2024 08:52:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJfv-0005lF-Qg for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:27 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJfu-0008OD-1W for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:27 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-530ae4ef29dso1150916e87.3 for ; Tue, 06 Aug 2024 05:52:25 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e8383dsm551798066b.173.2024.08.06.05.52.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948744; x=1723553544; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O8RRMhLXR56plds6R4QKKiZtLeNwl7BDBlyuBOky7w8=; b=Yv3uU6tCf1T937m2RMfOuKTL/ax8ZZfX65jDM+IyWeCw13xe2f3Jj6cknPx5RY4FNl i6u5Nm0GDG7nCzwhTeX5WLZkaYhCo4Bri7bz8XIXQlm+zmzuq89eXg8/jjRjzKlRLC4u /MA+iG7GmpwYJN3cgGFZ96cOUIqHF0RDAwqa4l5G10FEcPsEQgEfKhXwui/ssJS3+EFK 3i3+3aTi8geIzdnDMHsKCMWCHWtytafy/x4jI2wbArFpatAPdW+p/x86Ch2QG9hSEPiX 0YOa/0XO1jPfjR1RWV9+7VxjxreXjkZp0w4aVyK/7j4tzyS6Apz2VTuoO+HEARRu3dXO vTMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948744; x=1723553544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O8RRMhLXR56plds6R4QKKiZtLeNwl7BDBlyuBOky7w8=; b=qgWcg9o9IFvGDzooreP2VYkYC4bVUTvKlvaqFuogrDO/j4N3PtFlace3FuEme2Dkwd TG9yRlYptVk4nFgMB4Hdh7YqgBX182D2sb4jPP4vZzu6eFbcKs/urTYlDcN0UZNdRpEU 20fFWpOQJb9WVtYVUFdo06ceGygs2o3T694nyVNuF1pW7naYXnqNL4A6pLZI5Zq0nkLF 5hRP5pdJmLB6VOUbZe2VXpw108/xsQjlTYUdYyMXXGFX1DOoASgiIojddJeVzxMVAq0s 1I6iBn7uqnGH7olr+UcJsIbdhkuuqH2xvXiNNtSN03Jgt2N7tU9FhiPtRvKbEMMTYtXv yXyg== X-Gm-Message-State: AOJu0YzaTxCYalhMEeF5YzjBo/S256jzjrUFsByjZp1j6nGvpxLg1sPQ WnHr9nJuJeBJQcICK3UG4zXaPMnvbfoWmRpasSY/COGO2y8Fkp6DQXpfTeaUr0vTksF4zB7pXHm + X-Google-Smtp-Source: AGHT+IHnGZ+3qMsZeWlpBhQLtvkBl9xykl5mxO0zIVBc7Wavo+lowRnYlVD2PKjy88XcSzWRDSVSHg== X-Received: by 2002:a05:6512:3b89:b0:52c:cd77:fe03 with SMTP id 2adb3069b0e04-530bb380dabmr12456478e87.14.1722948743824; Tue, 06 Aug 2024 05:52:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 04/28] hw/intc/loongson_ipi: Move common definitions to loongson_ipi_common.h Date: Tue, 6 Aug 2024 14:51:32 +0200 Message-ID: <20240806125157.91185-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949273692116600 From: Bibo Mao Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-5-philmd@linaro.org> --- include/hw/intc/loongson_ipi.h | 18 ------------------ include/hw/intc/loongson_ipi_common.h | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/include/hw/intc/loongson_ipi.h b/include/hw/intc/loongson_ipi.h index 9c9030761e..70e00dc1a7 100644 --- a/include/hw/intc/loongson_ipi.h +++ b/include/hw/intc/loongson_ipi.h @@ -12,24 +12,6 @@ #include "hw/intc/loongson_ipi_common.h" #include "hw/sysbus.h" =20 -/* Mainy used by iocsr read and write */ -#define SMP_IPI_MAILBOX 0x1000ULL -#define CORE_STATUS_OFF 0x0 -#define CORE_EN_OFF 0x4 -#define CORE_SET_OFF 0x8 -#define CORE_CLEAR_OFF 0xc -#define CORE_BUF_20 0x20 -#define CORE_BUF_28 0x28 -#define CORE_BUF_30 0x30 -#define CORE_BUF_38 0x38 -#define IOCSR_IPI_SEND 0x40 -#define IOCSR_MAIL_SEND 0x48 -#define IOCSR_ANY_SEND 0x158 - -#define MAIL_SEND_ADDR (SMP_IPI_MAILBOX + IOCSR_MAIL_SEND) -#define MAIL_SEND_OFFSET 0 -#define ANY_SEND_OFFSET (IOCSR_ANY_SEND - IOCSR_MAIL_SEND) - #define IPI_MBX_NUM 4 =20 #define TYPE_LOONGSON_IPI "loongson_ipi" diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongs= on_ipi_common.h index 70ac69d0ba..b43b77bda6 100644 --- a/include/hw/intc/loongson_ipi_common.h +++ b/include/hw/intc/loongson_ipi_common.h @@ -23,4 +23,23 @@ struct LoongsonIPICommonClass { SysBusDeviceClass parent_class; }; =20 +/* Mainy used by iocsr read and write */ +#define SMP_IPI_MAILBOX 0x1000ULL + +#define CORE_STATUS_OFF 0x0 +#define CORE_EN_OFF 0x4 +#define CORE_SET_OFF 0x8 +#define CORE_CLEAR_OFF 0xc +#define CORE_BUF_20 0x20 +#define CORE_BUF_28 0x28 +#define CORE_BUF_30 0x30 +#define CORE_BUF_38 0x38 +#define IOCSR_IPI_SEND 0x40 +#define IOCSR_MAIL_SEND 0x48 +#define IOCSR_ANY_SEND 0x158 + +#define MAIL_SEND_ADDR (SMP_IPI_MAILBOX + IOCSR_MAIL_SEND) +#define MAIL_SEND_OFFSET 0 +#define ANY_SEND_OFFSET (IOCSR_ANY_SEND - IOCSR_MAIL_SEND) + #endif --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948824; cv=none; d=zohomail.com; s=zohoarc; b=Dwepd5/vr8On5YL7jjzrHFVWXwbvZnqWH0BY/ttMuqB6+75JBA3cfqZIksLDKOP7h92VhStg9/YKnYSU8dya7s5gShqSDkISEKLuyZnZX0fhso8yaTSEphbtiWgdbX2GGN/zoVXpB8UjX/G5RDyic8bNh0Po4Y8ITm9qI0xZP/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948824; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NtzQOHvlE55OSnA48RNxVcrzEb0jC3AHIEec0cFYiUU=; b=ZgugndK5xnOJqzc529YhXJbTshVqDtd4trGjW6bVOr+KdSdm5ewjRbBOYl+rP0ejBdTMx3f8UKD0l8WtKzPg0vlaN1+bk54yCByDeQC66eoINF23E+hHpA3JDacYu2g2r72CPSvRNARwxNsaTqOQA4yzrd2T9R/KIedV0iXVYgU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948824499993.4565445881061; Tue, 6 Aug 2024 05:53:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJg3-0006Df-HI; Tue, 06 Aug 2024 08:52:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJg2-0006Ao-Pv for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:34 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJg1-0008R1-2d for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:34 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52efd855adbso938164e87.2 for ; Tue, 06 Aug 2024 05:52:32 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9bcb19csm544275866b.42.2024.08.06.05.52.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948751; x=1723553551; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NtzQOHvlE55OSnA48RNxVcrzEb0jC3AHIEec0cFYiUU=; b=oqMmWobdRxUPOyN26y6lubUXjzqiTSVaCEMDvJCv5gwr9mGv9AJYNYYxChS2icHnV5 cdzmK1iW3ZFbge0V8d6mylzDuS26iBlJyWuuJFrX7IX4KGWpY/BNrx72WN6JB4VCIp7g X16jdqyiJMAbz7uxOMpCQmWW7f7U7eS6PtvJ2aJ2Qz6bKvUjHQORmXTAsfbORDbFASIX ugqe0Y7fx+v+3H8BSpOfe39YRf+sge8e0UJboFhGd7YgGr9eUlixxR6M4Y4aIFsMqhE1 bqqFrbyi+MaBglvYHMq3THPp0oJvER8SkJAHBM/OOq2nsA/XsJTRNmk9/Q4Wu/xNBYPb irCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948751; x=1723553551; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NtzQOHvlE55OSnA48RNxVcrzEb0jC3AHIEec0cFYiUU=; b=jMMuKiuR7rs1D5uSdFfvnBzZ1J+7pWS2rtPOB8240KZqURe+jLr1f/ApEzWJFiSCnD jjVyRPKGGLnNOLUZrKQ3moaoW0rAArcouRAS+FCmaYh2wpolQYh/MHMPzGUVzHW1+Efg ocGa4frCPhtvLSB+907UH4awGgzgH9Oz3vBiZfibtXC7yARdcqJliDAbimfIWshE+GOg q1omCgB0wIGhGnnV9jnE1cOghzC7rmqcImk1ESXg49sPMFA2ChET7og9NmPxAhWwYa8H QGjmNjMas+IDr5OmBsIQjW5/cr5YleXgJXdT8o8HKzkiX4xL+mTapj48FvdEihiVfcYM t2HA== X-Gm-Message-State: AOJu0YxEKoBaSnoMPjsqzzFQqiXpBRRK2hOYV4dHyNmDS/ka5T8+WvMU 5If5gw0J0Oa9FqdCfn6+yJZJfDKGtUsCZIIgmzkU//UeDXz6sYkdLbf/pvnoY195ABPVJ0/13mS L X-Google-Smtp-Source: AGHT+IG3JIs2tpCTM6Gw2T9UjzFujppPTF84uzcqsPnLsBd+77ve7uEKc/8OKqLvkTRtOytNjdO7IQ== X-Received: by 2002:a05:6512:2311:b0:52c:df6d:e52e with SMTP id 2adb3069b0e04-530bb36f9famr10337015e87.16.1722948750754; Tue, 06 Aug 2024 05:52:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 05/28] hw/intc/loongson_ipi: Move IPICore::mmio_mem to LoongsonIPIState Date: Tue, 6 Aug 2024 14:51:33 +0200 Message-ID: <20240806125157.91185-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=philmd@linaro.org; helo=mail-lf1-x132.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948825716116600 From: Bibo Mao It is easier to manage one array of MMIO MR rather than one per vCPU. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-6-philmd@linaro.org> --- include/hw/intc/loongson_ipi.h | 2 +- hw/intc/loongson_ipi.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/hw/intc/loongson_ipi.h b/include/hw/intc/loongson_ipi.h index 70e00dc1a7..5a52dfbf4d 100644 --- a/include/hw/intc/loongson_ipi.h +++ b/include/hw/intc/loongson_ipi.h @@ -19,7 +19,6 @@ OBJECT_DECLARE_TYPE(LoongsonIPIState, LoongsonIPIClass, L= OONGSON_IPI) =20 typedef struct IPICore { LoongsonIPIState *ipi; - MemoryRegion *ipi_mmio_mem; uint32_t status; uint32_t en; uint32_t set; @@ -39,6 +38,7 @@ struct LoongsonIPIClass { struct LoongsonIPIState { LoongsonIPICommonState parent_obj; =20 + MemoryRegion *ipi_mmio_mem; MemoryRegion ipi_iocsr_mem; MemoryRegion ipi64_iocsr_mem; uint32_t num_cpu; diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 7d15c28e94..03878b896f 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -320,12 +320,12 @@ static void loongson_ipi_realize(DeviceState *dev, Er= ror **errp) return; } =20 + s->ipi_mmio_mem =3D g_new0(MemoryRegion, s->num_cpu); for (unsigned i =3D 0; i < s->num_cpu; i++) { - s->cpu[i].ipi_mmio_mem =3D g_new0(MemoryRegion, 1); g_autofree char *name =3D g_strdup_printf("loongson_ipi_cpu%d_mmio= ", i); - memory_region_init_io(s->cpu[i].ipi_mmio_mem, OBJECT(dev), + memory_region_init_io(&s->ipi_mmio_mem[i], OBJECT(dev), &loongson_ipi_core_ops, &s->cpu[i], name, 0x= 48); - sysbus_init_mmio(sbd, s->cpu[i].ipi_mmio_mem); + sysbus_init_mmio(sbd, &s->ipi_mmio_mem[i]); } } =20 @@ -338,6 +338,10 @@ static void loongson_ipi_common_unrealize(DeviceState = *dev) =20 static void loongson_ipi_unrealize(DeviceState *dev) { + LoongsonIPIState *s =3D LOONGSON_IPI(dev); + + g_free(s->ipi_mmio_mem); + loongson_ipi_common_unrealize(dev); } =20 --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948814; cv=none; d=zohomail.com; s=zohoarc; b=lnhTy9oQZPM4LYeB4fl2DmGT/lt2a7v8atLWE6zPc+nSfMra562mSLLvcGwCe3XsFiVUs9bVpzhwVNDSH+6w/RK88TSHu2RP02SWIPTcdpPXUAExqzwrWUVTlijhADqFna8jQC6W65CQuhF6fuh97qbazv+qAoCmmUBG+mIsVlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948814; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QwpY/JynEMtTkyIwPRmmw3TCd0WkcVnsonvQjUTWgeg=; b=FTEmvRFG0B40cRQ4XynURyrkXOeJWlV5nQ448a5/n/xnvBgG7uqQ/HRd8J4l1Xut9RH6xPDihCCMWrfsfmdzwhXhrCEsP9d8f/I/subautC2hrLvWLTUaizfTKdbJr3DG24kqRqP9/NWErJ3F/z3IuB7xdAIBOrxnj4l3/ILkWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948813998403.4300525893527; Tue, 6 Aug 2024 05:53:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgB-0006kd-82; Tue, 06 Aug 2024 08:52:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJg9-0006c2-0k for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:41 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJg6-0008Sq-P9 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:40 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a7aac70e30dso58841466b.1 for ; Tue, 06 Aug 2024 05:52:38 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9ecabb2sm541820766b.214.2024.08.06.05.52.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948757; x=1723553557; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QwpY/JynEMtTkyIwPRmmw3TCd0WkcVnsonvQjUTWgeg=; b=lZ2HOj26rDFa3qNPPQRQtR6FHpP3NgprbtkESQvdIVDjxuch7MleHyqOzf+B9sdCeB My+DrBX9Gkk3lcTE7cGXMx9zdG83C3UlI5mDQ4pX4KBaQiUhoF6u90XSgjUIutv8MN+U qsvbZl1/24XajnsVNn77OYlPqBNjgyVHY6Ut+yEY2q97NPTiCvgxY04S8FCDElQs0co5 wOv9n2OuzRTkbv9ih6Cmume1TMg2Xwsw6MTl+wIaGIuyruMEopyxV+yR1zumGcZt2nSe TJJvmrzNl4cZ7C46cUcbABqkI6wqOPDju1xmFTIhxN+155QbkL+o+VwwkLkqX8YDJ9Q9 GbZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948757; x=1723553557; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QwpY/JynEMtTkyIwPRmmw3TCd0WkcVnsonvQjUTWgeg=; b=fdUHqDydeI/GrO0R7DyZjHBfMaaFpM4tQA+vvZQCPr+Wom4NotR5hpfvKdpvo0jrl+ CzjzuwGvDNhieVet5Sb7sPnHU6f+Hu360sB56Kp7YJr/cMQpFLpX+h6FNVtiN9xfpBYL Qtn/i+w7PvlWE9wxAP18XY8HxtYgJdi6XYafGKY/VzDlvRuga4JZ7+Uy6vheUqsPHmzT vj9N9XciHwjloYB4H6tWtNMRYiL/Rd2fzeKohmyPhcQib/i88T1Ep208jemlnX0o0RGm fQQStXm+sc+qEmimMlryD7+nJBIn+zQ/wVwYnvhmm1RVkpJ3UjOWms7EQ3ACm9ubKVWu a7hg== X-Gm-Message-State: AOJu0Yzi0eBhROG/OEHrtnl11zywYTpDnMG1pYjaD+RRjDtA3Wb8/+a4 fB3tRqzMc0GLr0jemt7Cc1+aWAvLiM/D7DNWBcnYxn25RE6H3nOTBdUH7/vAQvooFwoUYymp+Sl 4 X-Google-Smtp-Source: AGHT+IGoZ4cizP9vU0oOtnC+ar/pgFKxuStTSHZ4LSVm7L+nCgsEzmGqns5CovGJQi7JZJvXd5IuEQ== X-Received: by 2002:a17:907:3d8d:b0:a7a:97a9:ba23 with SMTP id a640c23a62f3a-a7dc50213b5mr1119445666b.22.1722948756966; Tue, 06 Aug 2024 05:52:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 06/28] hw/intc/loongson_ipi: Move IPICore structure to loongson_ipi_common.h Date: Tue, 6 Aug 2024 14:51:34 +0200 Message-ID: <20240806125157.91185-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948815456116600 From: Bibo Mao Move the IPICore structure and corresponding common fields of LoongsonIPICommonState to "hw/intc/loongson_ipi_common.h". Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-7-philmd@linaro.org> --- include/hw/intc/loongson_ipi.h | 17 --------- include/hw/intc/loongson_ipi_common.h | 18 ++++++++++ hw/intc/loongson_ipi.c | 50 ++++++--------------------- hw/intc/loongson_ipi_common.c | 42 ++++++++++++++++++++++ 4 files changed, 70 insertions(+), 57 deletions(-) diff --git a/include/hw/intc/loongson_ipi.h b/include/hw/intc/loongson_ipi.h index 5a52dfbf4d..4e517cc8dc 100644 --- a/include/hw/intc/loongson_ipi.h +++ b/include/hw/intc/loongson_ipi.h @@ -12,22 +12,9 @@ #include "hw/intc/loongson_ipi_common.h" #include "hw/sysbus.h" =20 -#define IPI_MBX_NUM 4 - #define TYPE_LOONGSON_IPI "loongson_ipi" OBJECT_DECLARE_TYPE(LoongsonIPIState, LoongsonIPIClass, LOONGSON_IPI) =20 -typedef struct IPICore { - LoongsonIPIState *ipi; - uint32_t status; - uint32_t en; - uint32_t set; - uint32_t clear; - /* 64bit buf divide into 2 32bit buf */ - uint32_t buf[IPI_MBX_NUM * 2]; - qemu_irq irq; -} IPICore; - struct LoongsonIPIClass { LoongsonIPICommonClass parent_class; =20 @@ -39,10 +26,6 @@ struct LoongsonIPIState { LoongsonIPICommonState parent_obj; =20 MemoryRegion *ipi_mmio_mem; - MemoryRegion ipi_iocsr_mem; - MemoryRegion ipi64_iocsr_mem; - uint32_t num_cpu; - IPICore *cpu; }; =20 #endif diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongs= on_ipi_common.h index b43b77bda6..967c70ad1c 100644 --- a/include/hw/intc/loongson_ipi_common.h +++ b/include/hw/intc/loongson_ipi_common.h @@ -11,12 +11,30 @@ #include "qom/object.h" #include "hw/sysbus.h" =20 +#define IPI_MBX_NUM 4 + #define TYPE_LOONGSON_IPI_COMMON "loongson_ipi_common" OBJECT_DECLARE_TYPE(LoongsonIPICommonState, LoongsonIPICommonClass, LOONGSON_IPI_COMMON) =20 +typedef struct IPICore { + LoongsonIPICommonState *ipi; + uint32_t status; + uint32_t en; + uint32_t set; + uint32_t clear; + /* 64bit buf divide into 2 32-bit buf */ + uint32_t buf[IPI_MBX_NUM * 2]; + qemu_irq irq; +} IPICore; + struct LoongsonIPICommonState { SysBusDevice parent_obj; + + MemoryRegion ipi_iocsr_mem; + MemoryRegion ipi64_iocsr_mem; + uint32_t num_cpu; + IPICore *cpu; }; =20 struct LoongsonIPICommonClass { diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 03878b896f..347bc26729 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -64,7 +64,7 @@ static MemTxResult loongson_ipi_iocsr_readl(void *opaque,= hwaddr addr, uint64_t *data, unsigned size, MemTxAttrs attr= s) { - LoongsonIPIState *ipi =3D opaque; + LoongsonIPICommonState *ipi =3D opaque; IPICore *s; =20 if (attrs.requester_id >=3D ipi->num_cpu) { @@ -160,7 +160,7 @@ static MemTxResult loongson_ipi_core_writel(void *opaqu= e, hwaddr addr, MemTxAttrs attrs) { IPICore *s =3D opaque; - LoongsonIPIState *ipi =3D s->ipi; + LoongsonIPICommonState *ipi =3D s->ipi; int index =3D 0; uint32_t cpuid; uint8_t vector; @@ -214,7 +214,7 @@ static MemTxResult loongson_ipi_iocsr_writel(void *opaq= ue, hwaddr addr, uint64_t val, unsigned size, MemTxAttrs attrs) { - LoongsonIPIState *ipi =3D opaque; + LoongsonIPICommonState *ipi =3D opaque; IPICore *s; =20 if (attrs.requester_id >=3D ipi->num_cpu) { @@ -277,7 +277,7 @@ static const MemoryRegionOps loongson_ipi64_ops =3D { =20 static void loongson_ipi_common_realize(DeviceState *dev, Error **errp) { - LoongsonIPIState *s =3D LOONGSON_IPI(dev); + LoongsonIPICommonState *s =3D LOONGSON_IPI_COMMON(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); int i; =20 @@ -310,6 +310,7 @@ static void loongson_ipi_common_realize(DeviceState *de= v, Error **errp) =20 static void loongson_ipi_realize(DeviceState *dev, Error **errp) { + LoongsonIPICommonState *sc =3D LOONGSON_IPI_COMMON(dev); LoongsonIPIState *s =3D LOONGSON_IPI(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); Error *local_err =3D NULL; @@ -320,18 +321,19 @@ static void loongson_ipi_realize(DeviceState *dev, Er= ror **errp) return; } =20 - s->ipi_mmio_mem =3D g_new0(MemoryRegion, s->num_cpu); - for (unsigned i =3D 0; i < s->num_cpu; i++) { + s->ipi_mmio_mem =3D g_new0(MemoryRegion, sc->num_cpu); + for (unsigned i =3D 0; i < sc->num_cpu; i++) { g_autofree char *name =3D g_strdup_printf("loongson_ipi_cpu%d_mmio= ", i); + memory_region_init_io(&s->ipi_mmio_mem[i], OBJECT(dev), - &loongson_ipi_core_ops, &s->cpu[i], name, 0x= 48); + &loongson_ipi_core_ops, &sc->cpu[i], name, 0= x48); sysbus_init_mmio(sbd, &s->ipi_mmio_mem[i]); } } =20 static void loongson_ipi_common_unrealize(DeviceState *dev) { - LoongsonIPIState *s =3D LOONGSON_IPI(dev); + LoongsonIPICommonState *s =3D LOONGSON_IPI_COMMON(dev); =20 g_free(s->cpu); } @@ -345,36 +347,6 @@ static void loongson_ipi_unrealize(DeviceState *dev) loongson_ipi_common_unrealize(dev); } =20 -static const VMStateDescription vmstate_ipi_core =3D { - .name =3D "ipi-single", - .version_id =3D 2, - .minimum_version_id =3D 2, - .fields =3D (const VMStateField[]) { - VMSTATE_UINT32(status, IPICore), - VMSTATE_UINT32(en, IPICore), - VMSTATE_UINT32(set, IPICore), - VMSTATE_UINT32(clear, IPICore), - VMSTATE_UINT32_ARRAY(buf, IPICore, IPI_MBX_NUM * 2), - VMSTATE_END_OF_LIST() - } -}; - -static const VMStateDescription vmstate_loongson_ipi =3D { - .name =3D TYPE_LOONGSON_IPI, - .version_id =3D 2, - .minimum_version_id =3D 2, - .fields =3D (const VMStateField[]) { - VMSTATE_STRUCT_VARRAY_POINTER_UINT32(cpu, LoongsonIPIState, num_cp= u, - vmstate_ipi_core, IPICore), - VMSTATE_END_OF_LIST() - } -}; - -static Property ipi_properties[] =3D { - DEFINE_PROP_UINT32("num-cpu", LoongsonIPIState, num_cpu, 1), - DEFINE_PROP_END_OF_LIST(), -}; - static void loongson_ipi_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -384,8 +356,6 @@ static void loongson_ipi_class_init(ObjectClass *klass,= void *data) &lic->parent_realize); device_class_set_parent_unrealize(dc, loongson_ipi_unrealize, &lic->parent_unrealize); - device_class_set_props(dc, ipi_properties); - dc->vmsd =3D &vmstate_loongson_ipi; } =20 static const TypeInfo loongson_ipi_types[] =3D { diff --git a/hw/intc/loongson_ipi_common.c b/hw/intc/loongson_ipi_common.c index 43002fe556..47796f7ece 100644 --- a/hw/intc/loongson_ipi_common.c +++ b/hw/intc/loongson_ipi_common.c @@ -8,6 +8,47 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" #include "hw/intc/loongson_ipi_common.h" +#include "hw/qdev-properties.h" +#include "migration/vmstate.h" + +static const VMStateDescription vmstate_ipi_core =3D { + .name =3D "ipi-single", + .version_id =3D 2, + .minimum_version_id =3D 2, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT32(status, IPICore), + VMSTATE_UINT32(en, IPICore), + VMSTATE_UINT32(set, IPICore), + VMSTATE_UINT32(clear, IPICore), + VMSTATE_UINT32_ARRAY(buf, IPICore, IPI_MBX_NUM * 2), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_loongson_ipi_common =3D { + .name =3D "loongson_ipi", + .version_id =3D 2, + .minimum_version_id =3D 2, + .fields =3D (const VMStateField[]) { + VMSTATE_STRUCT_VARRAY_POINTER_UINT32(cpu, LoongsonIPICommonState, + num_cpu, vmstate_ipi_core, + IPICore), + VMSTATE_END_OF_LIST() + } +}; + +static Property ipi_common_properties[] =3D { + DEFINE_PROP_UINT32("num-cpu", LoongsonIPICommonState, num_cpu, 1), + DEFINE_PROP_END_OF_LIST(), +}; + +static void loongson_ipi_common_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + device_class_set_props(dc, ipi_common_properties); + dc->vmsd =3D &vmstate_loongson_ipi_common; +} =20 static const TypeInfo loongarch_ipi_common_types[] =3D { { @@ -15,6 +56,7 @@ static const TypeInfo loongarch_ipi_common_types[] =3D { .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(LoongsonIPICommonState), .class_size =3D sizeof(LoongsonIPICommonClass), + .class_init =3D loongson_ipi_common_class_init, .abstract =3D true, } }; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948802; cv=none; d=zohomail.com; s=zohoarc; b=nYsDUajDHS+NlJbM9l3inBbxm7w3+qcAA0lcdDNWQbQ1CufyU0i1UUVHadEkibt7gbAjHvsg6qXm2seZs39vTGSftOxX0blTZ2WteYKy+2xpt9g2RAC8tJfhTfNjOV80wsZpyz2BbpGVKpIzJw/sSpXuc0hQvsgdEmDAqTI+ptM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948802; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZTxS6tVkh4S2hExOyR5WNEzapIPqKrrXzfqzZq+lw00=; b=cUApkFuFQloAnnATr3BOlimQ9bpqQVmpkTUdAtGE6XxwSe+wZiT+EToIGpspPivhBOzvhXTI6qUu0c6JuA3x5uWGk+TcRN+1djcTz6tLtzlfnmCHrDhhof/fJpjDAVn0GFfKv7NTrE4OXmQG0MegxjX5oPsGyKWsHkVQoGz0bs4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948802748573.5404178007989; Tue, 6 Aug 2024 05:53:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgG-00076D-JW; Tue, 06 Aug 2024 08:52:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgE-0006zM-SD for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:46 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgD-0008T4-58 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:46 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-52efbb55d24so1039430e87.1 for ; Tue, 06 Aug 2024 05:52:44 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e83ec1sm545106766b.182.2024.08.06.05.52.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948763; x=1723553563; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZTxS6tVkh4S2hExOyR5WNEzapIPqKrrXzfqzZq+lw00=; b=JlzTNEyxf6eGLFfVQaDV/WIm+06jTFdjVgNVy4jQcT7AdA1ucBTdKzu2/gGWT63mHF qoWL5I7fjx7J3QKuYiQigtqsGmxryqt3jhIqZVliyT7LXQIt5avdnq2lHmL7EwPmhkDX MLPDoCUFIDg93BEJAHSh+HcPOLOxhHPOyqOOEvkfFYbFKOXhQ9zO8WK/Bqy8i08wovhu PZmtyIZviogvRmqFYq1edIodfXRx+sdYro9ilS40PA7p8wOAnn6fjtVC74dEEr0xTgxK 3hvjqjfH/G915qP9VKk+0ENGfQJxEQ5JzvbLzthMYhqZQMb7yQP+TaMwTU8u5gi2npav oRig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948763; x=1723553563; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZTxS6tVkh4S2hExOyR5WNEzapIPqKrrXzfqzZq+lw00=; b=QvHKoST3lZdvrFIVm3XGl1z3UC2LwlqnwgI58keSBiUHPij2wFDxZzlKt3lOY0HKGc 6n5fCN11zb/8ELrmZxdmrjbZlVhPvaHAFx6zQ+kKMEbx0BSjg/SJkLv0tFv4hRhjZA5v dqKhyp8NcJ1Y1RrK/Eaum36CV83Jmsr90OlZdnBQWX5os5rPpKNvfggdWjRIr6Z64Vp/ dXSGTKaReO+PE98qoSVuUjvhwq53Gn+IcVjU1F3jp5Zmz673CLHuVHnICN+POHO7Gnou ZxIFIWcSqmcJbmAVVSiN1G3ALNeU77LdI9p+VXvgFTj32hZQEvL8VY3yYOwagTzQ6SaR mAEQ== X-Gm-Message-State: AOJu0YztEzsEmj43jHnpx1Qesbu1QKCfKftYyxCJdjeuZQKz9NScRGjt 81dM9suXXd+3r8TQTCJKV8eOACC1JF/mivdMcF/mjI/yhCEK6uQ05eBIMwyFSJOE6KevhMcsGtw 5 X-Google-Smtp-Source: AGHT+IGKF47uGF1tAQN2XYt9SevDhmcCU0dznHeowWVghcLolefA44GVYZ0+Gl6SQzwWZVgsvb0NYA== X-Received: by 2002:a05:6512:4020:b0:52c:deb9:904b with SMTP id 2adb3069b0e04-530bb3b46fcmr13250092e87.38.1722948763035; Tue, 06 Aug 2024 05:52:43 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 07/28] hw/intc/loongson_ipi: Pass LoongsonIPICommonState to send_ipi_data() Date: Tue, 6 Aug 2024 14:51:35 +0200 Message-ID: <20240806125157.91185-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948803397116600 From: Bibo Mao In order to get LoongsonIPICommonClass in send_ipi_data() in the next commit, propagate LoongsonIPICommonState. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-8-philmd@linaro.org> --- hw/intc/loongson_ipi.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 347bc26729..8bf16f26d4 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -88,8 +88,8 @@ static AddressSpace *get_cpu_iocsr_as(CPUState *cpu) return NULL; } =20 -static MemTxResult send_ipi_data(CPUState *cpu, uint64_t val, hwaddr addr, - MemTxAttrs attrs) +static MemTxResult send_ipi_data(LoongsonIPICommonState *ipi, CPUState *cp= u, + uint64_t val, hwaddr addr, MemTxAttrs att= rs) { int i, mask =3D 0, data =3D 0; AddressSpace *iocsr_as =3D get_cpu_iocsr_as(cpu); @@ -119,7 +119,8 @@ static MemTxResult send_ipi_data(CPUState *cpu, uint64_= t val, hwaddr addr, return MEMTX_OK; } =20 -static MemTxResult mail_send(uint64_t val, MemTxAttrs attrs) +static MemTxResult mail_send(LoongsonIPICommonState *ipi, + uint64_t val, MemTxAttrs attrs) { uint32_t cpuid; hwaddr addr; @@ -134,10 +135,11 @@ static MemTxResult mail_send(uint64_t val, MemTxAttrs= attrs) /* override requester_id */ addr =3D SMP_IPI_MAILBOX + CORE_BUF_20 + (val & 0x1c); attrs.requester_id =3D cs->cpu_index; - return send_ipi_data(cs, val, addr, attrs); + return send_ipi_data(ipi, cs, val, addr, attrs); } =20 -static MemTxResult any_send(uint64_t val, MemTxAttrs attrs) +static MemTxResult any_send(LoongsonIPICommonState *ipi, + uint64_t val, MemTxAttrs attrs) { uint32_t cpuid; hwaddr addr; @@ -152,7 +154,7 @@ static MemTxResult any_send(uint64_t val, MemTxAttrs at= trs) /* override requester_id */ addr =3D val & 0xffff; attrs.requester_id =3D cs->cpu_index; - return send_ipi_data(cs, val, addr, attrs); + return send_ipi_data(ipi, cs, val, addr, attrs); } =20 static MemTxResult loongson_ipi_core_writel(void *opaque, hwaddr addr, @@ -249,15 +251,16 @@ static const MemoryRegionOps loongson_ipi_iocsr_ops = =3D { static MemTxResult loongson_ipi_writeq(void *opaque, hwaddr addr, uint64_t= val, unsigned size, MemTxAttrs attrs) { + LoongsonIPICommonState *ipi =3D opaque; MemTxResult ret =3D MEMTX_OK; =20 addr &=3D 0xfff; switch (addr) { case MAIL_SEND_OFFSET: - ret =3D mail_send(val, attrs); + ret =3D mail_send(ipi, val, attrs); break; case ANY_SEND_OFFSET: - ret =3D any_send(val, attrs); + ret =3D any_send(ipi, val, attrs); break; default: break; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948814; cv=none; d=zohomail.com; s=zohoarc; b=hIIHkxo8h72U2h3yH1ieJtiqDjroVhYn2lEsG3aB8KEt/IWUzIs2fat2MXjYP6YF8Q2dvzrKXRUhL6Tl/6hFvDs07WKir6l/YCj9hv0iwwDjoxRATExJyYce9npOn3nTsjyNrSsoERemorL9i57i1I3oFl0bIiUEX8FQx4hQ8SA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948814; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5mKdPYX00cysnIaHHc614x0QrHflyLw6OzvKS8k0g7I=; b=KyIon1zQzGyqzs2jE+QI0GHeza4wVk0IQZKp/FV0b794qyI7gSIXr28+J8jMnpAzksXb7DXVVOoxYfXRAY9DqunLb5UphhOCJzyrd1CttBxjxsYomh3CB+09AjL8yieCmmsSZsevo5VGxRLzCnoaVC8BEIyRufBuq+a/Mer2giQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948814117415.9696982643237; Tue, 6 Aug 2024 05:53:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgQ-000803-6E; Tue, 06 Aug 2024 08:52:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgL-0007ZC-QX for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:53 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgJ-0008TG-8y for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:52 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5afa207b8bfso557259a12.0 for ; Tue, 06 Aug 2024 05:52:50 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b83b82c068sm5896520a12.60.2024.08.06.05.52.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948769; x=1723553569; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5mKdPYX00cysnIaHHc614x0QrHflyLw6OzvKS8k0g7I=; b=rXhG4b4/uKpFn6/cxsG/DZb34p7J5FqOaBSnmWqczCCZSPhdexW36i0/Syu+g2/zj2 qZfcUQGH9kTdiNV/4l1w4ZNKnY9vulYdGXvM8DVNmWYHyL4jLe+1XcTwwwpRGNpH+7w5 CJVy0LG6Lin5RqqYGqkOCA4WeJVEhOqNOZE+xcwDXqjGLJxDgRvI0yICYwLTK4djXTKr Yf/1B1VP+Uo+Nb+InCuGfeOlP1/XPK1l0TK8RHgt9+Z0RHTE3pADw1AORHScTxx1qzEW Pw9tztTIo47hrLnPIgFBvfVhYQj9bhBXsNWngh+kvNeBh+QjKVXoMyYADVg0ib5vaA95 bNLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948769; x=1723553569; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5mKdPYX00cysnIaHHc614x0QrHflyLw6OzvKS8k0g7I=; b=JXUcoKadFSke+j5JlfDv/3eL37B/RcrtMFOz+pd8ONHM6H+L9MfxuDql5EopDk2FIN mpOLc6IUHOcI4aymf0aSxyp4yWtf/6fTuWoQE5/eD1ZDa6ysRUeeiUjY1CCMiFMBRXb2 ATzh7jq7e/mUotg8u0Q26X1ucP33NCeGvRUVe5YvbpGK+ztSARioQE7u56N2VqC3CrhM qvn/ap4YddLRXa/4cvM043Zyyb7ZYiWlRQjIVSd77+CIu7p0ao0ZTmH6Fqr47xIk0YuE LW8KtfIKHu0pFXV/xfKbA7CYusG6+7NA9vFN6UBGoDPoQygTf4ZrzWu15603Of62hpD6 AfVQ== X-Gm-Message-State: AOJu0YzUmRl9RT4PMb3JccDO/8i8ZSOlFdS9i6eUTZjhNGfjC83KggCJ BvbqsLHtAeqGuvq7qEbsg+/Wcqzp8SS9zJwq2V8FSzowlMf6ELbyJc6Ugo4AasyXR2BlRx2nrfE E X-Google-Smtp-Source: AGHT+IG2iXGLH7xg5xXZO0cJfqpcejKmxTSK5PCb8+BH4F/+U0VgtzAxSioxsrDQHLZScrfUb3EOaA== X-Received: by 2002:a05:6402:129a:b0:57d:72e:5b3a with SMTP id 4fb4d7f45d1cf-5b7f56fb7cbmr9883959a12.33.1722948769369; Tue, 06 Aug 2024 05:52:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 08/28] hw/intc/loongson_ipi: Add LoongsonIPICommonClass::get_iocsr_as handler Date: Tue, 6 Aug 2024 14:51:36 +0200 Message-ID: <20240806125157.91185-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948815450116600 From: Bibo Mao Allow Loongson IPI implementations to have their own get_iocsr_as() handler. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-9-philmd@linaro.org> --- include/hw/intc/loongson_ipi_common.h | 2 ++ hw/intc/loongson_ipi.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongs= on_ipi_common.h index 967c70ad1c..1a2ee41cc9 100644 --- a/include/hw/intc/loongson_ipi_common.h +++ b/include/hw/intc/loongson_ipi_common.h @@ -39,6 +39,8 @@ struct LoongsonIPICommonState { =20 struct LoongsonIPICommonClass { SysBusDeviceClass parent_class; + + AddressSpace *(*get_iocsr_as)(CPUState *cpu); }; =20 /* Mainy used by iocsr read and write */ diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 8bf16f26d4..eb99de9068 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -75,24 +75,30 @@ static MemTxResult loongson_ipi_iocsr_readl(void *opaqu= e, hwaddr addr, return loongson_ipi_core_readl(s, addr, data, size, attrs); } =20 -static AddressSpace *get_cpu_iocsr_as(CPUState *cpu) -{ #ifdef TARGET_LOONGARCH64 +static AddressSpace *get_iocsr_as(CPUState *cpu) +{ return LOONGARCH_CPU(cpu)->env.address_space_iocsr; +} #endif + #ifdef TARGET_MIPS +static AddressSpace *get_iocsr_as(CPUState *cpu) +{ if (ase_lcsr_available(&MIPS_CPU(cpu)->env)) { return &MIPS_CPU(cpu)->env.iocsr.as; } -#endif + return NULL; } +#endif =20 static MemTxResult send_ipi_data(LoongsonIPICommonState *ipi, CPUState *cp= u, uint64_t val, hwaddr addr, MemTxAttrs att= rs) { + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); int i, mask =3D 0, data =3D 0; - AddressSpace *iocsr_as =3D get_cpu_iocsr_as(cpu); + AddressSpace *iocsr_as =3D licc->get_iocsr_as(cpu); =20 if (!iocsr_as) { return MEMTX_DECODE_ERROR; @@ -354,11 +360,13 @@ static void loongson_ipi_class_init(ObjectClass *klas= s, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); LoongsonIPIClass *lic =3D LOONGSON_IPI_CLASS(klass); + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_CLASS(klass); =20 device_class_set_parent_realize(dc, loongson_ipi_realize, &lic->parent_realize); device_class_set_parent_unrealize(dc, loongson_ipi_unrealize, &lic->parent_unrealize); + licc->get_iocsr_as =3D get_iocsr_as; } =20 static const TypeInfo loongson_ipi_types[] =3D { --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948819; cv=none; d=zohomail.com; s=zohoarc; b=BnpzQJnPSrWWV+WNmIATE9OfiRnYgPURj27bSLXJ6qc6BPehu5zHtWm6Yo0Duz8PTuPgvRV+VL7bt9kAk14DeeQk86SeuMMEhfMYTMiowHOGbJbjTrbRbVBKMo6VZZF/Jy9JatyyprsLBV/mu0d3Xc1a1CSxInOzWFjq9M0O/pk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948819; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pc4HRKn0ABU9Etyo/i6+qtUkhxyrZpQEkVJjk1kRbzM=; b=jSd/pLD/IA6Y01F6lpv8FxAOuYbwjzW38g2Oy9jpJSr6fIIR8pWT+FGnwXXB++nDeeTQN1Q42kWqb01SkI4MsDVd9mhx1CLlDT0p789KobpZC59iGDv0wQLn0StBu+7lXG/Pa6in5JDjZiCti+ixdFqGynragWxYRNwXLWmGtVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948819045913.7578010251573; Tue, 6 Aug 2024 05:53:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgY-0000Op-VF; Tue, 06 Aug 2024 08:53:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgW-0000Cc-2R for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:04 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgS-0008TS-Oy for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:03 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2ef2cce8be8so5935571fa.1 for ; Tue, 06 Aug 2024 05:52:58 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e83eccsm543566666b.184.2024.08.06.05.52.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948776; x=1723553576; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pc4HRKn0ABU9Etyo/i6+qtUkhxyrZpQEkVJjk1kRbzM=; b=zGVH41lOfI9QobnLVPP3IKg1NYgCrWieIp1p3WUTV+RpcWc23XXHBfQe5+VMpMPUEE yufuoKP5ENFt5lTxe2FrRLNOtcrGgjJJXvZ4keeZi1/IiSa0fEHsdOkAs0k4sIhmFkmm cJJnBKDvTce82KL0gf4+9F7uDRQS/gHL0i8cyZ5KQ4GpAuK1jx4uisMPCDZP1/MJ/nDD LSVQ2DiLP9/Yzy+V7w/1QCOx9ubQQfUhbz4oldB2eSDlWoO50uynR16CXkAssPIQY3hr Zy0yL5JGhnHc9WMoqwtEa8FC599cadtyt4QiTTf304j78t2LzhPDOidCSEofP0mdU8qn wiaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948776; x=1723553576; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pc4HRKn0ABU9Etyo/i6+qtUkhxyrZpQEkVJjk1kRbzM=; b=ewmZ/2qylKEBxE9AqYJZx/jwuQ+5AYw1E7+A9dHKunHRgMYyeEKZyY/2zBXGzKV71E 1F8LCrWw5ZW3KexblnmxfFTjvgg59G3WcQMZfgO/2GZVoPnvig/rw5mRCMfMA4N8V2Pe 9O3NAg3HWb8h+j51LtlJ38aDRD4MQLS5s2xXpk63G+zv7TEkcnKaJDNeXYMGF5S5Wthl IrKy7neFGS4e4P9pkGYXn1yMcwXle2whyQUD8YMRwTKvLoEuHKZYYRRY3ATSsge4YSQH NZgzQpZbmSMU+pEIkIMErP57LCTtJ5pJ2bvE4x2ic8yuWz24mJbD9XDGaqQMCafkU7V/ YaiQ== X-Gm-Message-State: AOJu0YzFzSvwW8cNyf0SvMOSRNK+3vKB9R2T5PfN8lkNaKpZf4BC9cP7 vRNQKXTlqYBCFW6KIyGvK/cVqsdBci6YJm83IhUkDPV+fADisdTGNMvVhEh6RVNgwNCq3h8Elru X X-Google-Smtp-Source: AGHT+IHzurmqcC2QcHCIcRuCYYdVCMIOyDluRId6nd/vITV2mzh8vtkWBTQ8HHIpwE57+Phc+89LPg== X-Received: by 2002:a05:6512:1051:b0:51a:f689:b4df with SMTP id 2adb3069b0e04-530bb39b06cmr11086986e87.44.1722948776211; Tue, 06 Aug 2024 05:52:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 09/28] hw/intc/loongson_ipi: Add LoongsonIPICommonClass::cpu_by_arch_id handler Date: Tue, 6 Aug 2024 14:51:37 +0200 Message-ID: <20240806125157.91185-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948819580116600 From: Bibo Mao Allow Loongson IPI implementations to have their own cpu_by_arch_id() handler. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-10-philmd@linaro.org> --- include/hw/intc/loongson_ipi_common.h | 1 + hw/intc/loongson_ipi.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongs= on_ipi_common.h index 1a2ee41cc9..8997676f0d 100644 --- a/include/hw/intc/loongson_ipi_common.h +++ b/include/hw/intc/loongson_ipi_common.h @@ -41,6 +41,7 @@ struct LoongsonIPICommonClass { SysBusDeviceClass parent_class; =20 AddressSpace *(*get_iocsr_as)(CPUState *cpu); + CPUState *(*cpu_by_arch_id)(int64_t id); }; =20 /* Mainy used by iocsr read and write */ diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index eb99de9068..4a8e743528 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -128,12 +128,13 @@ static MemTxResult send_ipi_data(LoongsonIPICommonSta= te *ipi, CPUState *cpu, static MemTxResult mail_send(LoongsonIPICommonState *ipi, uint64_t val, MemTxAttrs attrs) { + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); uint32_t cpuid; hwaddr addr; CPUState *cs; =20 cpuid =3D extract32(val, 16, 10); - cs =3D cpu_by_arch_id(cpuid); + cs =3D licc->cpu_by_arch_id(cpuid); if (cs =3D=3D NULL) { return MEMTX_DECODE_ERROR; } @@ -147,12 +148,13 @@ static MemTxResult mail_send(LoongsonIPICommonState *= ipi, static MemTxResult any_send(LoongsonIPICommonState *ipi, uint64_t val, MemTxAttrs attrs) { + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); uint32_t cpuid; hwaddr addr; CPUState *cs; =20 cpuid =3D extract32(val, 16, 10); - cs =3D cpu_by_arch_id(cpuid); + cs =3D licc->cpu_by_arch_id(cpuid); if (cs =3D=3D NULL) { return MEMTX_DECODE_ERROR; } @@ -169,6 +171,7 @@ static MemTxResult loongson_ipi_core_writel(void *opaqu= e, hwaddr addr, { IPICore *s =3D opaque; LoongsonIPICommonState *ipi =3D s->ipi; + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); int index =3D 0; uint32_t cpuid; uint8_t vector; @@ -203,7 +206,7 @@ static MemTxResult loongson_ipi_core_writel(void *opaqu= e, hwaddr addr, cpuid =3D extract32(val, 16, 10); /* IPI status vector */ vector =3D extract8(val, 0, 5); - cs =3D cpu_by_arch_id(cpuid); + cs =3D licc->cpu_by_arch_id(cpuid); if (cs =3D=3D NULL || cs->cpu_index >=3D ipi->num_cpu) { return MEMTX_DECODE_ERROR; } @@ -367,6 +370,7 @@ static void loongson_ipi_class_init(ObjectClass *klass,= void *data) device_class_set_parent_unrealize(dc, loongson_ipi_unrealize, &lic->parent_unrealize); licc->get_iocsr_as =3D get_iocsr_as; + licc->cpu_by_arch_id =3D cpu_by_arch_id; } =20 static const TypeInfo loongson_ipi_types[] =3D { --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948816; cv=none; d=zohomail.com; s=zohoarc; b=PneNqK8aLmLeRX8/0z/EiCjdCCuPbE3mpSw3GTNb6rORLTiArucwgiibXeQYcHW3B0Eu5Xep7gyw+jiP1CGsdfLcpYiDqdNExWW1xFJTA3qfw7Wko4wwAbBxZsTsVERc43Of9Bwh1Ndef1QtldO4vIlVbAOJHdi2GCvnDMzE1QM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948816; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H8NieMjgzSjcem4/AV1PLU7Mhw3Kp6Q+yVzJJ4ns9BM=; b=P697w6T1yZ2hlCa49cEj5TLjdwE1nSWZTWT7xqxqaDbocIo+MjZQn9FN5vyIOJpeOXEbBlf3Wl7h88XFyDZV6DLptWxJ4rATgnb4BuwNNf3uyB49cCZXf6PFacL7eFAYtVK/XBL2vX0i1ibY2IxbhNzX2Tyt5htx9ovR/4CXM8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948816488184.02816182214224; Tue, 6 Aug 2024 05:53:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgr-0001o0-Gt; Tue, 06 Aug 2024 08:53:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgb-0000a2-4l for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:10 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgY-0008Tj-6E for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:08 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-52efa9500e0so769487e87.3 for ; Tue, 06 Aug 2024 05:53:04 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9c61575sm546609166b.92.2024.08.06.05.53.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948782; x=1723553582; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H8NieMjgzSjcem4/AV1PLU7Mhw3Kp6Q+yVzJJ4ns9BM=; b=vVMVw1PF5DwGxB5+jtlJXwZyyqYZ45qkqK5SEA3nmWLp8ggU/A07PTsiKQqzq1PVC8 mMbfpIUQU/7AQ1gBz4wD3jrGbNWdQkyLZq2Jm8V2kVwHco5QldxtWQnHfxvnIh7z/aCA yHq9l+hvnOHbl3zx0Y1UEQvo2ya0MwWSEXh3/4Ae7wKobf00opvOYVHj/HdF/uCUR8Ul f1E+jVFb5gD8a2sZBti80BRY7b1vsIIClFk5DDnVbsXxQooUut51s5NTjOJVAH02nCe4 U2Wdy95ib01MmIBvVZb0MvD28ZtahdX8+ysqqvDKdTUCQkYYwRIyoZ/8a9lP9WVi5QuM 9I1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948782; x=1723553582; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H8NieMjgzSjcem4/AV1PLU7Mhw3Kp6Q+yVzJJ4ns9BM=; b=V3eKxIPdci2SmKO6ngCLRePBsPPh5vnpIqgh1iO4vPo54EwwOH9GHvrkkoIJi/xEY+ QJ2s+w8Z0haKB/0smKPSCWXOg13RoTTKPcZnVXIq0zohafJUbZkl1OjcectpTdGrb0ML kv9mF49HeKvyFioTOxlQgzhGBnsXJjGaZQqtJ1TYWM0X+hEEJ3kFGN6GwSYQjXk4x8ZP YYhlo5wqBmrhTZLua4CE0Q3lCJqa1tzknJHn1vyJmsuKen1JJk+Itb/wv40tPzKJFc+Y wAJfWaqIS77L6DVwq7oNgm/y7ouXAov55YeD1yM9chga9p4KCJNTAbB9jGMlZXDStwVS fY1w== X-Gm-Message-State: AOJu0YyuyB6/Hasz3CIt1Kby5paL0V/5EA8lG9Ux9A20suOBGSRkOhAB VkhAecFXT2FD7SgzTU8Tz+q3pBHgHBU8CsOXL5h/u5gajzy7ionSOg5tStSTNwuP8BnZrjtGb7O c X-Google-Smtp-Source: AGHT+IHjVZ0HfLp/SeamJ2fPShSNNluoG1+wZXgKtb/hnPmfEgbWQG1sKPY+SGbl6Qbp7/na5bRXDw== X-Received: by 2002:a05:6512:3ca5:b0:52c:de3a:839f with SMTP id 2adb3069b0e04-530bb36f2afmr8602574e87.20.1722948782411; Tue, 06 Aug 2024 05:53:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 10/28] hw/intc/loongson_ipi: Expose loongson_ipi_core_read/write helpers Date: Tue, 6 Aug 2024 14:51:38 +0200 Message-ID: <20240806125157.91185-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948817642116600 From: Bibo Mao In order to access loongson_ipi_core_read/write helpers from loongson_ipi_common.c in the next commit, make their prototype declaration public. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-11-philmd@linaro.org> --- include/hw/intc/loongson_ipi_common.h | 6 ++++++ hw/intc/loongson_ipi.c | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongs= on_ipi_common.h index 8997676f0d..65f8ef7957 100644 --- a/include/hw/intc/loongson_ipi_common.h +++ b/include/hw/intc/loongson_ipi_common.h @@ -10,6 +10,7 @@ =20 #include "qom/object.h" #include "hw/sysbus.h" +#include "exec/memattrs.h" =20 #define IPI_MBX_NUM 4 =20 @@ -44,6 +45,11 @@ struct LoongsonIPICommonClass { CPUState *(*cpu_by_arch_id)(int64_t id); }; =20 +MemTxResult loongson_ipi_core_readl(void *opaque, hwaddr addr, uint64_t *d= ata, + unsigned size, MemTxAttrs attrs); +MemTxResult loongson_ipi_core_writel(void *opaque, hwaddr addr, uint64_t v= al, + unsigned size, MemTxAttrs attrs); + /* Mainy used by iocsr read and write */ #define SMP_IPI_MAILBOX 0x1000ULL =20 diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 4a8e743528..c13cb5a1d2 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -24,9 +24,8 @@ #endif #include "trace.h" =20 -static MemTxResult loongson_ipi_core_readl(void *opaque, hwaddr addr, - uint64_t *data, - unsigned size, MemTxAttrs attrs) +MemTxResult loongson_ipi_core_readl(void *opaque, hwaddr addr, uint64_t *d= ata, + unsigned size, MemTxAttrs attrs) { IPICore *s =3D opaque; uint64_t ret =3D 0; @@ -165,9 +164,8 @@ static MemTxResult any_send(LoongsonIPICommonState *ipi, return send_ipi_data(ipi, cs, val, addr, attrs); } =20 -static MemTxResult loongson_ipi_core_writel(void *opaque, hwaddr addr, - uint64_t val, unsigned size, - MemTxAttrs attrs) +MemTxResult loongson_ipi_core_writel(void *opaque, hwaddr addr, uint64_t v= al, + unsigned size, MemTxAttrs attrs) { IPICore *s =3D opaque; LoongsonIPICommonState *ipi =3D s->ipi; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948881; cv=none; d=zohomail.com; s=zohoarc; b=WjXhP/v9XYIFlMczhMfwQPYZrdygDXDFvfdOls6YmK8DrZWJ9P2EaRaU10Zkb21hiFTZg2JsboakFHXv9achFkSNDhMF5pZGez/RAgj01XbanF/jG+xJwvhymN2xb0ZrZ0UyeHqtLBWS0zshlKZ3DUQhQruHFy+VzrB6i1kUqXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948881; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fVXH7TtXrVZxOC7TgTKdtLSEQnAvMfiUURH/wkuD2/0=; b=T+HXTO4knyUwaOmkYnogOHUfeCJcw8FutgJ4K/Qker4A+KuT5fkwHKi0/xG6JtYe0Wdpt6WvJ+vw+yVwc6cLS3F5fZ1IWt27FFuelSI31NwjNPkyIJujJ1hZg4/CM/puvS4dfsKRr60boDit9poTD+zrCF4unHLir/ShDT7evQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172294888109713.291975167844043; Tue, 6 Aug 2024 05:54:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgs-0001zJ-Hc; Tue, 06 Aug 2024 08:53:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgj-0001Cq-Bl for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:21 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgf-0008VN-8p for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:17 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5af6a1afa63so946620a12.0 for ; Tue, 06 Aug 2024 05:53:11 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b83c22db88sm5838766a12.95.2024.08.06.05.53.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948789; x=1723553589; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fVXH7TtXrVZxOC7TgTKdtLSEQnAvMfiUURH/wkuD2/0=; b=iAFFqXmgb0J97bu/2WZ3HMW9POPmV1aHhkovvWuYnhjQX4TSflS7ORKVVVgTzkYhQW ztDqQ0ivn9Ek8FSXl5QrwOOrusFQKjlNRgxR8f11frn/aGfbAIUPgdBOn0RQl25vLXs3 KwSizzi8z1/vHVMI2XowbHp4I5TxXEMbFF05YBcAbl35p8NhhHhpf0sGe2/G9kfPU1hH Qxrj5LdIhoFZ+o+e1P8DPNWQZXEryhTFpqUEk3hUT0gRms3AE2Uwluc+ynDoFv/IBIRq h8MvIMecKpqjGhGtAMUrh3dExWkowkf0NGZZ/jaQVkrDkvmtLIT7PwaoWTpLErwRGWGS onIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948789; x=1723553589; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fVXH7TtXrVZxOC7TgTKdtLSEQnAvMfiUURH/wkuD2/0=; b=v3MAjktmyxbkTrNjuANzNBvBsgyA5fYQim6J+ppLJHN+ctnECpJDl+BYLnil7q3mxD NC8js7UDrPtg91mqxmA0vNHs8wyFQ5FB/ndfMh9t8RWWOqksK6um0U5IKRdyyAl+dQrF Dngv5LH+utBRMp8LKJe6UGFg8BXxp/qIunoyYS8TeXq6LavFloZetEb2jgM1My9h8mJ7 bQpTKpHfiFY5zYcQAWwhIrGoYktTCkj2GLFiF3zAjSeLOoSmsLX1RCQqg3izgI4Igg6K cAcLTEay4xiDp1dHje+AlLarQ9rL8O+aSgX7MI2mvWdaMcpEOGinXBgbjJHOhtNZGWnD oHsg== X-Gm-Message-State: AOJu0YzRPFUMCsiZ1qcv31cornM5OnDLNhug3ZA74+77RFiKsniDW9f/ mU8CqqVoKX16qFQHWMEH7Bp4VgglFyy/sToEB0bYcJ/51K7cmpFKbv7crTpLBSREAo7fAakPY6x E X-Google-Smtp-Source: AGHT+IFoYa+s60W+/iNx2gnqzUUkxooxfTG4kZf5iiEcSLFDdqcCAUF4Fwdov8UCqWapmnVN8PcUxA== X-Received: by 2002:a05:6402:a50:b0:578:60a6:7c69 with SMTP id 4fb4d7f45d1cf-5b7f5413b46mr9672712a12.30.1722948789418; Tue, 06 Aug 2024 05:53:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 11/28] hw/intc/loongson_ipi: Move common code to loongson_ipi_common.c Date: Tue, 6 Aug 2024 14:51:39 +0200 Message-ID: <20240806125157.91185-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948881931116600 From: Bibo Mao Move the common code from loongson_ipi.c to loongson_ipi_common.c, call parent_realize() instead of loongson_ipi_common_realize() in loongson_ipi_realize(). Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-12-philmd@linaro.org> --- include/hw/intc/loongson_ipi_common.h | 2 + hw/intc/loongson_ipi.c | 279 +------------------------ hw/intc/loongson_ipi_common.c | 283 ++++++++++++++++++++++++++ 3 files changed, 289 insertions(+), 275 deletions(-) diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongs= on_ipi_common.h index 65f8ef7957..df9d9c5168 100644 --- a/include/hw/intc/loongson_ipi_common.h +++ b/include/hw/intc/loongson_ipi_common.h @@ -41,6 +41,8 @@ struct LoongsonIPICommonState { struct LoongsonIPICommonClass { SysBusDeviceClass parent_class; =20 + DeviceRealize parent_realize; + DeviceUnrealize parent_unrealize; AddressSpace *(*get_iocsr_as)(CPUState *cpu); CPUState *(*cpu_by_arch_id)(int64_t id); }; diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index c13cb5a1d2..0b88ae3230 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -24,56 +24,6 @@ #endif #include "trace.h" =20 -MemTxResult loongson_ipi_core_readl(void *opaque, hwaddr addr, uint64_t *d= ata, - unsigned size, MemTxAttrs attrs) -{ - IPICore *s =3D opaque; - uint64_t ret =3D 0; - int index =3D 0; - - addr &=3D 0xff; - switch (addr) { - case CORE_STATUS_OFF: - ret =3D s->status; - break; - case CORE_EN_OFF: - ret =3D s->en; - break; - case CORE_SET_OFF: - ret =3D 0; - break; - case CORE_CLEAR_OFF: - ret =3D 0; - break; - case CORE_BUF_20 ... CORE_BUF_38 + 4: - index =3D (addr - CORE_BUF_20) >> 2; - ret =3D s->buf[index]; - break; - default: - qemu_log_mask(LOG_UNIMP, "invalid read: %x", (uint32_t)addr); - break; - } - - trace_loongson_ipi_read(size, (uint64_t)addr, ret); - *data =3D ret; - return MEMTX_OK; -} - -static MemTxResult loongson_ipi_iocsr_readl(void *opaque, hwaddr addr, - uint64_t *data, - unsigned size, MemTxAttrs attr= s) -{ - LoongsonIPICommonState *ipi =3D opaque; - IPICore *s; - - if (attrs.requester_id >=3D ipi->num_cpu) { - return MEMTX_DECODE_ERROR; - } - - s =3D &ipi->cpu[attrs.requester_id]; - return loongson_ipi_core_readl(s, addr, data, size, attrs); -} - #ifdef TARGET_LOONGARCH64 static AddressSpace *get_iocsr_as(CPUState *cpu) { @@ -92,148 +42,6 @@ static AddressSpace *get_iocsr_as(CPUState *cpu) } #endif =20 -static MemTxResult send_ipi_data(LoongsonIPICommonState *ipi, CPUState *cp= u, - uint64_t val, hwaddr addr, MemTxAttrs att= rs) -{ - LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); - int i, mask =3D 0, data =3D 0; - AddressSpace *iocsr_as =3D licc->get_iocsr_as(cpu); - - if (!iocsr_as) { - return MEMTX_DECODE_ERROR; - } - - /* - * bit 27-30 is mask for byte writing, - * if the mask is 0, we need not to do anything. - */ - if ((val >> 27) & 0xf) { - data =3D address_space_ldl_le(iocsr_as, addr, attrs, NULL); - for (i =3D 0; i < 4; i++) { - /* get mask for byte writing */ - if (val & (0x1 << (27 + i))) { - mask |=3D 0xff << (i * 8); - } - } - } - - data &=3D mask; - data |=3D (val >> 32) & ~mask; - address_space_stl_le(iocsr_as, addr, data, attrs, NULL); - - return MEMTX_OK; -} - -static MemTxResult mail_send(LoongsonIPICommonState *ipi, - uint64_t val, MemTxAttrs attrs) -{ - LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); - uint32_t cpuid; - hwaddr addr; - CPUState *cs; - - cpuid =3D extract32(val, 16, 10); - cs =3D licc->cpu_by_arch_id(cpuid); - if (cs =3D=3D NULL) { - return MEMTX_DECODE_ERROR; - } - - /* override requester_id */ - addr =3D SMP_IPI_MAILBOX + CORE_BUF_20 + (val & 0x1c); - attrs.requester_id =3D cs->cpu_index; - return send_ipi_data(ipi, cs, val, addr, attrs); -} - -static MemTxResult any_send(LoongsonIPICommonState *ipi, - uint64_t val, MemTxAttrs attrs) -{ - LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); - uint32_t cpuid; - hwaddr addr; - CPUState *cs; - - cpuid =3D extract32(val, 16, 10); - cs =3D licc->cpu_by_arch_id(cpuid); - if (cs =3D=3D NULL) { - return MEMTX_DECODE_ERROR; - } - - /* override requester_id */ - addr =3D val & 0xffff; - attrs.requester_id =3D cs->cpu_index; - return send_ipi_data(ipi, cs, val, addr, attrs); -} - -MemTxResult loongson_ipi_core_writel(void *opaque, hwaddr addr, uint64_t v= al, - unsigned size, MemTxAttrs attrs) -{ - IPICore *s =3D opaque; - LoongsonIPICommonState *ipi =3D s->ipi; - LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); - int index =3D 0; - uint32_t cpuid; - uint8_t vector; - CPUState *cs; - - addr &=3D 0xff; - trace_loongson_ipi_write(size, (uint64_t)addr, val); - switch (addr) { - case CORE_STATUS_OFF: - qemu_log_mask(LOG_GUEST_ERROR, "can not be written"); - break; - case CORE_EN_OFF: - s->en =3D val; - break; - case CORE_SET_OFF: - s->status |=3D val; - if (s->status !=3D 0 && (s->status & s->en) !=3D 0) { - qemu_irq_raise(s->irq); - } - break; - case CORE_CLEAR_OFF: - s->status &=3D ~val; - if (s->status =3D=3D 0 && s->en !=3D 0) { - qemu_irq_lower(s->irq); - } - break; - case CORE_BUF_20 ... CORE_BUF_38 + 4: - index =3D (addr - CORE_BUF_20) >> 2; - s->buf[index] =3D val; - break; - case IOCSR_IPI_SEND: - cpuid =3D extract32(val, 16, 10); - /* IPI status vector */ - vector =3D extract8(val, 0, 5); - cs =3D licc->cpu_by_arch_id(cpuid); - if (cs =3D=3D NULL || cs->cpu_index >=3D ipi->num_cpu) { - return MEMTX_DECODE_ERROR; - } - loongson_ipi_core_writel(&ipi->cpu[cs->cpu_index], CORE_SET_OFF, - BIT(vector), 4, attrs); - break; - default: - qemu_log_mask(LOG_UNIMP, "invalid write: %x", (uint32_t)addr); - break; - } - - return MEMTX_OK; -} - -static MemTxResult loongson_ipi_iocsr_writel(void *opaque, hwaddr addr, - uint64_t val, unsigned size, - MemTxAttrs attrs) -{ - LoongsonIPICommonState *ipi =3D opaque; - IPICore *s; - - if (attrs.requester_id >=3D ipi->num_cpu) { - return MEMTX_DECODE_ERROR; - } - - s =3D &ipi->cpu[attrs.requester_id]; - return loongson_ipi_core_writel(s, addr, val, size, attrs); -} - static const MemoryRegionOps loongson_ipi_core_ops =3D { .read_with_attrs =3D loongson_ipi_core_readl, .write_with_attrs =3D loongson_ipi_core_writel, @@ -244,88 +52,15 @@ static const MemoryRegionOps loongson_ipi_core_ops =3D= { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -static const MemoryRegionOps loongson_ipi_iocsr_ops =3D { - .read_with_attrs =3D loongson_ipi_iocsr_readl, - .write_with_attrs =3D loongson_ipi_iocsr_writel, - .impl.min_access_size =3D 4, - .impl.max_access_size =3D 4, - .valid.min_access_size =3D 4, - .valid.max_access_size =3D 8, - .endianness =3D DEVICE_LITTLE_ENDIAN, -}; - -/* mail send and any send only support writeq */ -static MemTxResult loongson_ipi_writeq(void *opaque, hwaddr addr, uint64_t= val, - unsigned size, MemTxAttrs attrs) -{ - LoongsonIPICommonState *ipi =3D opaque; - MemTxResult ret =3D MEMTX_OK; - - addr &=3D 0xfff; - switch (addr) { - case MAIL_SEND_OFFSET: - ret =3D mail_send(ipi, val, attrs); - break; - case ANY_SEND_OFFSET: - ret =3D any_send(ipi, val, attrs); - break; - default: - break; - } - - return ret; -} - -static const MemoryRegionOps loongson_ipi64_ops =3D { - .write_with_attrs =3D loongson_ipi_writeq, - .impl.min_access_size =3D 8, - .impl.max_access_size =3D 8, - .valid.min_access_size =3D 8, - .valid.max_access_size =3D 8, - .endianness =3D DEVICE_LITTLE_ENDIAN, -}; - -static void loongson_ipi_common_realize(DeviceState *dev, Error **errp) -{ - LoongsonIPICommonState *s =3D LOONGSON_IPI_COMMON(dev); - SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); - int i; - - if (s->num_cpu =3D=3D 0) { - error_setg(errp, "num-cpu must be at least 1"); - return; - } - - memory_region_init_io(&s->ipi_iocsr_mem, OBJECT(dev), - &loongson_ipi_iocsr_ops, - s, "loongson_ipi_iocsr", 0x48); - - /* loongson_ipi_iocsr performs re-entrant IO through ipi_send */ - s->ipi_iocsr_mem.disable_reentrancy_guard =3D true; - - sysbus_init_mmio(sbd, &s->ipi_iocsr_mem); - - memory_region_init_io(&s->ipi64_iocsr_mem, OBJECT(dev), - &loongson_ipi64_ops, - s, "loongson_ipi64_iocsr", 0x118); - sysbus_init_mmio(sbd, &s->ipi64_iocsr_mem); - - s->cpu =3D g_new0(IPICore, s->num_cpu); - for (i =3D 0; i < s->num_cpu; i++) { - s->cpu[i].ipi =3D s; - - qdev_init_gpio_out(dev, &s->cpu[i].irq, 1); - } -} - static void loongson_ipi_realize(DeviceState *dev, Error **errp) { LoongsonIPICommonState *sc =3D LOONGSON_IPI_COMMON(dev); LoongsonIPIState *s =3D LOONGSON_IPI(dev); + LoongsonIPIClass *lic =3D LOONGSON_IPI_GET_CLASS(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); Error *local_err =3D NULL; =20 - loongson_ipi_common_realize(dev, &local_err); + lic->parent_realize(dev, &local_err); if (local_err) { error_propagate(errp, local_err); return; @@ -341,20 +76,14 @@ static void loongson_ipi_realize(DeviceState *dev, Err= or **errp) } } =20 -static void loongson_ipi_common_unrealize(DeviceState *dev) -{ - LoongsonIPICommonState *s =3D LOONGSON_IPI_COMMON(dev); - - g_free(s->cpu); -} - static void loongson_ipi_unrealize(DeviceState *dev) { LoongsonIPIState *s =3D LOONGSON_IPI(dev); + LoongsonIPIClass *k =3D LOONGSON_IPI_GET_CLASS(dev); =20 g_free(s->ipi_mmio_mem); =20 - loongson_ipi_common_unrealize(dev); + k->parent_unrealize(dev); } =20 static void loongson_ipi_class_init(ObjectClass *klass, void *data) diff --git a/hw/intc/loongson_ipi_common.c b/hw/intc/loongson_ipi_common.c index 47796f7ece..a6ce0181f6 100644 --- a/hw/intc/loongson_ipi_common.c +++ b/hw/intc/loongson_ipi_common.c @@ -8,8 +8,286 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" #include "hw/intc/loongson_ipi_common.h" +#include "hw/irq.h" #include "hw/qdev-properties.h" +#include "qapi/error.h" +#include "qemu/log.h" #include "migration/vmstate.h" +#include "trace.h" + +MemTxResult loongson_ipi_core_readl(void *opaque, hwaddr addr, uint64_t *d= ata, + unsigned size, MemTxAttrs attrs) +{ + IPICore *s =3D opaque; + uint64_t ret =3D 0; + int index =3D 0; + + addr &=3D 0xff; + switch (addr) { + case CORE_STATUS_OFF: + ret =3D s->status; + break; + case CORE_EN_OFF: + ret =3D s->en; + break; + case CORE_SET_OFF: + ret =3D 0; + break; + case CORE_CLEAR_OFF: + ret =3D 0; + break; + case CORE_BUF_20 ... CORE_BUF_38 + 4: + index =3D (addr - CORE_BUF_20) >> 2; + ret =3D s->buf[index]; + break; + default: + qemu_log_mask(LOG_UNIMP, "invalid read: %x", (uint32_t)addr); + break; + } + + trace_loongson_ipi_read(size, (uint64_t)addr, ret); + *data =3D ret; + + return MEMTX_OK; +} + +static MemTxResult loongson_ipi_iocsr_readl(void *opaque, hwaddr addr, + uint64_t *data, unsigned size, + MemTxAttrs attrs) +{ + LoongsonIPICommonState *ipi =3D opaque; + IPICore *s; + + if (attrs.requester_id >=3D ipi->num_cpu) { + return MEMTX_DECODE_ERROR; + } + + s =3D &ipi->cpu[attrs.requester_id]; + return loongson_ipi_core_readl(s, addr, data, size, attrs); +} + +static MemTxResult send_ipi_data(LoongsonIPICommonState *ipi, CPUState *cp= u, + uint64_t val, hwaddr addr, MemTxAttrs att= rs) +{ + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); + int i, mask =3D 0, data =3D 0; + AddressSpace *iocsr_as =3D licc->get_iocsr_as(cpu); + + if (!iocsr_as) { + return MEMTX_DECODE_ERROR; + } + + /* + * bit 27-30 is mask for byte writing, + * if the mask is 0, we need not to do anything. + */ + if ((val >> 27) & 0xf) { + data =3D address_space_ldl_le(iocsr_as, addr, attrs, NULL); + for (i =3D 0; i < 4; i++) { + /* get mask for byte writing */ + if (val & (0x1 << (27 + i))) { + mask |=3D 0xff << (i * 8); + } + } + } + + data &=3D mask; + data |=3D (val >> 32) & ~mask; + address_space_stl_le(iocsr_as, addr, data, attrs, NULL); + + return MEMTX_OK; +} + +static MemTxResult mail_send(LoongsonIPICommonState *ipi, + uint64_t val, MemTxAttrs attrs) +{ + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); + uint32_t cpuid; + hwaddr addr; + CPUState *cs; + + cpuid =3D extract32(val, 16, 10); + cs =3D licc->cpu_by_arch_id(cpuid); + if (cs =3D=3D NULL) { + return MEMTX_DECODE_ERROR; + } + + /* override requester_id */ + addr =3D SMP_IPI_MAILBOX + CORE_BUF_20 + (val & 0x1c); + attrs.requester_id =3D cs->cpu_index; + return send_ipi_data(ipi, cs, val, addr, attrs); +} + +static MemTxResult any_send(LoongsonIPICommonState *ipi, + uint64_t val, MemTxAttrs attrs) +{ + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); + uint32_t cpuid; + hwaddr addr; + CPUState *cs; + + cpuid =3D extract32(val, 16, 10); + cs =3D licc->cpu_by_arch_id(cpuid); + if (cs =3D=3D NULL) { + return MEMTX_DECODE_ERROR; + } + + /* override requester_id */ + addr =3D val & 0xffff; + attrs.requester_id =3D cs->cpu_index; + return send_ipi_data(ipi, cs, val, addr, attrs); +} + +MemTxResult loongson_ipi_core_writel(void *opaque, hwaddr addr, uint64_t v= al, + unsigned size, MemTxAttrs attrs) +{ + IPICore *s =3D opaque; + LoongsonIPICommonState *ipi =3D s->ipi; + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_GET_CLASS(ipi); + int index =3D 0; + uint32_t cpuid; + uint8_t vector; + CPUState *cs; + + addr &=3D 0xff; + trace_loongson_ipi_write(size, (uint64_t)addr, val); + switch (addr) { + case CORE_STATUS_OFF: + qemu_log_mask(LOG_GUEST_ERROR, "can not be written"); + break; + case CORE_EN_OFF: + s->en =3D val; + break; + case CORE_SET_OFF: + s->status |=3D val; + if (s->status !=3D 0 && (s->status & s->en) !=3D 0) { + qemu_irq_raise(s->irq); + } + break; + case CORE_CLEAR_OFF: + s->status &=3D ~val; + if (s->status =3D=3D 0 && s->en !=3D 0) { + qemu_irq_lower(s->irq); + } + break; + case CORE_BUF_20 ... CORE_BUF_38 + 4: + index =3D (addr - CORE_BUF_20) >> 2; + s->buf[index] =3D val; + break; + case IOCSR_IPI_SEND: + cpuid =3D extract32(val, 16, 10); + /* IPI status vector */ + vector =3D extract8(val, 0, 5); + cs =3D licc->cpu_by_arch_id(cpuid); + if (cs =3D=3D NULL || cs->cpu_index >=3D ipi->num_cpu) { + return MEMTX_DECODE_ERROR; + } + loongson_ipi_core_writel(&ipi->cpu[cs->cpu_index], CORE_SET_OFF, + BIT(vector), 4, attrs); + break; + default: + qemu_log_mask(LOG_UNIMP, "invalid write: %x", (uint32_t)addr); + break; + } + + return MEMTX_OK; +} + +static MemTxResult loongson_ipi_iocsr_writel(void *opaque, hwaddr addr, + uint64_t val, unsigned size, + MemTxAttrs attrs) +{ + LoongsonIPICommonState *ipi =3D opaque; + IPICore *s; + + if (attrs.requester_id >=3D ipi->num_cpu) { + return MEMTX_DECODE_ERROR; + } + + s =3D &ipi->cpu[attrs.requester_id]; + return loongson_ipi_core_writel(s, addr, val, size, attrs); +} + +static const MemoryRegionOps loongson_ipi_iocsr_ops =3D { + .read_with_attrs =3D loongson_ipi_iocsr_readl, + .write_with_attrs =3D loongson_ipi_iocsr_writel, + .impl.min_access_size =3D 4, + .impl.max_access_size =3D 4, + .valid.min_access_size =3D 4, + .valid.max_access_size =3D 8, + .endianness =3D DEVICE_LITTLE_ENDIAN, +}; + +/* mail send and any send only support writeq */ +static MemTxResult loongson_ipi_writeq(void *opaque, hwaddr addr, uint64_t= val, + unsigned size, MemTxAttrs attrs) +{ + LoongsonIPICommonState *ipi =3D opaque; + MemTxResult ret =3D MEMTX_OK; + + addr &=3D 0xfff; + switch (addr) { + case MAIL_SEND_OFFSET: + ret =3D mail_send(ipi, val, attrs); + break; + case ANY_SEND_OFFSET: + ret =3D any_send(ipi, val, attrs); + break; + default: + break; + } + + return ret; +} + +static const MemoryRegionOps loongson_ipi64_ops =3D { + .write_with_attrs =3D loongson_ipi_writeq, + .impl.min_access_size =3D 8, + .impl.max_access_size =3D 8, + .valid.min_access_size =3D 8, + .valid.max_access_size =3D 8, + .endianness =3D DEVICE_LITTLE_ENDIAN, +}; + +static void loongson_ipi_common_realize(DeviceState *dev, Error **errp) +{ + LoongsonIPICommonState *s =3D LOONGSON_IPI_COMMON(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); + int i; + + if (s->num_cpu =3D=3D 0) { + error_setg(errp, "num-cpu must be at least 1"); + return; + } + + memory_region_init_io(&s->ipi_iocsr_mem, OBJECT(dev), + &loongson_ipi_iocsr_ops, + s, "loongson_ipi_iocsr", 0x48); + + /* loongson_ipi_iocsr performs re-entrant IO through ipi_send */ + s->ipi_iocsr_mem.disable_reentrancy_guard =3D true; + + sysbus_init_mmio(sbd, &s->ipi_iocsr_mem); + + memory_region_init_io(&s->ipi64_iocsr_mem, OBJECT(dev), + &loongson_ipi64_ops, + s, "loongson_ipi64_iocsr", 0x118); + sysbus_init_mmio(sbd, &s->ipi64_iocsr_mem); + + s->cpu =3D g_new0(IPICore, s->num_cpu); + for (i =3D 0; i < s->num_cpu; i++) { + s->cpu[i].ipi =3D s; + + qdev_init_gpio_out(dev, &s->cpu[i].irq, 1); + } +} + +static void loongson_ipi_common_unrealize(DeviceState *dev) +{ + LoongsonIPICommonState *s =3D LOONGSON_IPI_COMMON(dev); + + g_free(s->cpu); +} =20 static const VMStateDescription vmstate_ipi_core =3D { .name =3D "ipi-single", @@ -45,7 +323,12 @@ static Property ipi_common_properties[] =3D { static void loongson_ipi_common_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_CLASS(klass); =20 + device_class_set_parent_realize(dc, loongson_ipi_common_realize, + &licc->parent_realize); + device_class_set_parent_unrealize(dc, loongson_ipi_common_unrealize, + &licc->parent_unrealize); device_class_set_props(dc, ipi_common_properties); dc->vmsd =3D &vmstate_loongson_ipi_common; } --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948815; cv=none; d=zohomail.com; s=zohoarc; b=DQHmQHS5BgZOXptU1dVTNC0ESiys2Ca5WjF5GTn68+SNz3Z3cQ4A+mt+gOQ9tcSroWdt2Oh3GdjYPgOnr53kqOPTZvSg+RU9934Fb/yjX133NhoC5xfE0/Nq8Ude6gt9fX0d4/0LHHATM2C1dThyCwX+xj609aIkUS9cUcU/ypM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948815; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=U580Wrx23+PhRsFUSNYJ7VRxWznSc+VPsbnAWBKD3bQ=; b=dhJabTrYDe9sBki9qTJ++sM7gEXkBdSF39Lt0rndGB6ogLoq7xaHt/JbFKWmr9Xij6LLajSnNKx6Z1eGQYygk9x2fH78/cTa226htecGE/whkHixtOdjQwXmjVzbp/vVVFohPWZDFAppJxBf8BH8w5is0D9JB44Jagy+XGhhto8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948815168438.3953845705653; Tue, 6 Aug 2024 05:53:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgt-0002Dd-TO; Tue, 06 Aug 2024 08:53:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgm-0001QQ-N6 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:23 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgk-00004q-DM for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:20 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-52fc4388a64so755589e87.1 for ; Tue, 06 Aug 2024 05:53:17 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d433fesm553882366b.142.2024.08.06.05.53.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948796; x=1723553596; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U580Wrx23+PhRsFUSNYJ7VRxWznSc+VPsbnAWBKD3bQ=; b=sDqRb/RbBX0jVhU208EUXKra82bsALAL6DeXOUAFDWNxuFsF02JR6Ys9g5DGSgDUu4 uDE5ZADoiJ/LJUH38wVHQiRiHcH1s/6hnqmTaSwlUyrEFAE/YbHSnCl3smBDDvQFbbab mDYpYl0iroYvywYFzaKMiBmOXicTnsNwac39haFHBcCRGS24c0M43OdcQMWPHikxY9K8 b46ZavsqnVYuGiiWMrcS3jen6wSUMB7MCYj9ukSj0RRVA001mIBolZLjTMaZut26wgCC xG8d9nPsMNKDw4xvR4/FxxSuhYMqX4Pswoy7F+KslvHUlrEvoAgA5hF1VNERUtIe6Y46 UDjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948796; x=1723553596; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U580Wrx23+PhRsFUSNYJ7VRxWznSc+VPsbnAWBKD3bQ=; b=DqBny5W78Y9Hb02rctLYXkcYtIq/NCFvqvyLI/NDo9A0umdXwrKYYQd6i135gHjwpE RA0T+CxQf8JpskJ3o7qYythtQVwbEKnX9d3XqTcXK33BVY0X0FL2n8mCppzBhP8QNi+h Dc8/EapvA4IZW3KcUbZj8dJP3i7Ra0ANA1+sBVP4G/pzTNyMMOfhUceAXTITrp0CtOAk YGhoY0V9yhyqyKYjxs2R6DD91IXLEkUkqTvtfOqyv3bgEoyjpKlT1fVMqvtOZCdEKL3W YlB5wzqnkkeSUG1d6Z86rQqC5Xl664KbGNkrTpse9MjZ+WIySW5U/ZY3b8nwYoDYSYT3 eGCQ== X-Gm-Message-State: AOJu0YxX+8YrWpj9+JJWMUs3N7SFKO7f4s9UcbZMSIxyrImefeFh7ljy hcmS9pAkJspwBs17c16J6LZQGNcEbcexC+eC9lkdBt41m5gijpzYDDRDQxfjLDvgOU4MC/yIjOv I X-Google-Smtp-Source: AGHT+IEj9N4cn5WwXBmjwWcidUZC8CWdQYZBhYpacbwWDzAyx2zcWNoXFTylRkL1biBANRw9Aa9FtA== X-Received: by 2002:a05:6512:3b8b:b0:530:ae0d:9fc8 with SMTP id 2adb3069b0e04-530bb36b6bcmr11186553e87.2.1722948795857; Tue, 06 Aug 2024 05:53:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 12/28] hw/intc/loongarch_ipi: Add loongarch IPI support Date: Tue, 6 Aug 2024 14:51:40 +0200 Message-ID: <20240806125157.91185-13-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948815497116600 From: Bibo Mao Loongarch IPI is added here, it inherits from class TYPE_LOONGSON_IPI_COMMON, and two interfaces get_iocsr_as() and cpu_by_arch_id() are added for Loongarch 3A5000 machine. It can be used when ipi is emulated in userspace with KVM mode. Signed-off-by: Bibo Mao [PMD: Rebased and simplified] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-13-philmd@linaro.org> --- include/hw/intc/loongarch_ipi.h | 25 ++++++++++++ hw/intc/loongarch_ipi.c | 68 +++++++++++++++++++++++++++++++++ hw/intc/Kconfig | 4 ++ hw/intc/meson.build | 1 + 4 files changed, 98 insertions(+) create mode 100644 include/hw/intc/loongarch_ipi.h create mode 100644 hw/intc/loongarch_ipi.c diff --git a/include/hw/intc/loongarch_ipi.h b/include/hw/intc/loongarch_ip= i.h new file mode 100644 index 0000000000..276b3040a3 --- /dev/null +++ b/include/hw/intc/loongarch_ipi.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * LoongArch IPI interrupt header files + * + * Copyright (C) 2024 Loongson Technology Corporation Limited + */ + +#ifndef HW_LOONGARCH_IPI_H +#define HW_LOONGARCH_IPI_H + +#include "qom/object.h" +#include "hw/intc/loongson_ipi_common.h" + +#define TYPE_LOONGARCH_IPI "loongarch_ipi" +OBJECT_DECLARE_TYPE(LoongarchIPIState, LoongarchIPIClass, LOONGARCH_IPI) + +struct LoongarchIPIState { + LoongsonIPICommonState parent_obj; +}; + +struct LoongarchIPIClass { + LoongsonIPICommonClass parent_class; +}; + +#endif diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c new file mode 100644 index 0000000000..2ae1a42c46 --- /dev/null +++ b/hw/intc/loongarch_ipi.c @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * LoongArch IPI interrupt support + * + * Copyright (C) 2024 Loongson Technology Corporation Limited + */ + +#include "qemu/osdep.h" +#include "hw/boards.h" +#include "hw/intc/loongarch_ipi.h" +#include "target/loongarch/cpu.h" + +static AddressSpace *get_iocsr_as(CPUState *cpu) +{ + return LOONGARCH_CPU(cpu)->env.address_space_iocsr; +} + +static int archid_cmp(const void *a, const void *b) +{ + CPUArchId *archid_a =3D (CPUArchId *)a; + CPUArchId *archid_b =3D (CPUArchId *)b; + + return archid_a->arch_id - archid_b->arch_id; +} + +static CPUArchId *find_cpu_by_archid(MachineState *ms, uint32_t id) +{ + CPUArchId apic_id, *found_cpu; + + apic_id.arch_id =3D id; + found_cpu =3D bsearch(&apic_id, ms->possible_cpus->cpus, + ms->possible_cpus->len, + sizeof(*ms->possible_cpus->cpus), + archid_cmp); + + return found_cpu; +} + +static CPUState *loongarch_cpu_by_arch_id(int64_t arch_id) +{ + MachineState *machine =3D MACHINE(qdev_get_machine()); + CPUArchId *archid; + + archid =3D find_cpu_by_archid(machine, arch_id); + if (archid) { + return CPU(archid->cpu); + } + + return NULL; +} + +static void loongarch_ipi_class_init(ObjectClass *klass, void *data) +{ + LoongsonIPICommonClass *licc =3D LOONGSON_IPI_COMMON_CLASS(klass); + + licc->get_iocsr_as =3D get_iocsr_as; + licc->cpu_by_arch_id =3D loongarch_cpu_by_arch_id; +} + +static const TypeInfo loongarch_ipi_types[] =3D { + { + .name =3D TYPE_LOONGARCH_IPI, + .parent =3D TYPE_LOONGSON_IPI_COMMON, + .class_init =3D loongarch_ipi_class_init, + } +}; + +DEFINE_TYPES(loongarch_ipi_types) diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig index a2a0fdca85..dd405bdb5d 100644 --- a/hw/intc/Kconfig +++ b/hw/intc/Kconfig @@ -94,6 +94,10 @@ config LOONGSON_IPI bool select LOONGSON_IPI_COMMON =20 +config LOONGARCH_IPI + bool + select LOONGSON_IPI_COMMON + config LOONGARCH_PCH_PIC bool select UNIMP diff --git a/hw/intc/meson.build b/hw/intc/meson.build index a09a527207..f4d81eb8e4 100644 --- a/hw/intc/meson.build +++ b/hw/intc/meson.build @@ -71,6 +71,7 @@ specific_ss.add(when: ['CONFIG_KVM', 'CONFIG_XIVE'], specific_ss.add(when: 'CONFIG_M68K_IRQC', if_true: files('m68k_irqc.c')) specific_ss.add(when: 'CONFIG_LOONGSON_IPI_COMMON', if_true: files('loongs= on_ipi_common.c')) specific_ss.add(when: 'CONFIG_LOONGSON_IPI', if_true: files('loongson_ipi.= c')) +specific_ss.add(when: 'CONFIG_LOONGARCH_IPI', if_true: files('loongarch_ip= i.c')) specific_ss.add(when: 'CONFIG_LOONGARCH_PCH_PIC', if_true: files('loongarc= h_pch_pic.c')) specific_ss.add(when: 'CONFIG_LOONGARCH_PCH_MSI', if_true: files('loongarc= h_pch_msi.c')) specific_ss.add(when: 'CONFIG_LOONGARCH_EXTIOI', if_true: files('loongarch= _extioi.c')) --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949348; cv=none; d=zohomail.com; s=zohoarc; b=kGu2GCIaFVrL/EbmKqQRXdLrQ9txdKUvluqov4Mwl7r890yAStoAPSz1eY9MehI/ixJtImFJHrBflBxX11nIDBRUTBwanjoJAX87Z7vIERR8ZF7HoMxxt5hten0mrhSa0VmjYyIohFVyh+2bQWJG1uVDHk2UDp6uaran/DIwLS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949348; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=g8648z5sS/UfBnXQZvsAoQAWkk3MCJog805U1PXZhiE=; b=Tqx8Rz4hKZGpD9V7/bOYDrdMCLhD8RI5w5TvJ0RkCiDBfnquMEGsw70kTH3l261NTfflpuPwDBaHwbo3F3gJ5ryP2St6HfPxObbip7NVPAsDirW8M5flYzfbebz9SmJTfWuy4ah+L7C/w6ycmAgQh35c3UKFfQm0FrgClNEptrY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17229493482861013.9632175972388; Tue, 6 Aug 2024 06:02:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgu-0002TM-Py; Tue, 06 Aug 2024 08:53:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgt-00029E-4Y for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:27 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgq-00005O-Vf for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:26 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2eeb1ba0481so7796141fa.2 for ; Tue, 06 Aug 2024 05:53:24 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b83b7245f8sm5968354a12.74.2024.08.06.05.53.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948802; x=1723553602; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g8648z5sS/UfBnXQZvsAoQAWkk3MCJog805U1PXZhiE=; b=PyGmHIN5jDuMoklnCp783bN7iEKy/YDmLLsYURq5eYQDHKqK8ArfzVPzpmNAEDLh0V QRybU3aQDnQhbNfSgNAzljyou0+PjBt2rANWdM1LshMLARu2+sTheYlUReFbFWXpplig fuOw6vRhLEULjCUiEcucgANgSIcFnHtETUU7aKpubG6GCbaNU3ZmnBH1Wo6+dtafPtft EgSrVLslSIF0eTkPFwASHE8Hzx1w5qsNyCy/s2WdS4EI1q1pCGtp+llzGCVVRC137pq8 SkzSP2aLIA0g0fy86uzjLAuI6GsZfGUZTxoy5iqny1nAVmFGqyX5/zCch1V8ut4vQeG9 jocg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948802; x=1723553602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g8648z5sS/UfBnXQZvsAoQAWkk3MCJog805U1PXZhiE=; b=N6r7wp591t4l+L3bC7tvz6x3GX1555DS9A4jVISIZjuV+T3mp8T9uGaNThHYpoBrCU inys8aHaAwMLO70kV/SoeJ70ZqaF5oGarHm9EycnQcZ/7pKPglDMChSTQkAjibz/r/Ic qeX+ntWzM8ac1/RmhWYhItSBVY0xqv6S3PO6A1Ko9pkxDrKXdmtV0Sa7xTbHEcAyd1a4 kFJtuZ3AJ4YxSRU4f29rIaqTplIqsXhzGfdQ7ks5OG6gB89wLEH+S+J/kI5jRwdcBQvt jLWE6Sq8zAp//V1QvVPpk8gdksI4nCujHcGP7u2IQ31voTuv++1sTfHneD5vIoTjRnGu 9G6g== X-Gm-Message-State: AOJu0YwPRdy1WtGdlreeUvHA2xxL7T47RTnvOv7fazUvORSsVOwWk4xy QRVL2egbdtypejReJu4YqGtwUJiqwndCAxs0BiN1gnoR4n3ggXbkskfNjqW0WHAAZG+o1OEiBbj p X-Google-Smtp-Source: AGHT+IE10M0J/3bUj06b02NgS5GBKMCTvEQWAgYD/eoTa67AHR53VTtggkSNeA1IIrR2XnzzrS8JIw== X-Received: by 2002:a05:651c:112:b0:2ef:2c0f:283e with SMTP id 38308e7fff4ca-2f15aa95ca9mr97809021fa.12.1722948802073; Tue, 06 Aug 2024 05:53:22 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 13/28] hw/loongarch/virt: Replace Loongson IPI with LoongArch IPI Date: Tue, 6 Aug 2024 14:51:41 +0200 Message-ID: <20240806125157.91185-14-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949350180116600 From: Bibo Mao Loongarch IPI inherits from class LoongsonIPICommonClass, and it only contains Loongarch 3A5000 virt machine specific interfaces, rather than mix different machine implementations together. Signed-off-by: Bibo Mao [PMD: Rebased] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-14-philmd@linaro.org> --- include/hw/loongarch/virt.h | 1 - hw/loongarch/virt.c | 4 ++-- hw/loongarch/Kconfig | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h index 603c1cebdb..c373e48f27 100644 --- a/include/hw/loongarch/virt.h +++ b/include/hw/loongarch/virt.h @@ -11,7 +11,6 @@ #include "target/loongarch/cpu.h" #include "hw/boards.h" #include "qemu/queue.h" -#include "hw/intc/loongson_ipi.h" #include "hw/block/flash.h" #include "hw/loongarch/boot.h" =20 diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index e592b1b6b7..29040422aa 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -23,7 +23,7 @@ #include "net/net.h" #include "hw/loader.h" #include "elf.h" -#include "hw/intc/loongson_ipi.h" +#include "hw/intc/loongarch_ipi.h" #include "hw/intc/loongarch_extioi.h" #include "hw/intc/loongarch_pch_pic.h" #include "hw/intc/loongarch_pch_msi.h" @@ -788,7 +788,7 @@ static void virt_irq_init(LoongArchVirtMachineState *lv= ms) */ =20 /* Create IPI device */ - ipi =3D qdev_new(TYPE_LOONGSON_IPI); + ipi =3D qdev_new(TYPE_LOONGARCH_IPI); qdev_prop_set_uint32(ipi, "num-cpu", ms->smp.cpus); sysbus_realize_and_unref(SYS_BUS_DEVICE(ipi), &error_fatal); =20 diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig index 89be737726..0de713a439 100644 --- a/hw/loongarch/Kconfig +++ b/hw/loongarch/Kconfig @@ -12,7 +12,7 @@ config LOONGARCH_VIRT select SERIAL select VIRTIO_PCI select PLATFORM_BUS - select LOONGSON_IPI + select LOONGARCH_IPI select LOONGARCH_PCH_PIC select LOONGARCH_PCH_MSI select LOONGARCH_EXTIOI --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949358; cv=none; d=zohomail.com; s=zohoarc; b=Lo54yFTjEWpz/q+3a4diKopuqnQbrlaSDNvCNNHhe2AxM23w1fWfobXweOksaO61se51B2LXN12GbWYWknylg8oCC8UfcYvDSDoCGsV2JRZ/o5V+4XE8P3APNs3133b1okgqn9M2UMbtpEjRcR07T/D+BBAPReg0szfP0Dh4PPs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949358; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0bpORwStJfo7fInBvcfsQRF1HWEiefExBVhtYwf29qI=; b=iG4umThtrUYt247BlHkoOovp3EYediuWg3EwCoV2M9N0BOi1OXBbhOLAABDBkJr7n3b2mwUjocMzwc+I5quLvAlI7Hd91q194V/3ZJUtwA16pgaFbCDq5lcj8KGq6mnM8yMVnmz6UzNo67FKD0e+JlmRAkxL7UqrM4+BdD7V2UA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949357990753.2925037294996; Tue, 6 Aug 2024 06:02:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJh0-0003WL-Aj; Tue, 06 Aug 2024 08:53:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgy-00038p-A0 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:32 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgw-00005n-E4 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:31 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2f15790b472so7239011fa.0 for ; Tue, 06 Aug 2024 05:53:30 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bb9b99f19fsm205716a12.92.2024.08.06.05.53.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948808; x=1723553608; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0bpORwStJfo7fInBvcfsQRF1HWEiefExBVhtYwf29qI=; b=zxu9xYWR2rxrtW0ea5/o4cZkZJK77btRG+PCWsl2niA9KInqrALOrqrS+YZ+Jyg902 X3lI/tgMo0YdoiNJ/HTwas3tfpQZnyKDbF4vo2WpTJ2o6m+fnPOW6PZOSPGks2Iw2Sp/ B1bZ4ouoLxs9df7uHgIUxT6SPqP60wO+0nMn80ohYYBHdx9EIfPjtwtW2IVbGtubdxFS 1BwvXitFuFhJIJisznYgnNur0iBdAsr7HAeSwBY6w+5UhhWZhZ6mBotnNs6BCOfT8MLb VyEkK2AifAh63SGFi1ZoPP1ZTO5J7hO6MH/edK1O0QB795rRRhn5vXBWnDJqBph9JZzM 8sfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948808; x=1723553608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0bpORwStJfo7fInBvcfsQRF1HWEiefExBVhtYwf29qI=; b=nvixDsXTk3jsoIQ5VtGHWG3QJw++9u3gLJJYrnQnTPhLgbdzanXnD9NbsGHd8/6442 xFWMJqLbY2HY30/CIR4+bvpF5wfeXK5jNSPo89ve3WWjNfo2l71vEeHlwKMvgIwHN+4Z 7HYLQk5RRvcjsNYgAInA3xJ7O1eccuxyWoq0Tk4qZZPCYXiRGzF4yQQfQ1yVpQFcV32C ihpc1Q8M0epgZCsQ08WgxyS+22bpo3cspeR/eQ0CEkHl2vW2aoyUaugSaLz949A55ybk zVzITGzSIz1fBbdI5EVWg6DIiyIZsJogff/5AwHsbhUzQBxgRVHm2X1NKh4S3ADwH2Gm PtKQ== X-Gm-Message-State: AOJu0YwW+FXvyzFlqHtNyN5RqRMeXwWwXxmMNbOsKmCl0E6EvfN3iFk9 G0AQhYfvwtEEThatHI+LPGNgJN3ugvYDjw8kilvWgRfVoXm07afZ5WKhWo8vMvmDMstJrG3bmnY 3 X-Google-Smtp-Source: AGHT+IFjuF1V/aDmiKY4t9ahw7IjFocwRoXWQvTiR7zA28KAoYtvKKgH/MGIa5QVn7g5xXHttQ64mw== X-Received: by 2002:a2e:9dc8:0:b0:2ef:28ee:944 with SMTP id 38308e7fff4ca-2f15ab37fe2mr88881071fa.45.1722948808163; Tue, 06 Aug 2024 05:53:28 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 14/28] hw/intc/loongson_ipi: Restrict to MIPS Date: Tue, 6 Aug 2024 14:51:42 +0200 Message-ID: <20240806125157.91185-15-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=philmd@linaro.org; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949360152116600 From: Bibo Mao Now than LoongArch target can use the TYPE_LOONGARCH_IPI model, restrict TYPE_LOONGSON_IPI to MIPS. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-15-philmd@linaro.org> --- MAINTAINERS | 2 -- hw/intc/loongson_ipi.c | 14 -------------- 2 files changed, 16 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 5ca701cf0c..74a85360fd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1251,10 +1251,8 @@ F: hw/loongarch/ F: include/hw/loongarch/virt.h F: include/hw/intc/loongarch_*.h F: include/hw/intc/loongson_ipi_common.h -F: include/hw/intc/loongson_ipi.h F: hw/intc/loongarch_*.c F: hw/intc/loongson_ipi_common.c -F: hw/intc/loongson_ipi.c F: include/hw/pci-host/ls7a.h F: hw/rtc/ls7a_rtc.c F: gdb-xml/loongarch*.xml diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 0b88ae3230..8382ceca67 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -16,22 +16,9 @@ #include "exec/address-spaces.h" #include "exec/memory.h" #include "migration/vmstate.h" -#ifdef TARGET_LOONGARCH64 -#include "target/loongarch/cpu.h" -#endif -#ifdef TARGET_MIPS #include "target/mips/cpu.h" -#endif #include "trace.h" =20 -#ifdef TARGET_LOONGARCH64 -static AddressSpace *get_iocsr_as(CPUState *cpu) -{ - return LOONGARCH_CPU(cpu)->env.address_space_iocsr; -} -#endif - -#ifdef TARGET_MIPS static AddressSpace *get_iocsr_as(CPUState *cpu) { if (ase_lcsr_available(&MIPS_CPU(cpu)->env)) { @@ -40,7 +27,6 @@ static AddressSpace *get_iocsr_as(CPUState *cpu) =20 return NULL; } -#endif =20 static const MemoryRegionOps loongson_ipi_core_ops =3D { .read_with_attrs =3D loongson_ipi_core_readl, --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948883; cv=none; d=zohomail.com; s=zohoarc; b=RasKFnOjaWRJvx4Rk8j1jpSCBamZDQhuLbIXORuE/6/dpdSWLVhG9RYxFoJt8+spbwGDoGLbD+yykn/8nPOmYf89F9EF+5V+gdqKibSeT0JQId7loO4i/jzE2WgKzmxdp+HOOZsqSPUFEWObUZzlL+iaYnhJ71czPZCGF/6mxtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948883; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wBx0ReACLauBHHw6c0ZSc7DkdUMOkNRvc02ZcjHiRGU=; b=HMqihiWfD+RPYG/T+8NNMd6G3DyQuK9/uPYFsnV7lkRSG6RguKQmeK8OyuY+LWUCfQwTvj6BpeDr318T0PtLSomfiPviHKytusp1GaZi1fifFyfYiX7d7pnfwegNvrZ7+47mN/MRD8ff2WnA5bAotk5zUewqobkEZZ+obiCW84Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948882952467.10984900814674; Tue, 6 Aug 2024 05:54:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJh5-0004Q5-HN; Tue, 06 Aug 2024 08:53:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJh3-0004AO-VT for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:37 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJh2-00007e-2r for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:37 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a6135dso940252a12.1 for ; Tue, 06 Aug 2024 05:53:35 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d43920sm542964866b.102.2024.08.06.05.53.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948814; x=1723553614; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wBx0ReACLauBHHw6c0ZSc7DkdUMOkNRvc02ZcjHiRGU=; b=uuGn/DaCJgBRtNzbOAUHwN+KNLYRPbOjcfyGa4hCpdrwWyfrBIjRldzj7zrDCMS1Mh qjKJW0KnyiZRqOs2rTPmiYEi1tByWhs36tDW86LIF5q3ui6xcvxZC84Q6tb57BSAPoUg FKS8Ae+fTNqSnTSSe+eXwq3JZ07Rws3PheoNAdGqfF3Yy42WgoOn40pwUzv+jU57QMQi pPukO1Y+lVyY2ux2C7/wSR9c+ccY/MEBJXzBxGPhtLfFrPT3+cyKJlzQ9mVcBPAaSZse nlPwQ5kWj7n4Z3QVQAvDfyncaolExF5BKKBBXsRcJ4yF5nMxs5jkFk+3t18XXsxzPm3h GYtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948814; x=1723553614; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wBx0ReACLauBHHw6c0ZSc7DkdUMOkNRvc02ZcjHiRGU=; b=UxBN2Xew4HmJw4VshbaO+fX5K2dEKNuJjnEKq0hy65EWY8NEZR12UoPlJp32PjFr0Q Y7BQHr/oHPABbJmwIFL/3hkKVUMUDNg9r2qcdjKjYC0nuEHr0KUFlgRWgeACg6XAwkR5 Jfke3FG8yOHBP5071K4Doq6LkKt4BcdnVFzBjyMBmPD6ut/5w9eKLXhPcm8mXKA5vXbQ EE46uOR5v1Z1khngMLbgg5Q3c/LQhAPt6y8V2dQDK/0IpnALwOm8sjtTkrbGQlxbm0t9 OWnEzxaP0SwQL9gyAikFIZtsQqmX6q+q6fSN7CqKj/OSvmDY6xcIJMEwwjWDMsLh+fSh 7Yug== X-Gm-Message-State: AOJu0Yz3rsHiJuTgVxvSvuQzO5f4OVvtqJL2MQBovFJ+U9QPXV9WFj7a IS1LLXrbREKZcir8uknlc/UNkVoRIJ8e11zYo0g3RB3V3/qBL6wgQVBZ1EMrBSTdn3xi4zhuH0v T X-Google-Smtp-Source: AGHT+IFSW18A13ce5y8kMmwiWxT252fSEWj6zChLm1NGHFiOLmBxKqXWBI2Ou9wjNg/7YPWFS4LTTQ== X-Received: by 2002:a17:907:3f9d:b0:a7a:97ca:3059 with SMTP id a640c23a62f3a-a7dc4fbeb22mr1168855566b.34.1722948814075; Tue, 06 Aug 2024 05:53:34 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 15/28] hw/sd/sdcard: Explicit dummy byte value Date: Tue, 6 Aug 2024 14:51:43 +0200 Message-ID: <20240806125157.91185-16-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948883815116600 On error the DAT lines are left unmodified to their previous states. QEMU returns 0x00 for convenience. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240730092138.32443-2-philmd@linaro.org> --- hw/sd/sd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 07cb97d88c..de27e34fc8 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2478,20 +2478,22 @@ void sd_write_byte(SDState *sd, uint8_t value) uint8_t sd_read_byte(SDState *sd) { /* TODO: Append CRCs */ + const uint8_t dummy_byte =3D 0x00; uint8_t ret; uint32_t io_len; =20 if (!sd->blk || !blk_is_inserted(sd->blk) || !sd->enable) - return 0x00; + return dummy_byte; =20 if (sd->state !=3D sd_sendingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, "%s: not in Sending-Data state\n", __func__); - return 0x00; + return dummy_byte; } =20 - if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) - return 0x00; + if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) { + return dummy_byte; + } =20 io_len =3D sd_blk_len(sd); =20 @@ -2517,7 +2519,7 @@ uint8_t sd_read_byte(SDState *sd) if (sd->data_offset =3D=3D 0) { if (!address_in_range(sd, "READ_MULTIPLE_BLOCK", sd->data_start, io_len)) { - return 0x00; + return dummy_byte; } sd_blk_read(sd, sd->data_start, io_len); } --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948988; cv=none; d=zohomail.com; s=zohoarc; b=g+gQy5YqwF2zOgjaXGSdnMmRgur/Vghe84yRcGZ/+IhW2eVduH7x8fiBBfw+8t94klRp/pITsEjzYQvhaHO/NBs73pweNVRpbVf27kdf5dBS9JRn9AnRJ5akEKtMRNGi+CRFDDBwgCfho4gfR9b4Adbldlni3eOWWAzagRqI/6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948988; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fSCuGHe+AmukzYVW/13LuZhAtRaauQM2euUp0akLJd4=; b=CWJlRP/UybSmeBEHvix+Yt1P11FFehtmEEDwh5/zkdPbXmfkKplsYvBeq1v1gKkX+mqxo++6BvZgtGLXR088kD9ukg3vrVyNFtZ1J+2MgDhE7agbeX326d9mLY6fYH9TP1EHZRPbVZlEeDSwkthEqbp3AEOfvYBqVzucPWzgFIs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948988864459.5163644838864; Tue, 6 Aug 2024 05:56:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJhC-0005Jn-MI; Tue, 06 Aug 2024 08:53:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhA-00053h-4j for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:44 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJh8-0000BY-2u for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:43 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a7a843bef98so62018366b.2 for ; Tue, 06 Aug 2024 05:53:41 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9c0c0e0sm549658566b.67.2024.08.06.05.53.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948820; x=1723553620; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fSCuGHe+AmukzYVW/13LuZhAtRaauQM2euUp0akLJd4=; b=pFbcNHRWTZKYaYVh0tCeTb5UU84l4HQhvSzXnHPChULI55tkvl3HQxSPC/NujbKZRM GhfNl+jAk8curiNNx/ag91Nn8xDZwvdoMTDtzFfBap0rFSdTBIXu6lUVUi7fbYTsog8+ QR8qAQFl1HtwDi+Ql92Eu2nIHX1Wz0cILKfb1/RAQKQ4gUpGfQGFcx/9ZjErQRESzy1i CQHgPAz9xyDOaXp5aGX0/fBwIM06zjsBKIcX1RY5wRqyPawnWQN/xpQY2IQnoUABb5ed hEu4Fh5aF30cP2I1xAAzVtdEq0OsrWovTQcaNcRPjeeCy/fib7ZaGEDOwH6mquRb/d57 hNLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948820; x=1723553620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fSCuGHe+AmukzYVW/13LuZhAtRaauQM2euUp0akLJd4=; b=FtOky26WFB8fexx10Pk6utQ06Y3V2Xao2YeYv7HxP08PSRXsnkAQlNUlEsGdqz3+fm 1GZ2WhmTYYBCKCGhLnZPwP9hoXaFiOLKERW5k2U55bJrelYBmpuC2pR1L1hLgLwwT/Fu EmdzkRnLEGLUkCoX2X0mTYGtBZqkDgy693rjy8AXhbuUndutam+VwixYyRn2/jgPGFIz a8y8HVvNUI4jCXJkOFB5qz+S4avY8h4QJGUWf/7LDttYRnzV2q7yuuCzyNTQ9HYOkgzh 4F0QV+gvWTy3jGa0lx00VBZOliwrTw+sAC+YRuhdfvDL8LeOoAev++e9B68M55SFtriK KmOg== X-Gm-Message-State: AOJu0Yy9X2Izo1ZEq1xA8E9CxUfEEDe9cFHpBIA1ikAs4K8gzXLBNn0R DIIuQFwMjMtkgpF25OgAWQmxRbKDE7wvYTOEeLXLN9fZDW49+Xd6SR9GEiCbi9NMqak/WinLL00 N X-Google-Smtp-Source: AGHT+IH/qbh6cT/QUfP3qWT8WPfo8GgsqC45i9V/3IaqLMDpJUQ3EKvajzC2OFAwFi4tfeMLDpYTnQ== X-Received: by 2002:a17:906:f598:b0:a7d:e84c:a9e7 with SMTP id a640c23a62f3a-a7de84cb5bbmr539226066b.53.1722948820221; Tue, 06 Aug 2024 05:53:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, Zheyu Ma , Richard Henderson Subject: [PULL 16/28] hw/sd/sdcard: Do not abort when reading DAT lines on invalid cmd state Date: Tue, 6 Aug 2024 14:51:44 +0200 Message-ID: <20240806125157.91185-17-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948990226116600 Guest should not try to read the DAT lines from invalid command state. If it still insists to do so, return a dummy value. Cc: qemu-stable@nongnu.org Fixes: e2dec2eab0 ("hw/sd/sdcard: Remove default case in read/write on DAT = lines") Reported-by: Zheyu Ma Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2454 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240730092138.32443-3-philmd@linaro.org> --- hw/sd/sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index de27e34fc8..a140a32ccd 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2540,7 +2540,9 @@ uint8_t sd_read_byte(SDState *sd) break; =20 default: - g_assert_not_reached(); + qemu_log_mask(LOG_GUEST_ERROR, "%s: DAT read illegal for command %= s\n", + __func__, sd->last_cmd_name); + return dummy_byte; } =20 return ret; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948978; cv=none; d=zohomail.com; s=zohoarc; b=DCxTyWTrEfw3bJjulTFF8adbbpVOHsTvUer2QFhCjEgcrU4LCo7IV1RKSOSImvs7+mcVGc957kGAaMLQ0PCecbqMSBLVPEDDxABPgJU7t/PMGTazWn0SbEI9UEsUAMtQjIarEmUER0bhcayh7SzZqGBj8TQPuTLyLWgYz5sEGEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948978; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qVol/losEhIcWq2r2tAtbopJaOl9RLGh9SWaxvA4wzc=; b=TzqL3NoRZAc3EpjXPcY8LjaZmaJGwbMxh5wL2XVwKf+mPkx0GUDyqP85gRgfBQ+boudgOkfOU//d9d8Rm9NZUDVQuBsoweRi+mgKT/gOIOMKzvHsPmlDBXc0jKB3Ya6fvJBKWabjG85zfKUk5EU//o+DmLTqb6oizshE4tnwut8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722948978176320.7058130346876; Tue, 6 Aug 2024 05:56:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJhI-0006CN-V0; Tue, 06 Aug 2024 08:53:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhF-0005n8-WA for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:50 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhD-0000H5-SW for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:49 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5a156557026so601245a12.2 for ; Tue, 06 Aug 2024 05:53:47 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5baa6b916b8sm3653114a12.22.2024.08.06.05.53.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948826; x=1723553626; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qVol/losEhIcWq2r2tAtbopJaOl9RLGh9SWaxvA4wzc=; b=J6JVPJ0XQ5uN+ZsELFsdsiDAMrbd0+7F3iDFAT9V+44ciHkgpMAJP7da0u/T36UzlR VHwt+Bd5OAaeXElOsqeYmSClSlihXrkuJlsM+FUY2TAcDUzy1/WcTuv8RRi/GZRl8av3 w3UtEha3VI+eUwXGDY7ndswrP7zUBkhIg2gwStPirONjIedMjWqKYGZ0MPFlSkJ9sMoW 93mpwB1W8uv8QT44exYTH2o8yGgWWnQxwuP2BNltmfyCseL1tWHs/+fHlgxYO2nYJOTo GkDEFK/VyJRfn8oXYSKDwQynxIkfEIkiI+wMWdj7GN9iSVbHR8ODU6a4mymu86j2zSZQ sm3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948826; x=1723553626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qVol/losEhIcWq2r2tAtbopJaOl9RLGh9SWaxvA4wzc=; b=vgFb6tvu+AYeFzIt1pCFCWByxfUN3F3+5qgvEgjvl2e3t/tk93el2y+5gd6nX7ciWj LYRC9AOG/cKRearmVEzRaZExHhFM5VtE+ctuigQikeIfi9k3kzn59xqx0tV2q4LOnkpx /y71Ijx+sQ/wt2MgebIu0X411otemLAw4YadIC9RUxNRZaynBGJ+qFdbGRfmQesHOfWc Tti1edglQ4rTAHt5ogR//HfUGL9qkdbbTBRYo+o9NBMAW7NkXuhcOSlxmW+TjfaT6BLO w/8u8VwxUJzffSBRL8dTH8LPd4yR+JuKg0ImZlYJnXLr6jmUh89FW407ccKQKcA1bHPW ALOg== X-Gm-Message-State: AOJu0YwrdvfdAL1n3JPq+W749GowUsHHoyEmhq8qujy509EVqg0QC5TP EYVg8UjVzwDTlIgdeysVd2b+pXuATxm/5r6h3nlQp+u74taAgqF5GZDy4FCjFZ+FdyfmqKVS8bH z X-Google-Smtp-Source: AGHT+IGHHerP54nv4N2NYCyun0uQwMPHkgF8j7yp/Tgw8ZIHbU1PZuDcHpxJviX7jlEOJ1HcZnjnPw== X-Received: by 2002:a05:6402:31a3:b0:5ba:83d:3294 with SMTP id 4fb4d7f45d1cf-5ba083d343cmr6726452a12.2.1722948825908; Tue, 06 Aug 2024 05:53:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, Zheyu Ma , Richard Henderson Subject: [PULL 17/28] hw/sd/sdhci: Reset @data_count index on invalid ADMA transfers Date: Tue, 6 Aug 2024 14:51:45 +0200 Message-ID: <20240806125157.91185-18-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948980217116600 We neglected to clear the @data_count index on ADMA error, allowing to trigger assertion in sdhci_read_dataport() or sdhci_write_dataport(). Cc: qemu-stable@nongnu.org Fixes: d7dfca0807 ("hw/sdhci: introduce standard SD host controller") Reported-by: Zheyu Ma Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2455 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240730092138.32443-4-philmd@linaro.org> --- hw/sd/sdhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index d02c3e3963..8293d83556 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -846,6 +846,7 @@ static void sdhci_do_adma(SDHCIState *s) } } if (res !=3D MEMTX_OK) { + s->data_count =3D 0; if (s->errintstsen & SDHC_EISEN_ADMAERR) { trace_sdhci_error("Set ADMA error flag"); s->errintsts |=3D SDHC_EIS_ADMAERR; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949027; cv=none; d=zohomail.com; s=zohoarc; b=Dq6xNO577wT1ZXEHnBwcaqSRK8rk9OUfVJ2FjZW5guPwHK7bOeEkNpXiOQ03QQNuNoOje5HeItpfKANEUtj/isjYKdjtr4bEF610d209uDKgc+tKUmWpnUbssZK26Z0PYT4aG0+qgyF7og4fsYdOn/yTAXxMPw2gLXFWmvsCSxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949027; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QOLg5Vi3ZKfkY84yToih/WZzzIJIKq2Y34KfZXOpYeQ=; b=DGkeRYf2cwqkkApcHSoECwDBlxbMejmxfWti5naHFq/j+SOdrDtNk5Q13lfjr1P7DhmUX7bVORdIWdHT/efLd29VQQka2jcLV/ccXsFTr985LcM+yaus3WknCPom5vmsBzf48j6Sq35RZNldl6lLolXMw/AnH1ZZJVsCveQig2M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949027698636.1621960684228; Tue, 6 Aug 2024 05:57:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJhT-0007KG-NU; Tue, 06 Aug 2024 08:54:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhN-0006t0-NO for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:57 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhL-0000Jp-Vl for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:53:57 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a7aac70e30dso58972166b.1 for ; Tue, 06 Aug 2024 05:53:53 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9c0ca00sm545543866b.68.2024.08.06.05.53.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948832; x=1723553632; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QOLg5Vi3ZKfkY84yToih/WZzzIJIKq2Y34KfZXOpYeQ=; b=no95ZLQvcosJocWsWEj/XtQfQt5OhX5b12WmRhZDr2TQi/p5Eyh94yXljaFqM/SMVs upFhbVVwfK+Pj02lYbLGR3IDWzdHB/NKKLITYa6mDZCpBLhwhQP7gBfQnfiW9e4l79F+ 4wERMAefTaPLv2OSSkbY0X+tCyAxIGNkebVBX77O9Srwnmqlxu6jJeoOqb1OH6Ry53o9 OVi15bmJuHQ42fGRHQG0m2ZXIN9XgXBXLJha+l9mkFGJE8UU4+f0WDYk2PTl2sbfFpMj JbaJOnXKtsBPMexIDO0+IbDxl6vZf/8a70L/SbLU+YKQ+FbCJf1R5BHyqB3hlKjYnIS2 2W3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948832; x=1723553632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QOLg5Vi3ZKfkY84yToih/WZzzIJIKq2Y34KfZXOpYeQ=; b=bx3JDFQ8FzvKpgiXlYc9Mc1cHATT2ZT1vMSSmS06R6Pa3cFPXGFsEw2MgmtWiRqq2m t4J9uq8A1EvtIE1UgKNqgxIGHTbLsREjMb4CwV9+gYDZFIt6u9WvLokldTMC0etLesvF zdvl3BKpWdVkF5luUbvw4rwmYi9JErQa/uEUbZBI5dTrrplZflc3pTKa8FekMJfzZWaq Mme+FeRpns9LYlrcojLHwFX2plrwnKoeLmG5w9aRMmsfoKlnKhy/V6BhRX7WCvKe4Q9F rEZorkcyv2nUqYzt43UBUAmWEbvm6H9nKkHL2zBeZjoxrwKmTdz2gUuD2Yxab2cQA1tM g0Hg== X-Gm-Message-State: AOJu0Yy20wbC31CQh4y1I3UwQHy22aBh8u3iBu+7/xiq9n0z8w6qa6O1 h6kWiJZubhAVdzFgDgWVELzxpuUEsblPowskT2aSjmVRqavbCjTlmIsmAYKKRF8JlUVsniINkjR k X-Google-Smtp-Source: AGHT+IGRaM4WMc9qgogB5AShB+bzTSo/cHkQ3V4A+4cH5o1QooY7YebFilHRAhzKUkqJtd4l6SCNXg== X-Received: by 2002:a17:906:d262:b0:a7a:9f78:fef with SMTP id a640c23a62f3a-a7dc5179f86mr1164585766b.45.1722948831676; Tue, 06 Aug 2024 05:53:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 18/28] hw/block/pflash_cfi01: Don't decrement pfl->counter below 0 Date: Tue, 6 Aug 2024 14:51:46 +0200 Message-ID: <20240806125157.91185-19-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949028363116600 From: Peter Maydell In pflash_write() Coverity points out that we can decrement the unsigned pfl->counter below zero, which makes it wrap around. In fact this is harmless, because if pfl->counter is 0 at this point we also increment pfl->wcycle to 3, and the wcycle =3D=3D 3 handling doesn't look at counter; the only way back into code which looks at the counter value is via wcycle =3D=3D 1, which will reinitialize the counter. But it's arguably a little clearer to break early in the "counter =3D=3D 0" if(), to avoid the decrement-below-zero. Resolves: Coverity CID 1547611 Signed-off-by: Peter Maydell Reviewed-by: Kevin Wolf Message-ID: <20240731143617.3391947-4-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/block/pflash_cfi01.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index c8f1cf5a87..2f3d1dd509 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -614,6 +614,7 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offse= t, if (!pfl->counter) { trace_pflash_write(pfl->name, "block write finished"); pfl->wcycle++; + break; } =20 pfl->counter--; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949310; cv=none; d=zohomail.com; s=zohoarc; b=S2dLLxleHk87P/2BwSgSDKDxSDLA27+NVaHrLSnSf7OiuDzdoAIj35T/c1PT6zX1AJC8Bu3XgVn+8OnCX/It2IXElEGmJr0P/uarBI4KrePxRBUuCaabvxO+bxPglbeBSmvqP1ZTtbPpbcallP6vseNQu2JcTlmlpsZ2DABeLVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949310; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AMipe/hXLqtb3Ef8XbFqx4kLNXFlOJjSHmZuoVlilTA=; b=HaWkR6VCtscBf2NFbUYDQwcF3rXpFJFGC6MDk9Gs0CBRXnOJev39FOVtGunRx29BeaO9z5+emkNhXadmB36m1U6Br/RCjA17aallDU0+uPTPS7A9HtxWfWpyQQRfDh/bU3feNUYa9SiDkl4+qsfvCzeT7R5NGAMji4C+Pfxc2TQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949310192879.910771144051; Tue, 6 Aug 2024 06:01:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJhX-0007oK-GQ; Tue, 06 Aug 2024 08:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhS-0007Lk-Jj for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:03 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhQ-0000K7-OL for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:02 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-52fc14d6689so515672e87.1 for ; Tue, 06 Aug 2024 05:53:59 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e7fe3csm539363066b.162.2024.08.06.05.53.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948838; x=1723553638; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AMipe/hXLqtb3Ef8XbFqx4kLNXFlOJjSHmZuoVlilTA=; b=M7lEONhJ7UuMoo/Pk40/xnfDfkIbohUZBK37LDkikZYgrUTgICk9WW9OjaUgbIPuuJ DqtJJkkS2nMl6w//T72jOS1AXaMd3jGGpA/z4838SxkL41ytFtAxAH3ukBXDuuneJ0PM E17JWlixB8bnGhK/w+7c2yMvYEjz3Sw+sXSjQo7akuLiJrrLqGsbG6i0heSWbRm2DLDg iUPO8QrUsYFjBOhWVsd5FCHXrFduF85n5ZPr6ZS5+prXw/JRCa9QFezSSpHwhiEg6Qt9 UUIH+LGVeTzALzk+oExwIdO9Ad6k+9GEMA3Bx6hSq2PGMFftXguE0PO4ZsyuEdU2mQO4 d7aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948838; x=1723553638; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AMipe/hXLqtb3Ef8XbFqx4kLNXFlOJjSHmZuoVlilTA=; b=p9FI8bzQxHS8aLuvSegv7ybbnBHn9OASF+x8yzzF3SOj3Aq2Zp/oEJ7pNVqkbtlNRQ 7+iQ0bLwiucKDQGmpJMge1izs2UAIHpBRacc1b4dHzaf49X4ifmqAPA6+gcLa09P1kOX Eg0Yo02jzZHXGaARYP894f8n//9rA9eb9jMPNGNzfaPOs3R63IEnGt0ymxlcwuPf8bF9 EU6wbw8mVlrEU7sBFNDh2+irvv2AbC1idjieLyGo7oq90loMnJz/1q+76I/FHylupty7 a9osMi9AB/tYin0qPcWm2P+24JeQKQOHKs8LwGbW1jRkTo1EBVvgTSnSq0mz81qzLzfm RF0g== X-Gm-Message-State: AOJu0Yy0MzCjdze1xLCpHTmZBazX9K0SufKz+f8BLlv2+Zg/wa2KdNxb zHtOOryO6AHZRy2Xome1bEXB/IQRBit4vN1KgD80ewtnLsQ9cWTkZ1BrEGh9HVuUOuKX5DZiLlQ s X-Google-Smtp-Source: AGHT+IH8G0ZoABRlxKVigalJQip/AR4YTB9XiD8/200FTJozro7KFpdNnKVWQEkmHPtGccX+VtEQeQ== X-Received: by 2002:a05:6512:ba9:b0:52e:9481:eaa1 with SMTP id 2adb3069b0e04-530bb37425dmr10667974e87.23.1722948837724; Tue, 06 Aug 2024 05:53:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 19/28] hw/ide/atapi: Be explicit that assigning to s->lcyl truncates Date: Tue, 6 Aug 2024 14:51:47 +0200 Message-ID: <20240806125157.91185-20-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949311882116600 From: Peter Maydell In ide_atapi_cmd_reply_end() we calculate a 16-bit size, and then assign its two halves to s->lcyl and s->hcyl like this: s->lcyl =3D size; s->hcyl =3D size >> 8; Coverity warns that the first line here can overflow the 8-bit s->lcyl variable. This is true, and in this case we're deliberately only after the low 8 bits of the value. The code is clearer to both humans and Coverity if we're explicit that we only wanted the low 8 bits, though. Resolves: Coverity CID 1547621 Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Reviewed-by: Kevin Wolf Message-ID: <20240731143617.3391947-5-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ide/atapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index fcb6cca157..e82959dc2d 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -265,7 +265,7 @@ void ide_atapi_cmd_reply_end(IDEState *s) byte_count_limit--; size =3D byte_count_limit; } - s->lcyl =3D size; + s->lcyl =3D size & 0xff; s->hcyl =3D size >> 8; s->elementary_transfer_size =3D size; /* we cannot transmit more than one sector at a time */ --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949387; cv=none; d=zohomail.com; s=zohoarc; b=hklBxbVyzk4bA4cE2pDn/Y9n++wS40iwR8jrrDC7bqAi+pcaK513iHWR5BUPwLvzJGc083UyI+YMg/sb/QBDVQZFKrwayA7NvspXycHGVi/+kfoHw8ynEZfHQTdj2w4A8Lg+uovgQ1OPh8u80Y5V0CExgL50zQ/JLRHWdlLObPU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949387; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T2BNzJT5/rzAun9sis8NChUOI8pg5PZFtzu3546w0iw=; b=lk6KMDrjFzRO/sjrTTU+DmZWAreTU6Cm9J4fgbp6cyK5uMIGFP4Znv5SURi6IEitI4Mb9mQgjYHkd/72wxYFwFxSgjiOZpqVQK2UC5ewd0pOwQB/dkOU48LwzNq4PilavmLjuHwRCx/s/lXknBwtmy1sLIOpSeJHaN6dLkZL2xM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949387488974.2861003281876; Tue, 6 Aug 2024 06:03:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJhZ-00082e-Jj; Tue, 06 Aug 2024 08:54:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhX-0007m2-61 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:07 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhV-0000KX-8J for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:06 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a7a83a968ddso68664166b.0 for ; Tue, 06 Aug 2024 05:54:04 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9ec7575sm539465766b.205.2024.08.06.05.54.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948843; x=1723553643; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T2BNzJT5/rzAun9sis8NChUOI8pg5PZFtzu3546w0iw=; b=luom6VsDG7eJb/MsC2Emug3Dip+gUBk0+vtOqRnikMkTlCSOIYHp8TNeuSQGA3gmuu VXrS5mTGYjt8MLYCHKuTKXxT+eyTD7OnfgyJhT/YsCn8npp/UTuIXrFS7zQuqZ97GqgQ gXcP9D+U/JdccXbFubb7KdSVU0f/sZOJWI048fsCs8Y5ic3ztc/wRwxuWr8aqyWnVSNb L8Bfc8VblSJDMdSyaX1/KlIXLclbHsqRx+KYjMElpasigQud4qpXFqmj1N9HAzbWUIY9 ygUFhhf2UCGEwd6zSAPT4Jj9R3khezu6TCfVzpGx0iSsY42S2sh7snEPNw/+WXZAPkuK 8Nuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948843; x=1723553643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T2BNzJT5/rzAun9sis8NChUOI8pg5PZFtzu3546w0iw=; b=QLCWZr5dDiri+X6FPfCQxfrH4K4XLVpIazSDL7TzTu7xGDJIZQj2CFmtXYRWbkbV3z cWE8Ka3wUJ/y7T7smO4rf0AXSEI+xRKvZyKxKloyvfE57Q9vNhOHnxHvVN1/ln1TClC0 kW5Y+urGDGmCxbA/2IKFAtawSKJs4Wu7cOdLLsgT6vAM93CFnkGAx1APzxu9UwKMsmBa 80H8J1CpeV5rCvrI1ELtlhZ2koZH0F85NKa03CQx7b7miTHGyUg7J9K/t8mrraQhfQr6 U5EbinrSfr7KZGkkLgemWsQV0lpLNzxRlKUGWzMq8WZ7YiBscj57/9N8kEWpwql/Xt7x CskA== X-Gm-Message-State: AOJu0Yw4+vFCftluAr1xHqouh8PgC/C9vHdaqv2F04se/GMbWvvIGnD1 snd4CSBdW6V7vmC8aYaA9pvxIhQ7H2ermgu5oxsg6veLRjjjUIu8T/fL6OmZu0VDNvtnWK0GELc l X-Google-Smtp-Source: AGHT+IG+moa5CelR4wcWKiPrSXr92jlFBykqrBUANqj/NP10lZca8tLDfw7h0yzZPG8/tpjwCGMWHQ== X-Received: by 2002:a17:907:1b10:b0:a7d:3ab9:6a5d with SMTP id a640c23a62f3a-a7dc5130c90mr891231866b.69.1722948843425; Tue, 06 Aug 2024 05:54:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 20/28] hw/block/fdc-isa: Assert that isa_fdc_get_drive_max_chs() found something Date: Tue, 6 Aug 2024 14:51:48 +0200 Message-ID: <20240806125157.91185-21-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949395974116600 From: Peter Maydell Coverity complains about an overflow in isa_fdc_get_drive_max_chs() that can happen if the loop over fd_formats never finds a match, because we initialize *maxc to 0 and then at the end of the function decrement it. This can't ever actually happen because fd_formats has at least one entry for each FloppyDriveType, so we must at least once find a match and update *maxc, *maxh and *maxs. Assert that we did find a match, which should keep Coverity happy and will also detect possible bugs in the data in fd_formats. Resolves: Coverity CID 1547663 Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Reviewed-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240731143617.3391947-6-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/block/fdc-isa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index e43dc532af..796835f57b 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -147,6 +147,8 @@ static void isa_fdc_get_drive_max_chs(FloppyDriveType t= ype, uint8_t *maxc, *maxs =3D fdf->last_sect; } } + /* fd_formats must contain at least one entry per FloppyDriveType */ + assert(*maxc); (*maxc)--; } =20 --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949371; cv=none; d=zohomail.com; s=zohoarc; b=Xxsnc30QpsHnpCqCH3F2V43jUoOp5/mVABHZitSLm0FwkTQ31VEhPWRPy6SJnswgN6vcryJhSjoUAG6Mmuqpsy4NZMo/Qno5Z5lyl3ct8jjGXX1n76Qt4o7AtYX9qCCLawMOPeKVnEvahXadV3n+RTj9n+BGZrLa147hNA2eQng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949371; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gv+R0AOxTRNRr/YYta1DbILbzN2/ozjvln37VG+akqw=; b=mjQcheLcgmCqXENAFPfkVqPxGNpN5OpaBjuGa9tqvg75ax0YASt48vpOdhHaVT8Of0VXRPSDQ0pDYYkCJMn4nVm75mI6J7AwRM2udP68E0Iz2yJ87+wWgyA9cksPc7hZenlWEhypjd6vsqLqIqraEA/q3CAPtJigmRQVkpnrmaI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949371254576.9655356485293; Tue, 6 Aug 2024 06:02:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJi2-0001Ym-2g; Tue, 06 Aug 2024 08:54:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhg-0000F4-Oa for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:24 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhb-0000MA-TZ for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:13 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ef32fea28dso6962461fa.2 for ; Tue, 06 Aug 2024 05:54:11 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bb88d1d9a3sm2558061a12.26.2024.08.06.05.54.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948849; x=1723553649; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gv+R0AOxTRNRr/YYta1DbILbzN2/ozjvln37VG+akqw=; b=pMqQlNuhvjAjZ/LZtahOeUPMpwtwcsQFzPfPSHOwHYr8IkA18U5kfNmpnN2Hs9I2Ef fr/v13JgebmIAV/bw843V47ESuhVkL12S4hxqUwtWbAssE0ywieUrlHQaq6HCzf5el2e cRXzgVkOoOwhbP916+veJqzy+OU1gSZWeDyoZfBGrbCGFy58R33bIFDghUpbiwX63SkC 9Y6jgtdUOLDF7ySuw8RCpx/BfO8pwNKfEo9hFExBAomWwQA7foD8s+W1ZhgaqOMQTgYV 37Z+hoDKoxyl1s9V1cuhAmQQdWa+crysZ5qP0NaKYYBNsDNrGDPxgz4hOHXlZ0xAdseU H4Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948849; x=1723553649; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gv+R0AOxTRNRr/YYta1DbILbzN2/ozjvln37VG+akqw=; b=n01DbxhFfyrmFQpo/prEma1sy7EMVZvkRNcrqOHXPq1WOdEHomwIg+gZzy+anNeSLp qA5AZsIeE97j0GQeIyWWcJLgtJA1kNlYkYfxnq8llA16OLlCdHulvDnWvqAeZDWTFB7w 9unmV2kubi2nX/i3T7zWEe8URs6QxDA7sqj+WJbVNeQOCzbgH5Imdy+rhN0Ub1DAaA+E qAU89IQAGPdhp2ybRzdYsY3GHmwPePek2gmwC+sZeR5ZQI4WTpocgRJe/X1drpDjurev IbTsw7DIBOeSo/IOMdZGszDAfMke/GBC1Xy2gxvuRF8IBrpkqEZVOB+ItxfhNht36Jjy 5MHQ== X-Gm-Message-State: AOJu0Yydo86uBHraLbzIH4r7b1wbciCrtXTOLMorZ+JDTO5sitOsIefq sx3p0XdzhF7S/GgvTdEMx6Kx9yCONDV74N8MHMpIIXOP1vMMYh8czuWQ0UmAtP6S5QqLSY+4rVR S X-Google-Smtp-Source: AGHT+IEjUA7XHVQZQ9IKvGvDk1ZhAIr83KVOzxwR2ijFBWm9ba6PraKB14zqi/sY1NsIg+m0hfzMvA== X-Received: by 2002:a2e:98c3:0:b0:2ef:2b06:e554 with SMTP id 38308e7fff4ca-2f15aa87375mr99364231fa.15.1722948849227; Tue, 06 Aug 2024 05:54:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 21/28] hw/ide/pci: Remove dead code from bmdma_prepare_buf() Date: Tue, 6 Aug 2024 14:51:49 +0200 Message-ID: <20240806125157.91185-22-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949372209116600 From: Peter Maydell Coverity notes that the code at the end of the loop in bmdma_prepare_buf() is unreachable. This is because in commit 9fbf0fa81fca8f527 ("ide: remove hardcoded 2GiB transactional limit") we removed the only codepath in the loop which could "break" out of it, but didn't notice that this meant we should also remove the code at the end of the loop. Remove the dead code. Resolves: Coverity CID 1547772 Signed-off-by: Peter Maydell Reviewed-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daud=C3=A9 [PMD: Break and return once at EOF] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20240805182419.22239-1-philmd@linaro.org> --- hw/ide/pci.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 4675d079a1..a008fe7316 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -237,7 +237,7 @@ static int32_t bmdma_prepare_buf(const IDEDMA *dma, int= 32_t limit) /* end of table (with a fail safe of one page) */ if (bm->cur_prd_last || (bm->cur_addr - bm->addr) >=3D BMDMA_PAGE_SIZE) { - return s->sg.size; + break; } pci_dma_read(pci_dev, bm->cur_addr, &prd, 8); bm->cur_addr +=3D 8; @@ -266,10 +266,7 @@ static int32_t bmdma_prepare_buf(const IDEDMA *dma, in= t32_t limit) s->io_buffer_size +=3D l; } } - - qemu_sglist_destroy(&s->sg); - s->io_buffer_size =3D 0; - return -1; + return s->sg.size; } =20 /* return 0 if buffer completed */ --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949127; cv=none; d=zohomail.com; s=zohoarc; b=G94LGNZqmJgFouIkhpVYV00srmHfVRxef5yYYyYhXFfSc1kbJKDSBzKotUVkM9BDY3XQghU2EzRHgQiMj824RiwdaT+Qj8shAsMeUfeO/rrRpVPtkBgaG1rOiEaQh8IkPg489a4rdEY2zY5ONZl+pIYgdAGMI+tyCom4UqMCclY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949127; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nMm3A0DabsjolGXhyPhZ1sZzpOJXfaTPvfWzaUzLVvw=; b=KTDolHpSrTlneYs0iwOqAXz8hXHmumt4V84Cfiv6g+VjGgsH/wPjvGOb2YhfIb1RxoXJxBu9fTGt4jGBfuuOc8yzlTwrbhBHA/oylzcAnARVC7P5FhwfqEzjSunwVqmP8n6mbXVf9M31XCKmrQQ1PtU1Mj4nPgqvFe/dDE94M+8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949127077516.8062512947806; Tue, 6 Aug 2024 05:58:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJj3-00054t-98; Tue, 06 Aug 2024 08:55:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhj-0000TS-Ew for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:24 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhh-0000N2-H5 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:19 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a7a9a369055so54930866b.3 for ; Tue, 06 Aug 2024 05:54:17 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9bc3c7asm558455666b.14.2024.08.06.05.54.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948855; x=1723553655; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nMm3A0DabsjolGXhyPhZ1sZzpOJXfaTPvfWzaUzLVvw=; b=SmbFAtbBPrGEkMuqRRb54s1Mewcnumej2DweE3kd3GdlqyW1uheRnTWocWgZHvBPbj 2YvBY5T+24pigPU4uJoRzPfbmWwpcWdTnO0OqaOeNQSjz74jRs2kMOGRRfOemwVuphYh 756EoKTqB/+jk2vgF6b05Gc7EHDly/PxF6p9G5qSmh2nQaqLJQ2O9pj+ITMTfL5yVKi6 EoZVpgbG6cmUEdDWff5jcHtM7p8SwxOr6D+S/c8lAMOQsFJ+0k9Sgi8myjfEKlWIw8VG /gP5syLzgR38PUNIVhLp7q+eeiBtGUKMGxv/n+kmn3nsNytHpiYXeUaRAS4x/QKexbFQ HG2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948855; x=1723553655; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nMm3A0DabsjolGXhyPhZ1sZzpOJXfaTPvfWzaUzLVvw=; b=p4mQlJBJS+xEsoPDd4JorTAXV6vsN/HnOk8QRWplEnLT2SVoo7fEEvduK/ryPRNSo7 Fj89u8UVTC94jBvuAqdc8PIOtlC0r6WejwwpwOtmtY8scVYsoVTuvlEdimwu2V+STUdU uOnsXM85JgQZ5ISkl05s7L6rgBH2RpQRE2V9JcGjsqwxIizafr/U4j7LzuVpsZ1vWUgA eBhtSjFcsAgwukfvvGC98M3+gd9ozgikMeWnY3CYwQp6g7EK7Aps7P6tL4B1oxX3ZKWe sNcAp8VYvKpBhh8ph7h67SAY53Wrr+NwnZzjdg10RASvEkQLuIYFMMXX6Imb8eSrCMZi Q9Nw== X-Gm-Message-State: AOJu0YzSCl1bX2nMfdOHCX9prx3pq/QwoIxcU2oAIGqaz8dOLspB2zUk oFJ9NhrEECMsJ6a+s2wID7IYqiZUvZz0VqGPu67abQ0/tkW8g+QannIZYy8Vc4W0Xrld7A0xzzH D X-Google-Smtp-Source: AGHT+IH24eR79lDqIaE2q6DNcV5o2zg5AdeRNNb2Klp0VvlkZeCQ8kqmCVHJWCRJCsLUmt8xuxUqZg== X-Received: by 2002:a17:907:724b:b0:a77:b516:3023 with SMTP id a640c23a62f3a-a7dc4db2a1emr1035988366b.4.1722948855304; Tue, 06 Aug 2024 05:54:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 22/28] hw/display/virtio-gpu: Improve "opengl is not available" error message Date: Tue, 6 Aug 2024 14:51:50 +0200 Message-ID: <20240806125157.91185-23-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=philmd@linaro.org; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949128835116600 From: Peter Maydell If the user tries to use the virtio-gpu-gl device but the display backend doesn't have OpenGL support enabled, we currently print a rather uninformative error message: $ qemu-system-aarch64 -M virt -device virtio-gpu-gl qemu-system-aarch64: -device virtio-gpu-gl: opengl is not available Since OpenGL is not enabled on display frontends by default, users are quite likely to run into this. Improve the error message to be more specific and to suggest to the user a path forward. Note that the case of "user tried to enable OpenGL but the display backend doesn't handle it" is caught elsewhere first, so we can assume that isn't the problem: $ qemu-system-aarch64 -M virt -device virtio-gpu-gl -display curses,gl=3Don qemu-system-aarch64: OpenGL is not supported by the display (Use of error_append_hint() requires us to add an ERRP_GUARD() to the function, as noted in include/qapi/error.h.) With this commit we now produce the hopefully more helpful error: $ ./build/x86/qemu-system-aarch64 -M virt -device virtio-gpu-gl qemu-system-aarch64: -device virtio-gpu-gl: The display backend does not ha= ve OpenGL support enabled It can be enabled with '-display BACKEND,gl=3Don' where BACKEND is the name= of the display backend to use. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2443 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Marc-Andr=C3=A9 Lureau Message-ID: <20240731154136.3494621-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/virtio-gpu-gl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 952820a425..29d20b0132 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -106,6 +106,7 @@ static void virtio_gpu_gl_reset(VirtIODevice *vdev) =20 static void virtio_gpu_gl_device_realize(DeviceState *qdev, Error **errp) { + ERRP_GUARD(); VirtIOGPU *g =3D VIRTIO_GPU(qdev); =20 #if HOST_BIG_ENDIAN @@ -119,7 +120,12 @@ static void virtio_gpu_gl_device_realize(DeviceState *= qdev, Error **errp) } =20 if (!display_opengl) { - error_setg(errp, "opengl is not available"); + error_setg(errp, + "The display backend does not have OpenGL support enabl= ed"); + error_append_hint(errp, + "It can be enabled with '-display BACKEND,gl=3Do= n' " + "where BACKEND is the name of the display backen= d " + "to use.\n"); return; } =20 --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949254; cv=none; d=zohomail.com; s=zohoarc; b=dZbImHb5DbS33cf+TPwdVg+7887UOwLNZ6jfM833qH8NmOFUlT3bIPgM1u7GwkiONrREVj0ELfDtK/tn5ZOqxjsiDsPMPvgTif6YAVifpBZQPtcJNdklJPu1E4XdrNnYHZ5Vop2jDUQOToZnyHt4a0Pr5F4h19UHj6375Hh5mqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949254; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0GHmHGgb11iYqcqPSgHHl5+4znvZdtn/oYi94we9BmQ=; b=fJchnjdTM4E+Fy/aS7JeA9VtjhiQEWWKsLACIhhAKxD9aJiIMfW/HgGZlrHGBDhZIpJht+u89+Ld/PERIJVuwbdKWotpcTX2lin6IZoZDQ3v518Fp0zAwSN86bhA+0PIZDzn2uXMtdLtN6pgyfDJzlu78coOY/JgybkM5nGzjBE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949254273109.37233507231633; Tue, 6 Aug 2024 06:00:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJiH-0001pI-Di; Tue, 06 Aug 2024 08:54:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJho-0000nB-Mp for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:29 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhn-0000Nw-0p for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:24 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a7a83a968ddso68694666b.0 for ; Tue, 06 Aug 2024 05:54:22 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9bc9d7dsm547291966b.9.2024.08.06.05.54.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948861; x=1723553661; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0GHmHGgb11iYqcqPSgHHl5+4znvZdtn/oYi94we9BmQ=; b=F8p8PwSPMjqiDf1fjeafK20HfvSm7LyuWBdJZ8gbuaJGz+jcgfKlzRNYtpki3l8gSQ 6Uu/jb90k/quNvwTvT6RVv1xTvbF+4tpKSLgRHW9BoZkqPLLCUtER2Vn+ECT/DNf6aq7 BNNdcsrPBMIfNO5SlitGn6HV1C+PtHM1LqmvsZ0NEFODUfh1RsKIAx6UAu4EW/8UGDc2 mKHN1+30IdZNRjTJGVGWSP//CJcQ3Wwwrp8PL9WU90S27Uhx9MTliMo6+RYRjhqnpXCg Jtk4fAcFYXrb4jcNtNQszsChBlA4nkXTYDOy72YZ9denSKz3kqFX35e+R/HAuOMgRl7N lVcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948861; x=1723553661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0GHmHGgb11iYqcqPSgHHl5+4znvZdtn/oYi94we9BmQ=; b=pq6ZFaKsa7r1S3rQWfCSFiPa5lynIMK1t6NRGxFD648SIxG7tX9cM4RqcZNM0fq0az 0hk3hDb8dUn8aFSmDhRFTMzVUKlTsK1pgywqTukL3msZtO4sbd62H8HocxlGjTMP+HwG oFB4HwpKlyCtFLnCbVdi65XbvPEP6H7pXFq27x5/SBxQTuTdynggwuL3kOw7YwHs0IV9 21F8XdNpgW4b6BG8Sl0FGpG8MBAHLyZdJTrACEJoocrNnwQrJHNPuNAc0wYKRMCovdQ8 9zb0xXui9msscmWrod+as5LQP9L90oZelyqWVFV0bgH+ebMXu/N5oAuIVkAdyqsAM2ua nXFw== X-Gm-Message-State: AOJu0Yyf0+dHWLfnN97NBnuBMRJTZqjeLStM3wgf+qbrl+vbbIyoIuBj AXyX3PG0rk0JBp4uUFFJqSEjEXVVPYQfVznP5FzmgpJooAWO5uRsSdMEZLpp7h2kO4jqL8uJzmb M X-Google-Smtp-Source: AGHT+IEAf1tc9+rVm04xWKxc+tXJ/ZBu8kXaFWJuaACS5HoEF/5xW6tCR12NB/1uYawe4HF32jWj9w== X-Received: by 2002:a17:906:7312:b0:a7d:a680:23b5 with SMTP id a640c23a62f3a-a7dc50007bamr1077254966b.33.1722948861023; Tue, 06 Aug 2024 05:54:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 23/28] system/vl.c: Expand OpenGL related errors Date: Tue, 6 Aug 2024 14:51:51 +0200 Message-ID: <20240806125157.91185-24-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949255533116600 From: Peter Maydell Expand the OpenGL related error messages we produce for various "OpenGL not present/not supported" cases, to hopefully guide the user towards how to fix things. Now if the user tries to enable GL on a backend that doesn't support it the error message is a bit more precise: $ qemu-system-aarch64 -M virt -device virtio-gpu-gl -display curses,gl=3Don qemu-system-aarch64: OpenGL is not supported by display backend 'curses' Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Marc-Andr=C3=A9 Lureau Message-ID: <20240731154136.3494621-3-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- system/vl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/vl.c b/system/vl.c index 9e8f16f155..213ee6a6a9 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1973,9 +1973,10 @@ static void qemu_create_early_backends(void) =20 if (dpy.has_gl && dpy.gl !=3D DISPLAYGL_MODE_OFF && display_opengl =3D= =3D 0) { #if defined(CONFIG_OPENGL) - error_report("OpenGL is not supported by the display"); + error_report("OpenGL is not supported by display backend '%s'", + DisplayType_str(dpy.type)); #else - error_report("OpenGL support is disabled"); + error_report("OpenGL support was disabled when QEMU was compiled"); #endif exit(1); } --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722948937; cv=none; d=zohomail.com; s=zohoarc; b=XObqEmL7NhnYhSc1SsTAwWxM8nyJxkKKSOfsnq6CGhRotHzzJqYABKOHciOeeFv+ksk1bKR0LsUHMleDYQSZK5rhBy/TXp4IEyK50C2z68Zc9tT3YuNgmCSgD/tgDpYQxstnFh6If/hbmerNOwF6wG7jI3OwgC9dDijuByVMat0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722948937; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lTDAhFeBz9GijM5OI6/yGi13UeAA7K13kn7Zuxhnv+U=; b=Bhaty71zmUrGESQSZbVZ2D2esqJ6JPoCOYty18JlQ3FjdpMsUSVzo5qqCr2pZqS1nuRxGufa9bThzSveqecrS3NXG4QhxiVrNrDzS76jD77hurtgXjTAxmayPMxf1wFVpHsXZ8KkyZNnSwMx3yyxOdfuUq3Qc0sh8WPFQZ8J/1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17229489377541021.5815781651144; Tue, 6 Aug 2024 05:55:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJiM-0002rV-Tc; Tue, 06 Aug 2024 08:55:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJhu-0001Be-8P for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:31 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhs-0000OS-EL for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:29 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a7a9a7af0d0so56649466b.3 for ; Tue, 06 Aug 2024 05:54:28 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7de2d923ccsm423738866b.79.2024.08.06.05.54.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948866; x=1723553666; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lTDAhFeBz9GijM5OI6/yGi13UeAA7K13kn7Zuxhnv+U=; b=NPNVgoVsqnWR2wGTYEo/+XHOwqUPR3N8M418/RJfFh5xb6Oa+gJa5OQol9pg3IfO+t 2DSpRtTdGFKTdEJW8lxAb9D74M9RzcSRllFM0SE+Pre68K3nUNhi23N+WQ+CkF/tjIMv tUtpkgySAQNa07F8ha9/4bTLSW/vnYPQUvUQZnUIuW1XSfjWyvBdb+Gk8VL0WnUVzcsP XbERr7kiJdmQIySGXINcFhFMCv3mI5yfrVkpuUjeytx8IjC9IxbkZvPEUCCIdjl+qAHZ Ck7zlrnF/tb5Lv9oR0sQVZZ8vQfH7w31iD1eF8Uy9+BxVMOO7zJ1QG5B8y+qrn14iSp/ upFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948866; x=1723553666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lTDAhFeBz9GijM5OI6/yGi13UeAA7K13kn7Zuxhnv+U=; b=Tm5bjljQq/O+hDD0zvyXKBf9Ygr6u8/j23INt+3pCDVCfB25Ft+PcOvjTl6X1xWaur RwOOBwuIXw0auVglmo7/nUZ9LNKw7uedXfOv0UxY9cFrBLXVp+SZvPAbjZdKDiGDquAp 4MuGoQs6jhubYslLoaGAs0/chfrSOy8Fg/y0bSfFjrz1Km5alfsPwRHiZDEOShu0YPyD Gamj//18+x5RkEKMpBgS+uZFHuQ4hKcHbPrmPjYvt+peYTs/RYCTOE+78bydAicCdczR M4S/VxbPOfXDhCSgKR2KOyVGRCkbz55h8Bp9UgKfN+mQN7haKU+3R8orpcCQWdGYFNo8 NpZg== X-Gm-Message-State: AOJu0Yw5u6D7fsnpbFIeo/HMASJNJH1bQjGwTpqFfJOE55Yh8MmnT21d Vdeo03krPuRpIcDxbJUqJmGvWZyPR7Stb3tHebmJmMPtYHKEpi3U3hey+QG6Kz+5iMTA6v+Fh7L M X-Google-Smtp-Source: AGHT+IGomE15Wo24DJ7lRF9r2AdwMtkLdlxkaxrrJGCGSbJvrkwY5lYMVoVzNmiweJgvYZedJRXyAg== X-Received: by 2002:a17:907:7ea4:b0:a7a:a06b:eebf with SMTP id a640c23a62f3a-a7dc4e86892mr989659866b.22.1722948866623; Tue, 06 Aug 2024 05:54:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 24/28] ui/console: Note in '-display help' that some backends support suboptions Date: Tue, 6 Aug 2024 14:51:52 +0200 Message-ID: <20240806125157.91185-25-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722948938020116600 From: Peter Maydell Currently '-display help' only prints the available backends. Some of those backends support suboptions (e.g. '-display gtk,gl=3Don'). Mention that in the help output, and point the user to where they might be able to find more information about the suboptions. The new output looks like this: $ qemu-system-aarch64 -display help Available display backend types: none gtk sdl egl-headless curses spice-app dbus Some display backends support suboptions, which can be set with -display backend,option=3Dvalue,option=3Dvalue... For a short list of the suboptions for each display, see the top-level -h= elp output; more detail is in the documentation. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Marc-Andr=C3=A9 Lureau Message-ID: <20240731154136.3494621-4-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- ui/console.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/console.c b/ui/console.c index e8f0083af7..105a0e2c70 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1632,4 +1632,9 @@ void qemu_display_help(void) printf("%s\n", DisplayType_str(dpys[idx]->type)); } } + printf("\n" + "Some display backends support suboptions, which can be set wit= h\n" + " -display backend,option=3Dvalue,option=3Dvalue...\n" + "For a short list of the suboptions for each display, see the " + "top-level -help output; more detail is in the documentation.\n= "); } --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949011; cv=none; d=zohomail.com; s=zohoarc; b=SdBuOQJWIeJNohiLi0ul1/KSAalqxlCBVelWoRlb39PjMQs+E9368Lek8dXUZdrZlV1YBky41aGK6zxLrlNRb+nllordXD7w4Vx7NZ83Pa4f/Wk8nHWYGFhQT6N7az/oWespjDVeo/Y3KarRay6KwWWN8z7lmKWJKuVYbji306o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949011; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ypdbeuI3/3zkqxrrQlfqtvt5UnR+ONpIVnv+X7Sc7F4=; b=esJ8PAGN1Yr7jcKx2yelxAS7SNbaABnyJreiV8newxH3QZ4ymlb5loHtKNdktw3IG5jX32s0ohwPF3FW9pw/IFUvuZBw/om05vbQuGffpXl2nfJuJ8cCgTpMws0peM2sjdyxWJXrliCABHZGdb1Z5+RpKJreS6RfUAG/VhB1zbo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949011613100.59076577261601; Tue, 6 Aug 2024 05:56:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJjz-0001Jv-E8; Tue, 06 Aug 2024 08:56:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJi0-0001fi-7B for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:38 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJhy-0000P5-BN for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:35 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a7a9cf7d3f3so77308166b.1 for ; Tue, 06 Aug 2024 05:54:33 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9c0c0d5sm545644666b.48.2024.08.06.05.54.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948872; x=1723553672; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ypdbeuI3/3zkqxrrQlfqtvt5UnR+ONpIVnv+X7Sc7F4=; b=UOwVR5EUu5a2N+T0yWbOTY3Z1t0/daSYxvlHH6vbtNMi24zwRz1UrQYquzrRCv2zi1 TjZicPov6itbsZ1JowtklgUZnDVuMeMw7S5cYQMIMcUpa8RHpiRACxpRhVuoBgZicRza Mzxkno0EKv48aTBXyo5iCXvQVruEOawD1RYsHWLshOmnSaZO+ObM+KeZn2No3FfnE6g9 pHiVFo6WuI9y5+9ZOghfkZHqQsi01SPoeJgmdiV7TqZG8NabflJsrcJVSdNRr+vnP56P DumRxeP5jBaBW8b2dm5YGNnVDbFiP2tEbkqY1kG2dBKmp1HQfjFA6JRkEyfRZZ1qeB9B MFcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948872; x=1723553672; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ypdbeuI3/3zkqxrrQlfqtvt5UnR+ONpIVnv+X7Sc7F4=; b=EOnVbjSfbHEEhqOm/6g6OFK5FANXzKi41e/M9vcTHiREygpmd3VB09Qfq/OHSAHJai NtJGQ6Hv+Wtd4PpZyyWhtcoW1tdxTinDRfAtJesmeiFzsko/WHgtk8wuIykmEFWEqMnj qfT3UlcHf/3JLuyisrXaktcMIO8K3TnV7cHdZO/MM+tF0UmBs0h9BtgEskwrKHavJsAY 3XVClVEoNwqBvDWmGot9+1aBkXpooj6RW0A0My/1EDqCAf8FEEOGq0tfv9qfIMl/3dyk mFhqZgV25s/mICdFgvR/yk18rEZuwdhF7vdPSUw7vaLgvAhDmdEnS3Btes+WOhR92QXs mhuQ== X-Gm-Message-State: AOJu0Yxieg7tgF1zqp6nLX2cyaWIoN6q4PDgw4G70hv7IEF75a38pgKA 5Zpr36Fid7Xf42H8dGUUO7AC9K82/lIdCTV5J4ElE7XXAOim90CxvSzfddc1ZtsflHME67qkWUK V X-Google-Smtp-Source: AGHT+IGL/4huUwzcaLaq6PgwpIBAIzK6jpN8ZZXtAH1L3lKCQWPQ2lA7CiO9A/Y6o0KABCklX7vuug== X-Received: by 2002:a17:907:3e1a:b0:a75:2781:a5c4 with SMTP id a640c23a62f3a-a7dc4ea9ebdmr1048774766b.29.1722948872256; Tue, 06 Aug 2024 05:54:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan Subject: [PULL 25/28] hw/pci-host/gt64120: Set PCI base address register write mask Date: Tue, 6 Aug 2024 14:51:53 +0200 Message-ID: <20240806125157.91185-26-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949012357116600 When booting Linux we see: PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [mem 0x10000000-0x17ffffff] pci_bus 0000:00: root bus resource [io 0x1000-0x1fffff] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff] pci 0000:00:00.0: [11ab:4620] type 00 class 0x060000 pci 0000:00:00.0: [Firmware Bug]: reg 0x14: invalid BAR (can't size) pci 0000:00:00.0: [Firmware Bug]: reg 0x18: invalid BAR (can't size) pci 0000:00:00.0: [Firmware Bug]: reg 0x1c: invalid BAR (can't size) pci 0000:00:00.0: [Firmware Bug]: reg 0x20: invalid BAR (can't size) pci 0000:00:00.0: [Firmware Bug]: reg 0x24: invalid BAR (can't size) This is due to missing base address register write mask. Add it to get: PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [mem 0x10000000-0x17ffffff] pci_bus 0000:00: root bus resource [io 0x1000-0x1fffff] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff] pci 0000:00:00.0: [11ab:4620] type 00 class 0x060000 pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x00000fff pref] pci 0000:00:00.0: reg 0x14: [mem 0x01000000-0x01000fff pref] pci 0000:00:00.0: reg 0x18: [mem 0x1c000000-0x1c000fff] pci 0000:00:00.0: reg 0x1c: [mem 0x1f000000-0x1f000fff] pci 0000:00:00.0: reg 0x20: [mem 0x1be00000-0x1be00fff] pci 0000:00:00.0: reg 0x24: [io 0x14000000-0x14000fff] Since this device is only used by MIPS machines which aren't versioned, we don't need to update migration compat machinery. Mention the datasheet referenced. Remove the "Malta assumptions ahead" comment since the reset values from the datasheet are used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: BALATON Zoltan Message-Id: <20240802213122.86852-2-philmd@linaro.org> --- hw/pci-host/gt64120.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index e02efc9e2e..573d2619ee 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -1,6 +1,8 @@ /* * QEMU GT64120 PCI host * + * (Datasheet GT-64120 Rev 1.4 from Sep 14, 1999) + * * Copyright (c) 2006,2007 Aurelien Jarno * * Permission is hereby granted, free of charge, to any person obtaining a= copy @@ -1213,17 +1215,27 @@ static void gt64120_realize(DeviceState *dev, Error= **errp) =20 static void gt64120_pci_realize(PCIDevice *d, Error **errp) { - /* FIXME: Malta specific hw assumptions ahead */ + /* Values from chapter 17.16 "PCI Configuration" */ + pci_set_word(d->config + PCI_COMMAND, 0); pci_set_word(d->config + PCI_STATUS, PCI_STATUS_FAST_BACK | PCI_STATUS_DEVSEL_MEDIUM); pci_config_set_prog_interface(d->config, 0); + + pci_set_long(d->wmask + PCI_BASE_ADDRESS_0, 0xfffff008); /* SCS[1:0] */ + pci_set_long(d->wmask + PCI_BASE_ADDRESS_1, 0xfffff008); /* SCS[3:2] */ + pci_set_long(d->wmask + PCI_BASE_ADDRESS_2, 0xfffff008); /* CS[2:0] */ + pci_set_long(d->wmask + PCI_BASE_ADDRESS_3, 0xfffff008); /* CS[3], Boo= tCS */ + pci_set_long(d->wmask + PCI_BASE_ADDRESS_4, 0xfffff000); /* ISD MMIO */ + pci_set_long(d->wmask + PCI_BASE_ADDRESS_5, 0xfffff001); /* ISD I/O */ + pci_set_long(d->config + PCI_BASE_ADDRESS_0, 0x00000008); pci_set_long(d->config + PCI_BASE_ADDRESS_1, 0x01000008); pci_set_long(d->config + PCI_BASE_ADDRESS_2, 0x1c000000); pci_set_long(d->config + PCI_BASE_ADDRESS_3, 0x1f000000); pci_set_long(d->config + PCI_BASE_ADDRESS_4, 0x14000000); pci_set_long(d->config + PCI_BASE_ADDRESS_5, 0x14000001); + pci_set_byte(d->config + 0x3d, 0x01); } =20 --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949359; cv=none; d=zohomail.com; s=zohoarc; b=i8w5dWICDP1ai0+KoVrGyW+Qxf+mqnGtRgymznJTYWLsuqajKOTry8DaK/AZGR6XNLUmIHjVQHdYs+xpiV8NldTZuZNqdNoB/DvIlTdRzPpyEGztym0ZUrxksu9D+AWgFuXxSMj8rIuK86Gh85/ABhEuLQRuMUCGofo+g8c9cZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949359; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qK43iUJyWAfHzKeE0GH3CsavBGdCBQ3nQYJeK6ymPbo=; b=OOHSmQ+C7sTLGnTOppfuyW4hRjTuodWHFcMC5b+rjehrpH1CtztiAgJDJzWlKkrEKyskTff0uEuXuxbCLSGu7g8W+mR8J7Z+fMtISMCJ4EKPXd0zoO7mG+vtHMRZULRs5VbGbDF/IatXSLAhW1FXkK7mnmYir8BqpqkjrSNbwtc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949359279557.5838560685426; Tue, 6 Aug 2024 06:02:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJk1-0001KH-My; Tue, 06 Aug 2024 08:56:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJi6-0002Bj-7J for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:51 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJi3-0000PN-UM for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:41 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5ba482282d3so716977a12.2 for ; Tue, 06 Aug 2024 05:54:39 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e80e04sm553901866b.175.2024.08.06.05.54.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948878; x=1723553678; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qK43iUJyWAfHzKeE0GH3CsavBGdCBQ3nQYJeK6ymPbo=; b=sELFRUduu8i2rI103JjxHxNwZ0Ywih3+j0E2y3BjR0LnspCaI5ARnpIHiFvLiuA2/0 XO5+z1Vy1r1Vjz5YAbnxf/qX0P865rDegvHBKIz3VaLyRqpwJ3tfeU3up4IR9B65qQTb 4eiUYjzskrUEAHcj6POu+g4dygo86y5KPSGEsttj4yeE7sdnjU5GM7I5ggiqVg28HQ0F +T3xJVvO7hUQzY60IJY6j+7rU+pTyF9T4g8HAF/zhsG//wUWp+sUZNzwG5cg1EVMzSUs EHD+8Bam+TUzzlio+eOsLWu2XN28CptyjjlBADnlrpSEEzOSYo1nP+LP8nom9Tb8XDU9 ydXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948878; x=1723553678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qK43iUJyWAfHzKeE0GH3CsavBGdCBQ3nQYJeK6ymPbo=; b=Qkmp1YyNF6JllIKhHCXTOtf7zxNn88Hdk0dpqFkiqGaEWtVhq4PCPVnblPFELnEYus Wanuzry7epv47mZ12pedj3mHyvWtUIwFSD7/ydZW8o7NZwZ4I0r5mnysD3O6EfpLmy/1 yNdTkvomCs4ukT8lipKqBvIH0psEPpkj18m+MdMPv3omfE+YjuHXAxp6ppe551G5+GiL IJ5lDDDXuOrBwY8RF23+YkCZtgk5gow2GRmILrDDORbYjJU3Y7SUECJv0wP4b9BmQy5q Z2Xwd3Ta1LFHL1fYYn52BiEVDPFSng1UWB5X9FNk5hUVIFS+78Y+wsPXbtDVuKoTKWOw ImBQ== X-Gm-Message-State: AOJu0YwSaaBB0keZzq6oD2gn9Eg23tsX1Bfa0IKUTVMXE3GoAToMkp0E kv3IGNBmSeKaGDyGKq1Hj82EJtEIA/VcYzBmvbexJiFOAocczJPS4Hz7on4Ajume8cv8NNZXCxh I X-Google-Smtp-Source: AGHT+IFrCtNnDxLV9mdPl+IEdRjqO2zb6dmQKfr9A62yysxW6BEXU4Fuq9niM0mqy0Ztra9idjXhRA== X-Received: by 2002:a17:906:794d:b0:a79:8318:288f with SMTP id a640c23a62f3a-a7dc4e45470mr977941266b.16.1722948877958; Tue, 06 Aug 2024 05:54:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" , BALATON Zoltan Subject: [PULL 26/28] hw/pci-host/gt64120: Reset config registers during RESET phase Date: Tue, 6 Aug 2024 14:51:54 +0200 Message-ID: <20240806125157.91185-27-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949360156116600 Reset config values in the device RESET phase, not only once when the device is realized, because otherwise the device can use unknown values at reset. Since we are adding a new reset method, use the preferred Resettable API (for a simple leaf device reset, a DeviceClass::reset method and a ResettableClass::reset_hold method are essentially identical). Reported-by: Michael S. Tsirkin Reviewed-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20240802213122.86852-3-philmd@linaro.org> --- hw/pci-host/gt64120.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index 573d2619ee..33607dfbec 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -1217,17 +1217,24 @@ static void gt64120_pci_realize(PCIDevice *d, Error= **errp) { /* Values from chapter 17.16 "PCI Configuration" */ =20 - pci_set_word(d->config + PCI_COMMAND, 0); - pci_set_word(d->config + PCI_STATUS, - PCI_STATUS_FAST_BACK | PCI_STATUS_DEVSEL_MEDIUM); - pci_config_set_prog_interface(d->config, 0); - pci_set_long(d->wmask + PCI_BASE_ADDRESS_0, 0xfffff008); /* SCS[1:0] */ pci_set_long(d->wmask + PCI_BASE_ADDRESS_1, 0xfffff008); /* SCS[3:2] */ pci_set_long(d->wmask + PCI_BASE_ADDRESS_2, 0xfffff008); /* CS[2:0] */ pci_set_long(d->wmask + PCI_BASE_ADDRESS_3, 0xfffff008); /* CS[3], Boo= tCS */ pci_set_long(d->wmask + PCI_BASE_ADDRESS_4, 0xfffff000); /* ISD MMIO */ pci_set_long(d->wmask + PCI_BASE_ADDRESS_5, 0xfffff001); /* ISD I/O */ +} + +static void gt64120_pci_reset_hold(Object *obj, ResetType type) +{ + PCIDevice *d =3D PCI_DEVICE(obj); + + /* Values from chapter 17.16 "PCI Configuration" */ + + pci_set_word(d->config + PCI_COMMAND, 0); + pci_set_word(d->config + PCI_STATUS, + PCI_STATUS_FAST_BACK | PCI_STATUS_DEVSEL_MEDIUM); + pci_config_set_prog_interface(d->config, 0); =20 pci_set_long(d->config + PCI_BASE_ADDRESS_0, 0x00000008); pci_set_long(d->config + PCI_BASE_ADDRESS_1, 0x01000008); @@ -1243,7 +1250,9 @@ static void gt64120_pci_class_init(ObjectClass *klass= , void *data) { PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 + rc->phases.hold =3D gt64120_pci_reset_hold; k->realize =3D gt64120_pci_realize; k->vendor_id =3D PCI_VENDOR_ID_MARVELL; k->device_id =3D PCI_DEVICE_ID_MARVELL_GT6412X; --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949056; cv=none; d=zohomail.com; s=zohoarc; b=MWB++K4IltEDUfgVjI8AFxafMov1RudcwbI4TXElgD8lETurJ1jT15rk8yqZjqK+2YjpaKpmjBV9ESv1pCZ0b1v2lxfcScn9gYEKyNDAcMoE5sO4jge5dh2kDrCDS/lQNR5g68d64WlEOaE7gWmjmoXcMZ3mwhPPNfC4UfZflFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949056; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mHh1GCcnST+B2sXjSnUGRo9NlbeZggGy0/xN/r51vXs=; b=OmoOXez1egH7EnxklPLMXrJNxzK0Ilp9s81w6pqyvhKuZYUi7LiGny8p/hlBhX28M5WNx0wtLQYuLYdhGqQozMOsApRfZGxEqhIIjW3xwG9AfQapwNraTeHWlEVTJUjv0XZnTWbuAwh3jihq969gPN6P+nYpVLfIYwowkrUV21Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949056456563.0941949416952; Tue, 6 Aug 2024 05:57:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJjU-000759-Gx; Tue, 06 Aug 2024 08:56:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJiD-0002RH-5w for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:53 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJiB-0000Qw-Cm for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:48 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a7b2dbd81e3so81830966b.1 for ; Tue, 06 Aug 2024 05:54:45 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e80e77sm541169966b.169.2024.08.06.05.54.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948884; x=1723553684; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mHh1GCcnST+B2sXjSnUGRo9NlbeZggGy0/xN/r51vXs=; b=Fy3VdGmRjdUPQX1AMXn7wnG2RMQvhxW0p0DTLLQ/bCrlEi53dXJrE+2Qq7vxKLE2l6 4mnvJC/+9GMB83VGC46T/Z8cFNdEX3CvogTn0mezbZ8bjLYJf9fEB4ZZKoc95+QIsNxD Ja3feSDRbTWWz2yNEkWtpKBnul0vr0EtngIYUYOCyqJkVnelBK9ympQQv0+Sp5Q+RFT/ P68LIiVkbJT6i9FLYfkZAO9gBRXMnCtN0PY5WwDneoTzlY5Jgi1dEgH6qaJXVvvPJZ77 L6AB3MZR/zBNG/0dmritFpN1E9H7jGjjh63SbfI9u/x/LA+j21UrR5RYF2jNDBAuEo15 pTPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948884; x=1723553684; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mHh1GCcnST+B2sXjSnUGRo9NlbeZggGy0/xN/r51vXs=; b=GhuvFiz4zHBBppAbXZd91bbp1w6rqRGgZ4bhjMoN5eiDg/x15MZ4nzBeiIq6owJ5A2 DHlVM8/Xw2DSIaYNDLXRCGfqj9kMPaRqGW1YWNK+8r3YlMUusaMEl6I5345A+yVXGoGs t7x6MKeeN34qAR4jEHVD3AQEVtOP0Kpoz8tF6DiemQSikTJkQHJmaizELmuSIMJkkXdo u8SdP33xWnOILMCPaOJ7Xk1YsKGzOn+uVDeyHLBPBrRBv5SksYXgFIKGzIYShlhliJDn Fi11xfbAogv4ulHIILMXLIfIwA4UmEFnFYXet2TAOcPtYUS/tsbCELaOoVuupIvHt8o1 1OVg== X-Gm-Message-State: AOJu0YyO+u9Lp4ub3pjC6kSuAxbqbF0TAEGq7nU5FU9K7ja7bZ1xruo+ nF080L4YSJcxnRJJDm1ZAJjXCp2EOTl6mpkMpPbkQM3hT/cLToQfHM3wfcSqbU9jRFyMPRPmOLh i X-Google-Smtp-Source: AGHT+IE3lpmer7jwcaxfjWPfCrJ3cJok33zbvdGdK5O9H8+NFgrpYp9KVyjvnBdtMkUOB2ZHHkvZOg== X-Received: by 2002:a17:907:9721:b0:a77:c26c:a571 with SMTP id a640c23a62f3a-a7dc509f309mr1087709166b.54.1722948883815; Tue, 06 Aug 2024 05:54:43 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: George Matsumura , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 27/28] docs/specs/pci-ids: Add missing devices Date: Tue, 6 Aug 2024 14:51:55 +0200 Message-ID: <20240806125157.91185-28-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949058745116600 From: George Matsumura Add the missing devices 1b36:000c (PCIe root port) and 1b36:000e (PCIe-to-PCI bridge). Signed-off-by: George Matsumura Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240805031012.16547-2-gorg@gorgnet.net> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- docs/specs/pci-ids.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/specs/pci-ids.rst b/docs/specs/pci-ids.rst index c0a3dec2e7..0de13de1e4 100644 --- a/docs/specs/pci-ids.rst +++ b/docs/specs/pci-ids.rst @@ -82,8 +82,12 @@ PCI devices (other than virtio): PCI-PCI bridge (multiseat) 1b36:000b PCIe Expander Bridge (-device pxb-pcie) +1b36:000c + PCIe Root Port (``-device pcie-root-port``) 1b36:000d PCI xhci usb host adapter +1b36:000e + PCIe-to-PCI bridge (``-device pcie-pci-bridge``) 1b36:000f mdpy (mdev sample device), ``linux/samples/vfio-mdev/mdpy.c`` 1b36:0010 --=20 2.45.2 From nobody Sun Nov 24 11:30:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722949274; cv=none; d=zohomail.com; s=zohoarc; b=U10Wi5QCGwwhala+0mjdjSzxdG9OVNCv+9xg/bxCaDEz1GbzYWbJFWbyx/YKdeA2XIOhEtPRBRmqiUnb/N2BDgnF/ezOcmrDG6HQae6i85s6gkmHgJGYQUpQGQIR45XDKa4qp5HcjHS+08R0j2egED5+khDznBE7J1PkcyAmpPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722949274; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=77mKDDwsQ4N9EU0OpMBcpTovtWIwsiedBtivnY0Iukw=; b=eMw6SwqI4xKpTxy2DeOuv5iDQfvJRY04/gP6A+HsNOSd0PngicCnj8RekJdl5i+9J1Z2SlBUwVGctt05Ak8KgY820Qj1UMwyPhb3tm9B7V3Mpnk89YagBqY8mEcCWH6kcUZzlhR4fgkKpdF4b7stcuUXzt6Rsf2H/NsZBXH4+/8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722949274897793.4547083007975; Tue, 6 Aug 2024 06:01:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJk8-0002Rz-Oi; Tue, 06 Aug 2024 08:56:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJiI-0002no-0v for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:55 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJiF-0000UT-IL for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:54:53 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2f16d2f2b68so10343971fa.3 for ; Tue, 06 Aug 2024 05:54:51 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e7fe2fsm548850866b.178.2024.08.06.05.54.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948889; x=1723553689; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=77mKDDwsQ4N9EU0OpMBcpTovtWIwsiedBtivnY0Iukw=; b=Qu2lRgvtWUoBdhyQV+WuXtEl9UdPNHwrsSQ8XP9xCBMeBlGAUeFrIMD+i83YjlUpGT yPelIYWqg/yXP4VKDsHyLmk/mag4luvj6xtakq/DNWFXLkSsaPd6gqmDJ5o2S4YVlu4b S73st1jgwnPifxnuZbFYhF8bwEE6Tj4cd6ukZ88GKfqX4fG336I99e6VCb+bsftIKOjz t+C7fjYr2g/DAlgLPCFT4rmc8pVKea/CLVcLKSNM3tZz6zW6YLh0FTJkAiLGTgMcfKop u2/SRWqzEBrvVuGTKTW8MU5I4GxkrGY5abGm8+NWqvax0DXjK7rbOVzym4N6k6v6vKyg DgeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948889; x=1723553689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=77mKDDwsQ4N9EU0OpMBcpTovtWIwsiedBtivnY0Iukw=; b=gMuQ91hw0nW6aXKgNic9I0BOP1mLN2sS12c4euzWllle+O44XAYsANuaDX4MITTyxc PBS4GjPi3UCAA5/l5CVSIepnY5ukNHZfKvIgk5Z0Z+tppXbmAbQtKtEOpMoLEJRNUuGx 3JXK8yrA/LrDvj2PEJta63YdzyDZmmV+NQl/P3v2XBipQrMM22ssnWqWCtLyjk8UthH+ xDuSSgHgQN2sUGuWdYEq+53Ui//gfTsKKHMUCg9vxN45nnacoTNn8epEWcfIas6BKO02 h0GnOfRLZwrU6RmRXue9OC4tX6yty9n0oWPKkVnTHqi57/mhDTfU/3W7Dv/VHvanKxXb yNUA== X-Gm-Message-State: AOJu0YxPg82aq7W6pDCBn/oGqel0q0LgHAxo4jDBUOgdnTGtf/Vl/4Rh jTOz/7cJ/tFke8Q5LxdN1fQZUKlusExi8B+63v8sQEQv9TjHVfeLWviLH6Ih0LajFZrgFkwrCJQ V X-Google-Smtp-Source: AGHT+IGPJ76mc/UQH9XLaxpy2CfyQDntSF5wjLya5+pAlsgmZ8swYga5cElYxvfYK29b00l582g1iQ== X-Received: by 2002:a2e:8703:0:b0:2ef:1b1b:7f42 with SMTP id 38308e7fff4ca-2f15ab2a580mr118277291fa.36.1722948889440; Tue, 06 Aug 2024 05:54:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: George Matsumura , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 28/28] docs/specs/pci-ids: Fix markup Date: Tue, 6 Aug 2024 14:51:56 +0200 Message-ID: <20240806125157.91185-29-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722949275851116600 From: George Matsumura This fixes the markup of the PCI and PCIe Expander Bridge entries to be consistent with the rest of the file. Signed-off-by: George Matsumura Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240805031012.16547-4-gorg@gorgnet.net> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- docs/specs/pci-ids.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/specs/pci-ids.rst b/docs/specs/pci-ids.rst index 0de13de1e4..328ab31fe8 100644 --- a/docs/specs/pci-ids.rst +++ b/docs/specs/pci-ids.rst @@ -77,11 +77,11 @@ PCI devices (other than virtio): 1b36:0008 PCIe host bridge 1b36:0009 - PCI Expander Bridge (-device pxb) + PCI Expander Bridge (``-device pxb``) 1b36:000a PCI-PCI bridge (multiseat) 1b36:000b - PCIe Expander Bridge (-device pxb-pcie) + PCIe Expander Bridge (``-device pxb-pcie``) 1b36:000c PCIe Root Port (``-device pcie-root-port``) 1b36:000d --=20 2.45.2