From owner-svn-src-stable@freebsd.org Fri Aug 7 15:59:47 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 726293BE101; Fri, 7 Aug 2020 15:59:47 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVRj5rpCz4Zlf; Fri, 7 Aug 2020 15:59:45 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qk1-x742.google.com with SMTP id 2so2125138qkf.10; Fri, 07 Aug 2020 08:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=x1PzYLAw+xmWTVxqMvqjIV/lEXuwS0BX59/r6I/K+I8=; b=ZuZEXv9dLKg4RfV/L4Td7/MPG4b4Lpcqd0N2fn/I7OgK6HUV90YFtVhcLZ60kb3Ym5 mfiMs7MOCTzmi0Yq5nDFa7IxWIA7pm+XXVvPHGfQUT31I4rh/f2TFp4Z0qagftRPPtqW K0ySmx7mrmXY0sDM5P4K50w+kC9FFEM+iF2xtoaDH++FurCpq/vEAZ8s8L8b+cqE69qq XYYgUjX0VUGZ1YR/xk9IkewB8/HvhDdGrdK09Gm5MqrLAxMB2SDdMsJQzgO0yS6LLSDN t/kj2tOBK0yMi2AbaKjWbzxZKDM3A3IeqPt0L88URKUGElPGg6CSHRToheZgZXPS/YsX d/5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=x1PzYLAw+xmWTVxqMvqjIV/lEXuwS0BX59/r6I/K+I8=; b=eiT51N7dzAbaEMZgw5wEjXFgpb/W4Hm2lWqwXSkE/429J6ovVnmSisZuFD6jbcg8hT D0zXoFd9R18MqovKFUC5fvLllOGPS69mLqFN6xQzAwohP3G0uFCQ3PTvxeBkgBW2Tx30 xjM6qHV2vl5F/LOecEO1dOW1MmprsAYzLVGndx0ZLdXwD59myxBt/MKckEh0UY6w+5wj oW2cUGXEGZv2PNJfLTRmvYsKbo0451Zk2q9GQbIQ16EQaNTdldR62TSpETgNNlg9k43H t0182yddkT8TY4zV0s7b+T3/BgluKezq6uDta/Nw2IWDZyEq5/5CUhkhceG3qyWMB0Qm Aenw== X-Gm-Message-State: AOAM530BFbtz4ce4FO0T+sV7fF6qbsl91kYZhAwptgok94Yvd5H95w9c upI8aKrVwHTY10O4+aNvGf8UmqX1 X-Google-Smtp-Source: ABdhPJw7UdHF3nOnrD3Y0QIChBcYC/OE8wveoNgTGQb9Eg9EUfGum7n0BCVOOMsG4XHvGDoyrlltgw== X-Received: by 2002:a37:6644:: with SMTP id a65mr14231354qkc.4.1596815984411; Fri, 07 Aug 2020 08:59:44 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id n33sm6646891qtd.43.2020.08.07.08.59.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2020 08:59:41 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r364003 - in stable/12/sys: arm64/arm64 arm64/include conf dev/acpica dev/pci x86/include x86/x86 From: Alexander Motin To: "Jack L." Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202008070105.07715AZJ073437@repo.freebsd.org> <90100f43-7fe6-6b24-7417-5e2ded25f1be@FreeBSD.org> Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= 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 Message-ID: <0e04d927-01cf-bc9c-aad5-05c1656fe388@FreeBSD.org> Date: Fri, 7 Aug 2020 11:59:40 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <90100f43-7fe6-6b24-7417-5e2ded25f1be@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BNVRj5rpCz4Zlf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ZuZEXv9d; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::742 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-2.29 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-0.86)[-0.862]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.84)[-0.840]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.38)[-0.384]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::742:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2020 15:59:47 -0000 I'm sorry, it was my fault. Should be fixed by r364020. But I'd still look on the data just out of curiosity. On 07.08.2020 09:12, Alexander Motin wrote: > Do you mean you are getting two apeiX devices? That is unexpected. > Could you send me `devinfo -vr` and `acpidump -t` outputs? And lets go > private for debugging. > > On 07.08.2020 04:58, Jack L. wrote: >> I'm getting >> apei1 platform error interface >> after installing the kernel with this commit on multiple Dell R610 servers. >> >> On Thu, Aug 6, 2020 at 6:05 PM Alexander Motin wrote: >>> >>> Author: mav >>> Date: Fri Aug 7 01:05:10 2020 >>> New Revision: 364003 >>> URL: https://svnweb.freebsd.org/changeset/base/364003 >>> >>> Log: >>> MFC r363624: Add initial driver for ACPI Platform Error Interfaces. >>> >>> APEI allows platform to report different kinds of errors to OS in several >>> ways. We've found that Supermicro X10/X11 motherboards report PCIe errors >>> appearing on hot-unplug via this interface using NMI. Without respective >>> driver it ended up in kernel panic without any additional information. >>> >>> This driver introduces support for the APEI Generic Hardware Error Source >>> reporting via NMI, SCI or polling. It decodes the reported errors and >>> either pass them to pci(4) for processing or just logs otherwise. Errors >>> marked as fatal still end up in kernel panic, but some more informative. >>> >>> When somebody get to native PCIe AER support implementation both of the >>> reporting mechanisms should get common error recovery code. Since in our >>> case errors happen when the device is already gone, there is nothing to >>> recover, so the code just clears the error statuses, practically ignoring >>> the otherwise destructive NMIs in nicer way. >>> >>> Relnotes: yes >>> Sponsored by: iXsystems, Inc. >>> >>> Added: >>> stable/12/sys/dev/acpica/acpi_apei.c >>> - copied, changed from r363624, head/sys/dev/acpica/acpi_apei.c >>> Modified: >>> stable/12/sys/arm64/arm64/machdep.c >>> stable/12/sys/arm64/include/acpica_machdep.h >>> stable/12/sys/conf/files >>> stable/12/sys/dev/acpica/acpi.c >>> stable/12/sys/dev/pci/pci.c >>> stable/12/sys/dev/pci/pcivar.h >>> stable/12/sys/x86/include/acpica_machdep.h >>> stable/12/sys/x86/x86/cpu_machdep.c >>> Directory Properties: >>> stable/12/ (props changed) >>> >>> Modified: stable/12/sys/arm64/arm64/machdep.c >>> ============================================================================== >>> --- stable/12/sys/arm64/arm64/machdep.c Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/arm64/arm64/machdep.c Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -131,6 +131,8 @@ void pagezero_cache(void *); >>> /* pagezero_simple is default pagezero */ >>> void (*pagezero)(void *p) = pagezero_simple; >>> >>> +int (*apei_nmi)(void); >>> + >>> static void >>> pan_setup(void) >>> { >>> >>> Modified: stable/12/sys/arm64/include/acpica_machdep.h >>> ============================================================================== >>> --- stable/12/sys/arm64/include/acpica_machdep.h Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/arm64/include/acpica_machdep.h Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -57,6 +57,8 @@ struct acpi_generic_address; >>> int acpi_map_addr(struct acpi_generic_address *, bus_space_tag_t *, >>> bus_space_handle_t *, bus_size_t); >>> >>> +extern int (*apei_nmi)(void); >>> + >>> #endif /* _KERNEL */ >>> >>> #endif /* __ACPICA_MACHDEP_H__ */ >>> >>> Modified: stable/12/sys/conf/files >>> ============================================================================== >>> --- stable/12/sys/conf/files Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/conf/files Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -740,6 +740,7 @@ dev/acpica/Osd/OsdSynch.c optional acpi >>> dev/acpica/Osd/OsdTable.c optional acpi >>> dev/acpica/acpi.c optional acpi >>> dev/acpica/acpi_acad.c optional acpi >>> +dev/acpica/acpi_apei.c optional acpi >>> dev/acpica/acpi_battery.c optional acpi >>> dev/acpica/acpi_button.c optional acpi >>> dev/acpica/acpi_cmbat.c optional acpi >>> >>> Modified: stable/12/sys/dev/acpica/acpi.c >>> ============================================================================== >>> --- stable/12/sys/dev/acpica/acpi.c Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/dev/acpica/acpi.c Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -151,6 +151,7 @@ static ACPI_STATUS acpi_device_scan_children(device_t >>> int max_depth, acpi_scan_cb_t user_fn, void *arg); >>> static int acpi_isa_pnp_probe(device_t bus, device_t child, >>> struct isa_pnp_id *ids); >>> +static void acpi_platform_osc(device_t dev); >>> static void acpi_probe_children(device_t bus); >>> static void acpi_probe_order(ACPI_HANDLE handle, int *order); >>> static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, >>> @@ -673,6 +674,8 @@ acpi_attach(device_t dev) >>> /* Register ACPI again to pass the correct argument of pm_func. */ >>> power_pm_register(POWER_PM_TYPE_ACPI, acpi_pm_func, sc); >>> >>> + acpi_platform_osc(dev); >>> + >>> if (!acpi_disabled("bus")) { >>> EVENTHANDLER_REGISTER(dev_lookup, acpi_lookup, NULL, 1000); >>> acpi_probe_children(dev); >>> @@ -1919,6 +1922,34 @@ acpi_enable_pcie(void) >>> alloc++; >>> } >>> #endif >>> +} >>> + >>> +static void >>> +acpi_platform_osc(device_t dev) >>> +{ >>> + ACPI_HANDLE sb_handle; >>> + ACPI_STATUS status; >>> + uint32_t cap_set[2]; >>> + >>> + /* 0811B06E-4A27-44F9-8D60-3CBBC22E7B48 */ >>> + static uint8_t acpi_platform_uuid[ACPI_UUID_LENGTH] = { >>> + 0x6e, 0xb0, 0x11, 0x08, 0x27, 0x4a, 0xf9, 0x44, >>> + 0x8d, 0x60, 0x3c, 0xbb, 0xc2, 0x2e, 0x7b, 0x48 >>> + }; >>> + >>> + if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle))) >>> + return; >>> + >>> + cap_set[1] = 0x10; /* APEI Support */ >>> + status = acpi_EvaluateOSC(sb_handle, acpi_platform_uuid, 1, >>> + nitems(cap_set), cap_set, cap_set, false); >>> + if (ACPI_FAILURE(status)) { >>> + if (status == AE_NOT_FOUND) >>> + return; >>> + device_printf(dev, "_OSC failed: %s\n", >>> + AcpiFormatException(status)); >>> + return; >>> + } >>> } >>> >>> /* >>> >>> Copied and modified: stable/12/sys/dev/acpica/acpi_apei.c (from r363624, head/sys/dev/acpica/acpi_apei.c) >>> ============================================================================== >>> --- head/sys/dev/acpica/acpi_apei.c Mon Jul 27 21:19:41 2020 (r363624, copy source) >>> +++ stable/12/sys/dev/acpica/acpi_apei.c Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -574,7 +574,7 @@ apei_probe(device_t dev) >>> if (acpi_find_table(ACPI_SIG_HEST) == 0) >>> return (ENXIO); >>> if (acpi_get_handle(dev) != NULL) >>> - rv = ACPI_ID_PROBE(device_get_parent(dev), dev, apei_ids, NULL); >>> + rv = (ACPI_ID_PROBE(device_get_parent(dev), dev, apei_ids) != NULL); >>> else >>> rv = 0; >>> if (rv <= 0) >>> >>> Modified: stable/12/sys/dev/pci/pci.c >>> ============================================================================== >>> --- stable/12/sys/dev/pci/pci.c Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/dev/pci/pci.c Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -6284,6 +6284,67 @@ pcie_get_max_completion_timeout(device_t dev) >>> } >>> } >>> >>> +void >>> +pcie_apei_error(device_t dev, int sev, uint8_t *aerp) >>> +{ >>> + struct pci_devinfo *dinfo = device_get_ivars(dev); >>> + const char *s; >>> + int aer; >>> + uint32_t r, r1; >>> + uint16_t rs; >>> + >>> + if (sev == PCIEM_STA_CORRECTABLE_ERROR) >>> + s = "Correctable"; >>> + else if (sev == PCIEM_STA_NON_FATAL_ERROR) >>> + s = "Uncorrectable (Non-Fatal)"; >>> + else >>> + s = "Uncorrectable (Fatal)"; >>> + device_printf(dev, "%s PCIe error reported by APEI\n", s); >>> + if (aerp) { >>> + if (sev == PCIEM_STA_CORRECTABLE_ERROR) { >>> + r = le32dec(aerp + PCIR_AER_COR_STATUS); >>> + r1 = le32dec(aerp + PCIR_AER_COR_MASK); >>> + } else { >>> + r = le32dec(aerp + PCIR_AER_UC_STATUS); >>> + r1 = le32dec(aerp + PCIR_AER_UC_MASK); >>> + } >>> + device_printf(dev, "status 0x%08x mask 0x%08x", r, r1); >>> + if (sev != PCIEM_STA_CORRECTABLE_ERROR) { >>> + r = le32dec(aerp + PCIR_AER_UC_SEVERITY); >>> + rs = le16dec(aerp + PCIR_AER_CAP_CONTROL); >>> + printf(" severity 0x%08x first %d\n", >>> + r, rs & 0x1f); >>> + } else >>> + printf("\n"); >>> + } >>> + >>> + /* As kind of recovery just report and clear the error statuses. */ >>> + if (pci_find_extcap(dev, PCIZ_AER, &aer) == 0) { >>> + r = pci_read_config(dev, aer + PCIR_AER_UC_STATUS, 4); >>> + if (r != 0) { >>> + pci_write_config(dev, aer + PCIR_AER_UC_STATUS, r, 4); >>> + device_printf(dev, "Clearing UC AER errors 0x%08x\n", r); >>> + } >>> + >>> + r = pci_read_config(dev, aer + PCIR_AER_COR_STATUS, 4); >>> + if (r != 0) { >>> + pci_write_config(dev, aer + PCIR_AER_COR_STATUS, r, 4); >>> + device_printf(dev, "Clearing COR AER errors 0x%08x\n", r); >>> + } >>> + } >>> + if (dinfo->cfg.pcie.pcie_location != 0) { >>> + rs = pci_read_config(dev, dinfo->cfg.pcie.pcie_location + >>> + PCIER_DEVICE_STA, 2); >>> + if ((rs & (PCIEM_STA_CORRECTABLE_ERROR | >>> + PCIEM_STA_NON_FATAL_ERROR | PCIEM_STA_FATAL_ERROR | >>> + PCIEM_STA_UNSUPPORTED_REQ)) != 0) { >>> + pci_write_config(dev, dinfo->cfg.pcie.pcie_location + >>> + PCIER_DEVICE_STA, rs, 2); >>> + device_printf(dev, "Clearing PCIe errors 0x%04x\n", rs); >>> + } >>> + } >>> +} >>> + >>> /* >>> * Perform a Function Level Reset (FLR) on a device. >>> * >>> >>> Modified: stable/12/sys/dev/pci/pcivar.h >>> ============================================================================== >>> --- stable/12/sys/dev/pci/pcivar.h Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/dev/pci/pcivar.h Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -679,6 +679,7 @@ uint32_t pcie_read_config(device_t dev, int reg, int w >>> void pcie_write_config(device_t dev, int reg, uint32_t value, int width); >>> uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, >>> uint32_t value, int width); >>> +void pcie_apei_error(device_t dev, int sev, uint8_t *aer); >>> bool pcie_flr(device_t dev, u_int max_delay, bool force); >>> int pcie_get_max_completion_timeout(device_t dev); >>> bool pcie_wait_for_pending_transactions(device_t dev, u_int max_delay); >>> >>> Modified: stable/12/sys/x86/include/acpica_machdep.h >>> ============================================================================== >>> --- stable/12/sys/x86/include/acpica_machdep.h Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/x86/include/acpica_machdep.h Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -84,6 +84,7 @@ void madt_parse_interrupt_values(void *entry, >>> enum intr_trigger *trig, enum intr_polarity *pol); >>> >>> extern int madt_found_sci_override; >>> +extern int (*apei_nmi)(void); >>> >>> #endif /* _KERNEL */ >>> >>> >>> Modified: stable/12/sys/x86/x86/cpu_machdep.c >>> ============================================================================== >>> --- stable/12/sys/x86/x86/cpu_machdep.c Fri Aug 7 00:56:20 2020 (r364002) >>> +++ stable/12/sys/x86/x86/cpu_machdep.c Fri Aug 7 01:05:10 2020 (r364003) >>> @@ -811,6 +811,7 @@ int nmi_is_broadcast = 1; >>> SYSCTL_INT(_machdep, OID_AUTO, nmi_is_broadcast, CTLFLAG_RWTUN, >>> &nmi_is_broadcast, 0, >>> "Chipset NMI is broadcast"); >>> +int (*apei_nmi)(void); >>> >>> void >>> nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame) >>> @@ -825,6 +826,10 @@ nmi_call_kdb(u_int cpu, u_int type, struct trapframe * >>> panic("NMI indicates hardware failure"); >>> } >>> #endif /* DEV_ISA */ >>> + >>> + /* ACPI Platform Error Interfaces callback. */ >>> + if (apei_nmi != NULL && (*apei_nmi)()) >>> + claimed = true; >>> >>> /* >>> * NMIs can be useful for debugging. They can be hooked up to a >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- Alexander Motin