platform/upstream/dotnet/runtime.git
2 years agoHttpStress do not use SYS_PTRACE cap for docker runs (#76307)
Anton Firszov [Tue, 4 Oct 2022 16:13:45 +0000 (18:13 +0200)]
HttpStress do not use SYS_PTRACE cap for docker runs (#76307)

According to an offline discussion with engineering folks, there is no need for SYS_PTRACE on newer Linux kernels, so we can remove it for all platforms.

2 years agoCI: Fix triggers for pipeline changes (#76594)
Ankit Jain [Tue, 4 Oct 2022 15:59:16 +0000 (11:59 -0400)]
CI: Fix triggers for pipeline changes (#76594)

* CI: Fix triggers for pipeline changes

Revert to the earlier triggers which excluded coreclr, installer, or
mono ymls, for the relevant subsets. For example:

```yml
    subset: coreclr
    exclude:
      - eng/pipelines/installer/*
      - eng/pipelines/mono/*
      - eng/pipelines/libraries/*
```

Prompted by https://github.com/dotnet/runtime/pull/76057#issuecomment-1266509928

* C: trigger wasm jobs on wasm yml changes

2 years agoCI: Run `runtime-extra-platforms` with batched builds for release (#76587)
Ankit Jain [Tue, 4 Oct 2022 15:33:46 +0000 (11:33 -0400)]
CI: Run `runtime-extra-platforms` with batched builds for release (#76587)

.. branches.

Currently, for `release/*` branches, the pipeline is run twice a day, if
there are any changes since the last *successful* run. In contrast, the
`runtime` pipeline only runs batched builds for the release branches.

This can get into a situation like:
1. commit ABC pushed to the release branch
2. `runtime` builds for ABC -- batched build
3. `runtime-extra-platforms` builds on a schedule, but this pipeline is
   unstable, and fails.
4. `runtime-extra-platforms` now runs twice a day, till we have a new
   commit, because the pipeline is never green

Instead, this changes the behavior to match `runtime` pipeline, and only
run batched builds.

2 years agoSimplify marshalling of WEB_SOCKET_HTTP_HEADER (#76589)
Jan Kotas [Tue, 4 Oct 2022 15:25:11 +0000 (08:25 -0700)]
Simplify marshalling of WEB_SOCKET_HTTP_HEADER (#76589)

2 years agoUpdate dependencies from https://github.com/dotnet/linker build 20220927.2 (#76603)
dotnet-maestro[bot] [Tue, 4 Oct 2022 15:13:24 +0000 (15:13 +0000)]
Update dependencies from https://github.com/dotnet/linker build 20220927.2 (#76603)

[main] Update dependencies from dotnet/linker

2 years agoUpdate provider_compute_event_enable_mask so EventSouces with no keywords show up...
David Mason [Tue, 4 Oct 2022 09:16:29 +0000 (02:16 -0700)]
Update provider_compute_event_enable_mask so EventSouces with no keywords show up by default (#75248)

2 years agoWasmAppHost: block port# 5060 and 5061, for the webserver (#76485)
kasperk81 [Tue, 4 Oct 2022 08:15:20 +0000 (11:15 +0300)]
WasmAppHost: block port# 5060 and 5061, for the webserver (#76485)

2 years ago[LinuxBionic] Disable failing ProcessStartInfo tests on CI (#76585)
Steve Pfister [Tue, 4 Oct 2022 06:20:32 +0000 (02:20 -0400)]
[LinuxBionic] Disable failing ProcessStartInfo tests on CI (#76585)

A few ProcessStartInfo tests sometimes fail for strange reasons. Disabling until we can look further.

Addresses https://github.com/dotnet/runtime/issues/76140

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years ago[PERF][MAUI] Update net6.0 Maui nuget.config link (#76576)
Parker Bibus [Tue, 4 Oct 2022 05:30:44 +0000 (00:30 -0500)]
[PERF][MAUI] Update net6.0 Maui nuget.config link (#76576)

* Change the nuget.config path.

2 years agofix lower heap hard limit condition for regions (#76407)
Manish Godse [Tue, 4 Oct 2022 05:07:52 +0000 (22:07 -0700)]
fix lower heap hard limit condition for regions (#76407)

* fix lower heap hard limit condition for regions

* adjust region sizes based on individual heap sizes

* updated comment

* more tuning

* on more tuning update.

* fixing the case for per heap hard_limit and some styling changes.

* CR updates

2 years ago[wasm] Avoid unnecessarily zipping tests (#76580)
Ankit Jain [Tue, 4 Oct 2022 04:08:14 +0000 (00:08 -0400)]
[wasm] Avoid unnecessarily zipping tests (#76580)

`ZipTestArchive` gets called twice, once for wasm build, and for wasm
nested publish.

This saves about ~8mins on a full library tests build.

2 years agoUpdate Crst lock levels (#76553)
Aaron Robinson [Tue, 4 Oct 2022 03:52:14 +0000 (20:52 -0700)]
Update Crst lock levels (#76553)

* Update Crst lock levels

Add dependency between CrstCodeVersioning and CrstCOMWrapperCache

* Add FrozenObjectHeap Crst to def file

* Rename crsttypes.h to have _generated suffix

2 years agoFix Interop.Gdi32.StartDoc p/invoke (#76569)
Elinor Fung [Tue, 4 Oct 2022 02:54:32 +0000 (19:54 -0700)]
Fix Interop.Gdi32.StartDoc p/invoke (#76569)

StartDoc takes a pointer to a DOCINFO struct. We had DOCINFO defined as a class on the managed side such that built-in marshalling would marshal it as a pointer. With the switch to custom marshalling via NativeMarshalling, we ended up marshalling the struct that is the native representation rather than a pointer to it.

This switches the DOCINFO to a struct and updates the parameter to StartDoc to be in, such that it should be marshalled as a pointer to the struct by both generated and built-in marshalling.

2 years agoSystem.Private.Xml AOT compatibility fixes (#76473)
Jeremy Koritzinsky [Tue, 4 Oct 2022 02:45:03 +0000 (19:45 -0700)]
System.Private.Xml AOT compatibility fixes (#76473)

* Fix AOT warnings from using the linker xml support in crossgen2.

* Revise message to better explain why these types will be available.

* Remove suppressions and change implementation to not require suppressions.

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoFixing where `ClearContained` is called for certain Arm64 cast ops (#76517)
Tanner Gooding [Tue, 4 Oct 2022 02:26:37 +0000 (19:26 -0700)]
Fixing where `ClearContained` is called for certain Arm64 cast ops (#76517)

2 years agoAOT Runtime.Base: Change AttributeTargets and AttributeUsageAttribute to public ...
Charles Stoner [Tue, 4 Oct 2022 01:50:26 +0000 (18:50 -0700)]
AOT Runtime.Base: Change AttributeTargets and AttributeUsageAttribute to public (#76573)

* Change nativeaot attribute types to public

* Remove noRefSafetyRulesAttribute

2 years agoRemove encoding allocations for System.Security.Xml (#76364)
Krzysztof Wicher [Mon, 3 Oct 2022 23:31:18 +0000 (01:31 +0200)]
Remove encoding allocations for System.Security.Xml (#76364)

* Remove encoding allocations for System.Security.Xml

* Use Encoding.UTF8 directly

2 years agoImprove FormattingHelper.CountDigit(uint) (#76519)
Stephen Toub [Mon, 3 Oct 2022 23:09:24 +0000 (19:09 -0400)]
Improve FormattingHelper.CountDigit(uint) (#76519)

Branch-free, table-based lookup implementation.

2 years ago[wasm] Wasm.Build.Tests improvements (#76381)
Ankit Jain [Mon, 3 Oct 2022 22:42:38 +0000 (18:42 -0400)]
[wasm] Wasm.Build.Tests improvements (#76381)

* InstallWorkloadFromArtifacts: Remove hack because we have an updated sdk now

* [wasm] WBT: Make project names unique

* [wasm] WBT: Use a clean NUGET_PACKAGES dir separate from the project directory

* [wasm] WBT: Fixes to work with latest sdk

- Use only one source of which tfm to use
- Allow a different tfm for blazor
- Add `dotnet8` nuget feed for tests
- Support more than one choice for nuget.config, like for net7, or net8

* WBT: Revert to test projects created in bindir, instead of a temp one

This was necessary because on windows the tmp path is very long, causing
the test project paths to become too long causing build failures.

* [wasm] fix weird build failures

`MSBuildSDKsPath` is set by runtime repo, and that interferes with the
test projects. To avoid this the `MSBuildSDKsPath` was set to `""` in
the test environment. But even that can negatively affect the build
because msbuild treats environment variables as "global properties" that
cannot be changed. This manifests when running:

`$ dotnet run --no-build`

.. it would fail with `/foo/bar.csproj is not a valid project file`.

Instead, explicitly *remove* `MSBuildSDKsPath` from the environment when
invoking the process.

* WBT: PInvokeTableGenerator: Find path to WasmAppBuilder.dll at test time

.. instead of depending on *one* runtime pack version. This is needed
when we have more than one workload installed.

* WBT: Don't use the nuget packages directory as fallback.

.. because we explicitly set `NUGET_PACKAGES` envvar now.

* [wasm] Use the latest sdk for Wasm.Build.Tests

* WBT: Add missing nuget8.config

* WBT: workaround for https://github.com/dotnet/runtime/issues/76201

* WasmAppHost: add rollforward=latestMajor

2 years agoUpdating Vector256 to have its software fallback be 2x Vector128<T> ops (#76221)
Tanner Gooding [Mon, 3 Oct 2022 22:22:25 +0000 (15:22 -0700)]
Updating Vector256 to have its software fallback be 2x Vector128<T> ops (#76221)

* Updating Vector256<T> to be implemented as 2x Vector128<T> ops

* Updating Vector256 to be implemented as 2x Vector128<T> ops

* Simplify the NRE handling

* A couple of small bug fixes

* Ensure MONO_TYPE_I and MONO_TYPE_U are handled in simd-intrinsics

* Ensure generic paths are handled for SN_CreateScalar and SN_CreateScalarUnsafe

* Ensure nint/nuint are handled in the relevant fallback paths

* Fixing braces to match mono code-styling

* Fixing the "Any" implementation to use `||`

* Fixing Narrow and Widen

* Use Unsafe.ReadUnaligned for the software fallback of Vector256.AsVector()

* Adjust an assert in fgMorphMultiregStructArg to account for certain Unsafe.As reinterprets

2 years agoTar: Use indexer setter instead of Add on ExtendedAttributes dictionary (#76404)
David Cantú [Mon, 3 Oct 2022 20:45:37 +0000 (15:45 -0500)]
Tar: Use indexer setter instead of Add on ExtendedAttributes dictionary (#76404)

* Use indexer setter instead of Add on ExtendedAttributes dictionary

* Add roundtrip tests

* Fix TryAddStringField and always set mtime

2 years agoSplit runtime-extra-platforms into distinct pipelines (#76328)
Jo Shields [Mon, 3 Oct 2022 20:39:29 +0000 (16:39 -0400)]
Split runtime-extra-platforms into distinct pipelines (#76328)

When making targeted changes to mobile platforms, you can now run more granular CI pipelines as opposed to the runtime-extra-platforms catch-all.

Closes: #75002

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years agoupdate arm32 test queues for msquic (#76267)
Tomas Weinfurt [Mon, 3 Oct 2022 20:31:17 +0000 (13:31 -0700)]
update arm32 test queues for msquic (#76267)

* update arm32 test queues for msquic

* add linux_arm run

* force library change

* force library change

* revert arm

* update test images

* update test runs

* erevert pipeline change

* remove extra change

2 years agoUpdate to latest .NET 7 Roslyn compiler (#76459)
Jared Parsons [Mon, 3 Oct 2022 20:28:32 +0000 (13:28 -0700)]
Update to latest .NET 7 Roslyn compiler (#76459)

* Patches for scoped locals

https://github.com/dotnet/roslyn/pull/64093

This change enforced that `scoped` on a local set the escape scope to
the current block where previously it was incorrectly setting to the
containing method.

* Make return and out equivalent for ref safety

https://github.com/dotnet/roslyn/pull/64318

This change allows anything returnable from a method to be assigned to
an `out` parameter. In several places had to add `scoped` to `ref` to
inform compiler they could not be captured in an `out` parameter.

* Warnings on managed pointer types

https://github.com/dotnet/roslyn/pull/64294

Compiler now issues warnings for pointer operations involving managed
types

* Update compiler version

* PR feedback

* Ref safety rules attribute

Co-authored-by: Charles Stoner <10732005+cston@users.noreply.github.com>
2 years agoChange mono interpreter runs to use perfampere logicalmachine as the a64 machines...
Parker Bibus [Mon, 3 Oct 2022 20:11:10 +0000 (15:11 -0500)]
Change mono interpreter runs to use perfampere logicalmachine as the a64 machines have been deprecated. (#76564)

2 years ago[main] Update dependencies from 7 repositories (#76241)
dotnet-maestro[bot] [Mon, 3 Oct 2022 19:58:10 +0000 (19:58 +0000)]
[main] Update dependencies from 7 repositories (#76241)

[main] Update dependencies from 7 repositories

 - Merge branch 'main' into darc-main-99df2084-4788-4b0c-8601-dad98cd6864d

2 years ago[Android] Fix NetworkInterface.GetAllNetworkInterfaces on API 21-23 (#76541)
Simon Rozsival [Mon, 3 Oct 2022 19:52:54 +0000 (21:52 +0200)]
[Android] Fix NetworkInterface.GetAllNetworkInterfaces on API 21-23 (#76541)

* Bring back pal_ifaddrs

* Update the header file

2 years agoSPMI: Avoid division by zero (#76544)
Jakob Botsch Nielsen [Mon, 3 Oct 2022 19:23:03 +0000 (21:23 +0200)]
SPMI: Avoid division by zero (#76544)

With the MinOpts/FullOpts split it is common/expected to see some of
these being completely empty, and we hit DivisionByZero in those cases.

Fix #76542

2 years agoJIT: Ensure no overflow in ContainBlockStoreAddress (#76532)
Jakob Botsch Nielsen [Mon, 3 Oct 2022 19:18:13 +0000 (21:18 +0200)]
JIT: Ensure no overflow in ContainBlockStoreAddress (#76532)

The offset here can be a "base" address due to various JIT
transformations so we should ensure the range [offset, offset+size) does
not overflow.

Fix #76506

2 years ago[API Implementation]: Expose general purpose Crc32 APIs (#61558)
Robin Lindner [Mon, 3 Oct 2022 19:00:50 +0000 (21:00 +0200)]
[API Implementation]: Expose general purpose Crc32 APIs (#61558)

* Expose Crc32 Implementation and implement Crc32 software fallback

* Fix signature of BitOperation Crc32 methods

* Implement common test cases

* Add X64 Intrinsic support for Crc32(uint crc, ulong data)

* Add documentation comments

* Remove Hwintrinsic doc-comment

* Rename Crc32 to Crc32C

* Remove unnessecary heap allocation

* Fix software fallback using table-based-CRC

* Usage of uint32_t __crc32ch (uint32_t a, uint32_t b)

* Remove Crc.Sse42 implementation for Crc32C(uint crc, ulong data)

There is no implementation which returns `uint32_t`. See https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#techs=MMX,SSE,SSE2,SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2,FMA,AVX_VNNI,AVX_512,KNC,AMX,SVML,Other&text=crc

* Add SSE 4.2 x64 implementation with byte truncation for Crc32C(uint crc, ulong data)

* Replace Unsafe.As with unchecked-uint cast

* Usage of WriteUnaligned instead of As

Co-authored-by: Günther Foidl <gue@korporal.at>
* Usage of WriteUnaligned instead of As

Co-authored-by: Günther Foidl <gue@korporal.at>
* Usage of WriteUnaligned instead of As

Co-authored-by: Günther Foidl <gue@korporal.at>
* Usage of explicit types

* Fix Software-Fallback Table to Castalogni equivalent

* Fix test signature

* Remove mask for software fallback

* reuse reflected table generator

* Fix test data

* Usage of CRC Table Generator instead of constant values

* Fix solution file

* Revert "Usage of CRC Table Generator instead of constant values"

This reverts commit d44a2151b917a1650d844da98f82d50bfad479ce.

* Fix solution file

* Make Crc32ReflectedTable static

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
* Fix wrong intrinsic for Arm64/BitOperations.Crc32C(uint crc, ulong data)

* Reduce amount of stackalloc statements and replace them with MemoryMarshal.CreateReadOnlySpan

* Loop unwinding and performance optimization

* Remove unnessecary cast

Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
* Use MemoryMarshal.GetArrayDataReference instead of direct array access

* Remove unnessecary newlines

* Update src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
* Add x64 SSE check

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
* Move Crc32 Software into own class

* Remove IsSupported check

* Fix parameter naming

* Fix fallback implementation method naming

* Improve documentation

* Move bswap into Crc32Fallback class

* Implement efficient usage of SSE x86/x64

Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
* Style Changes for BitOperations.cs

* Remove unnessecary `bswap` of a single byte

* Fix doc comments

* fix doc

* Fix

* Merge remote-tracking branch 'upstream/main' into issue-2036

* Apply suggestions

Co-authored-by: Günther Foidl <gue@korporal.at>
Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
2 years ago[PERF] Pass local runtime timestamp from git into ci_setup (#76396)
Parker Bibus [Mon, 3 Oct 2022 16:48:37 +0000 (11:48 -0500)]
[PERF] Pass local runtime timestamp from git into ci_setup (#76396)

* Adds passing of locally obtained git commit time to ci_setup allowing for the bypassing of calling the github.com api.

* Added use local commit time to run-scenarios yml.

* Fixed uselocalcommittime format for linux setup.

* Use correct quote style for passing time to ci_setup.py.

2 years agoAlign parameter default value resolution between coreCLR, Mono and NativeAOT runtimes...
Ivan Povazan [Mon, 3 Oct 2022 16:14:48 +0000 (18:14 +0200)]
Align parameter default value resolution between coreCLR, Mono and NativeAOT runtimes (#75612)

Fixes
https://github.com/dotnet/runtime/issues/49806
https://github.com/dotnet/runtime/issues/76174

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years ago[main] Update dependencies from dotnet/arcade (#75929)
dotnet-maestro[bot] [Mon, 3 Oct 2022 16:07:34 +0000 (11:07 -0500)]
[main] Update dependencies from dotnet/arcade (#75929)

* Update dependencies from https://github.com/dotnet/arcade build 20220920.1

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22470.1

* Update dependencies from https://github.com/dotnet/arcade build 20220920.3

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22470.3

* Update dependencies from https://github.com/dotnet/arcade build 20220921.2

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22471.2

* Update dependencies from https://github.com/dotnet/arcade build 20220922.1

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22472.1

* Update dependencies from https://github.com/dotnet/arcade build 20220923.1

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22473.1

* Update dependencies from https://github.com/dotnet/arcade build 20220926.4

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22476.4

* Update dependencies from https://github.com/dotnet/arcade build 20220927.1

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22477.1

* InstallWorkloadFromArtifacts: Remove hack because we have an updated sdk now

* [wasm] WBT: Make project names unique

* [wasm] WBT: Use a clean NUGET_PACKAGES dir separate from the project directory

* [wasm] WBT: Fixes to work with latest sdk

- Use only one source of which tfm to use
- Allow a different tfm for blazor
- Add `dotnet8` nuget feed for tests
- Support more than one choice for nuget.config, like for net7, or net8

* Revert to test projects created in bindir, instead of a temp one

This was necessary because on windows the tmp path is very long, causing
the test project paths to become too long causing build failures.

* [wasm] fix weird build failures

`MSBuildSDKsPath` is set by runtime repo, and that interferes with the
test projects. To avoid this the `MSBuildSDKsPath` was set to `""` in
the test environment. But even that can negatively affect the build
because msbuild treats environment variables as "global properties" that
cannot be changed. This manifests when running:

`$ dotnet run --no-build`

.. it would fail with `/foo/bar.csproj is not a valid project file`.

Instead, explicitly *remove* `MSBuildSDKsPath` from the environment when
invoking the process.

* PInvokeTableGenerator: Find path to WasmAppBuilder.dll at test time

.. instead of depending on *one* runtime pack version. This is needed
when we have more than one workload installed.

* WasmAppHost: allow rollForward to work with newer sdks

* Don't use the nuget packages directory as fallback.

.. because we explicitly set `NUGET_PACKAGES` envvar now.

* [wasm] Use the latest sdk for Wasm.Build.Tests

* Add missing nuget8.config

* WBT: workaround for https://github.com/dotnet/runtime/issues/76201

* Update dependencies from https://github.com/dotnet/arcade build 20220928.2

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22478.2

* Revert "WBT: workaround for https://github.com/dotnet/runtime/issues/76201"

This reverts commit 33e367920f106c5e01c3f488174ff2b50471ff6f.

* Revert "Add missing nuget8.config"

This reverts commit dec9861de6002f77471ecf8deafd7b94c9f5001e.

* Revert "[wasm] Use the latest sdk for Wasm.Build.Tests"

This reverts commit 3a15bdf787af5a75bf07b9f8afcea3d77b010870.

* Revert "Don't use the nuget packages directory as fallback."

This reverts commit 785504e474f7fd3fc6c07027e59edf1c476844a1.

* Revert "WasmAppHost: allow rollForward to work with newer sdks"

This reverts commit 28cfbcd190b09c9b0f7f6046e91ef4eeffac5b71.

* Revert "PInvokeTableGenerator: Find path to WasmAppBuilder.dll at test time"

This reverts commit 33dbf9892500e2a6375728f0b5c5eea062dd65bc.

* Revert "[wasm] fix weird build failures"

This reverts commit 1a731fb70c36b227359012fbceb622623b768d79.

* Revert "Revert to test projects created in bindir, instead of a temp one"

This reverts commit 57ff0dd4883469f5fa39b158017f48b1c101c338.

* Revert "[wasm] WBT: Fixes to work with latest sdk"

This reverts commit 0aa1b5a9813d3815754e9f9fd201044c33e7b31c.

* Revert "[wasm] WBT: Use a clean NUGET_PACKAGES dir separate from the project directory"

This reverts commit 0678940b38ccb2f10509bc6b5e674ba67cb4de10.

* Revert "[wasm] WBT: Make project names unique"

This reverts commit 55120ac60c3b53bdadd7f8a2348abe33c9db037b.

* Revert "InstallWorkloadFromArtifacts: Remove hack because we have an updated sdk now"

This reverts commit 60e9f8c1a938c4fc0dab2a66fcc8d8af579ffd98.

* Fix Wasm.Build.Tests failures

- Use latest sdk for testing
- Add dotnet8 feed, needed by blazorwasm templates

- Workaround a bug in 7.0 templates which will be fixed by
https://github.com/dotnet/runtime/pull/76373 . And this can be removed
once we have packages with that.

* WasmAppHost: Set rollForward=latestMajor to work with newer sdks

* Update dependencies from https://github.com/dotnet/arcade build 20220929.2

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22479.2

* Update dependencies from https://github.com/dotnet/arcade build 20220930.2

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22480.2

* Revert changes to source-build.yml

It was missing https://github.com/dotnet/arcade/pull/10782

* Update dependencies from https://github.com/dotnet/arcade build 20220930.2

Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.22469.1 -> To Version 8.0.0-beta.22480.2

* Revert changes again

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoJIT: don't forward sub qmarks to LCL_FLD assignments (#76524)
Andy Ayers [Mon, 3 Oct 2022 16:04:17 +0000 (09:04 -0700)]
JIT: don't forward sub qmarks to LCL_FLD assignments (#76524)

Morph is not quite ready for this yet.

Closes #76509.

2 years agoFix illumos-x64 build (#76497)
Adeel Mujahid [Mon, 3 Oct 2022 15:18:16 +0000 (18:18 +0300)]
Fix illumos-x64 build (#76497)

2 years ago[Android] Fix NetworkInterface.GetAllNetworkInterfaces (#76370)
Simon Rozsival [Mon, 3 Oct 2022 13:11:02 +0000 (15:11 +0200)]
[Android] Fix NetworkInterface.GetAllNetworkInterfaces (#76370)

* Revert "[Android] Port getifaddrs implementation from Xamarin.Android (#71943)"

This reverts commit 1de4a5ca073da24211fc4d427b2224da2212f372.

* Fix allocating memory block for interfaces and addresses on recent Android SDKs

* Detect loopback interface on Android

* Add comment with explanation

* Simplify the changes to be closer to the original code

* Fix build

* Fix typos

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
* Improve comment

* Indent using spaces instead of tabs

* Remove check for ifaddrs.h

* Add ANDROID_GETIFADDRS_WORKAROUND

* Update comment

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years ago[mono][sgen] Update memory load information after world is resumed (#76400)
Vlad Brezae [Mon, 3 Oct 2022 12:41:26 +0000 (15:41 +0300)]
[mono][sgen] Update memory load information after world is resumed (#76400)

Following recent cgroup support (https://github.com/dotnet/runtime/pull/74237), mono_determine_physical_ram_size is no longer safe to call during GC.

2 years agoEnsure NI_Vector256_GetLower has the right simdSize and improve codegen slightly...
Tanner Gooding [Mon, 3 Oct 2022 12:22:24 +0000 (05:22 -0700)]
Ensure NI_Vector256_GetLower has the right simdSize and improve codegen slightly (#76456)

2 years ago[wasm] add missing API xml doc (#76196)
Pavel Savara [Mon, 3 Oct 2022 11:00:05 +0000 (13:00 +0200)]
[wasm] add missing API xml doc (#76196)

* add missing xml doc
Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
2 years ago[mono][arm] Fix rethrow instruction size (#76387)
Vlad Brezae [Mon, 3 Oct 2022 08:26:24 +0000 (11:26 +0300)]
[mono][arm] Fix rethrow instruction size (#76387)

It is the same as throw

2 years agoUse System.CommandLine (v2) in dotnet-pgo (#76467)
Adeel Mujahid [Mon, 3 Oct 2022 05:29:39 +0000 (08:29 +0300)]
Use System.CommandLine (v2) in dotnet-pgo (#76467)

* Use System.CommandLine (v2) in dotnet-pgo

* Delete internal CommandLine implementation

* Fix release build

* Use BuildPathDictionay helper in input options

* Restore string[] in compare-mibc

* Fix ILVerify build

* Add BuildPathList helper

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
2 years agoReduce OrderBy overheads for default comparer (#76418)
Stephen Toub [Mon, 3 Oct 2022 02:18:04 +0000 (22:18 -0400)]
Reduce OrderBy overheads for default comparer (#76418)

* Reduce OrderBy overheads for default comparer

If OrderBy is used with a value type key and and a default or no comparer is specified, we can use `Comparer<TKey>.Default.Compare` to avoid the interface dispatch.  This optimization can be taken further, but for now it handles a common set of cases.

* Address PR feedback

2 years agoDelete security object from GCInfo encoder/decoder (#76487)
Jan Kotas [Sun, 2 Oct 2022 23:57:04 +0000 (16:57 -0700)]
Delete security object from GCInfo encoder/decoder (#76487)

Fixes #76482

2 years agoEnsure NI_Vector128_AsVector128 (aka `Vector128<T> AsVector128(this Vector<T> value...
Tanner Gooding [Sun, 2 Oct 2022 16:42:49 +0000 (09:42 -0700)]
Ensure NI_Vector128_AsVector128 (aka `Vector128<T> AsVector128(this Vector<T> value)`) doesn't have a side-effect in its assert (#76460)

* Ensure NI_Vector128_AsVector128 (aka `Vector128<T> AsVector128(this Vector<T> value)`) doesn't have a side-effect in its assert

* CorInfoType no var_types

2 years agoJIT: A small CQ improvement for Equals/StartsWith unrolling (#76439)
Egor Bogatov [Sun, 2 Oct 2022 16:34:38 +0000 (18:34 +0200)]
JIT: A small CQ improvement for Equals/StartsWith unrolling (#76439)

2 years agoProcess primitives in local morph (#76155)
SingleAccretion [Sun, 2 Oct 2022 16:08:26 +0000 (19:08 +0300)]
Process primitives in local morph (#76155)

* Process primitives in local morph

* Delete folding code from morph

* Enable BITCAST folding

Only for RETURN users for now.

* Fix BOOL <-> UBYTE mismatch

We should really delete TYP_BOOL.

* Disable const prop for local fields

The code isn't actually set up for this. No diffs.

* Remove incorrect asserts

2 years agoAttempt to fix native AOT with CryptoKit (#76499)
Kevin Jones [Sun, 2 Oct 2022 05:38:34 +0000 (01:38 -0400)]
Attempt to fix native AOT with CryptoKit (#76499)

2 years agoRe-enable DynamicGenerics test on OSX (#76489)
Jan Kotas [Sun, 2 Oct 2022 04:08:45 +0000 (21:08 -0700)]
Re-enable DynamicGenerics test on OSX (#76489)

Fixes #73299

2 years agoRevert change in AddInternedString (#76496)
Egor Bogatov [Sun, 2 Oct 2022 04:07:48 +0000 (06:07 +0200)]
Revert change in AddInternedString (#76496)

* Restore all logic for AddInternedString

Fixes #76494

2 years agoReinstate strict prototypes warning (#76463)
yowl [Sat, 1 Oct 2022 19:19:07 +0000 (14:19 -0500)]
Reinstate strict prototypes warning (#76463)

* reinstate strict-prototype warning

* More fixes

* Need to keep the warning disabled for zlib

https://github.com/madler/zlib/issues/633

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoFix SuperPMI unit test error checking (#76411)
Bruce Forstall [Sat, 1 Oct 2022 18:48:43 +0000 (11:48 -0700)]
Fix SuperPMI unit test error checking (#76411)

* Fix SuperPMI unit test error checking

We were ignoring test failures, and even ignoring if the test
we wanted to run under collection actually existed. This means
that at some point during recent test reconfigurations, we
stopped building 10w5d_cs_do.cmd/sh but we didn't notice. Because
Bytemark kept being built as before, we got at least some .mc
files.

Add more checking that the programs we want to run exist, and
that the tests we invoke pass.

* Adjust superpmi unit test collection tests

Add CscBench to get better C# coverage.

Disable 10w5d_cs_do.csproj due to https://github.com/dotnet/runtime/issues/76421

2 years ago[JIT] Fix potential division by zero in fgopt.cpp (#76424)
Gilles Grospellier [Sat, 1 Oct 2022 16:32:12 +0000 (18:32 +0200)]
[JIT] Fix potential division by zero in fgopt.cpp (#76424)

Division by zero in C++ is undefined behavior on some architecture and
should be avoided.

Co-authored-by: Andy Ayers <andya@microsoft.com>
2 years agoImplement ChaCha20Poly1305 with CryptoKit on macOS
Kevin Jones [Sat, 1 Oct 2022 16:02:03 +0000 (12:02 -0400)]
Implement ChaCha20Poly1305 with CryptoKit on macOS

Co-authored-by: Filip Navara <filip.navara@gmail.com>
2 years agoJIT: allow forward sub of QMARK nodes (#76476)
Andy Ayers [Sat, 1 Oct 2022 15:16:53 +0000 (08:16 -0700)]
JIT: allow forward sub of QMARK nodes (#76476)

There is often a single-def single use temp consuming a QMARK (which in
turn often comes from expansion of `isinst` and friends). This temp
assignment tends to stay around and can inhibit redundant branch opts
in a number of interesting cases. It may also serve as an attractive
nuisance for copy prop.

While it would be ideal to generalize RBO to handle assignment side
effects, doing so appears quite challenging, as we would need to rewrite
possibly large chunks of the SSA and VN graphs. Forward sub eliminates
the temp and so clears the way for the existing RBO to remove more branches.

Addresses aspects of the "side effect" enhancements for RBO (see #48115).

2 years agoUpdate jitrollingbuild.py (#76472)
Bruce Forstall [Sat, 1 Oct 2022 14:31:50 +0000 (07:31 -0700)]
Update jitrollingbuild.py (#76472)

Pick up changes made to superpmi.py for more general finding of
`main` branch.

Make "list" choose a default git hash if not specified.

Change `list --all` to show all the JITs for a particular git hash.

Add new `list --global_all` to show all JITs for all git hashes
(this was previously `list --all`).

Fix obsoleted `logging.warn`; use `logging.warning` instead.

2 years agoImprove early bail-out logic in GCInfoDecoder (#76359)
Filip Navara [Sat, 1 Oct 2022 14:12:54 +0000 (16:12 +0200)]
Improve early bail-out logic in GCInfoDecoder (#76359)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoJIT: Avoid internal register allocation when possible for PUTARG_SPLIT (#76443)
Jakob Botsch Nielsen [Sat, 1 Oct 2022 09:48:16 +0000 (11:48 +0200)]
JIT: Avoid internal register allocation when possible for PUTARG_SPLIT (#76443)

We can almost always avoid allocating an internal register, which may be
expensive if LR is picked since we cannot use thumb encoding for it.

The only case where we need an internal register is when we have a
source that is in a register, and we have a single taget register to
place that conflicts with that source register. The to-stack copies then
need an intermediate scratch register to avoid clobbering the source
register.

2 years agoFix DEBUG/non-DEBUG SuperPMI asm diffs (#76470)
Bruce Forstall [Sat, 1 Oct 2022 03:26:37 +0000 (20:26 -0700)]
Fix DEBUG/non-DEBUG SuperPMI asm diffs (#76470)

Recorded SPMI method contexts include configuration environment variables
such as `COMPlus_JITMinOpts` that are replayed. However, when doing
asmdiffs replays to compare a Release to a Checked compiler (non-DEBUG
to DEBUG), there may be codegen-altering configuration variables
such as JitStress that are only read and interpreted by the DEBUG
compiler. This leads to asm diffs.

Introduce a `-ignoreStoredConfig` argument to superpmi.exe, and use it
in superpmi.py when doing Checked/Release asm diffs, that pretends there
are no stored config variables. This assumes that the stored config variables
only alter JIT behavior but that they JIT will succeed with or without them.
This is also slightly more than necessary: if there is a config variable
that the Release compiler knows about, we won't use that, either. However,
we have no easy way (currently) to distinguish which variables are DEBUG
and which are both DEBUG and non-DEBUG available.

Contributes to https://github.com/dotnet/runtime/issues/76347

2 years agoRemove `IDispatchImplAttribute` API (#76416)
Aaron Robinson [Sat, 1 Oct 2022 00:04:49 +0000 (17:04 -0700)]
Remove `IDispatchImplAttribute` API (#76416)

* Remove IDispatchImplAttribute API

This type has never been supported on .NET Core.
Removing all supporting code paths.

2 years agoSuperPMI collections: exclude more files/directories (#76384)
Bruce Forstall [Fri, 30 Sep 2022 23:37:04 +0000 (16:37 -0700)]
SuperPMI collections: exclude more files/directories (#76384)

* SuperPMI collections: exclude more files/directories

Exclude a few more native code files and the 'runtimes' directory
that contains uninteresting files, including native code files,
to reduce the number of PMI exceptions during collections.

* Use python 'list' constructor to avoid modifying global lists

2 years agoUse BCrypt for ephemeral RSA on Windows
Jeremy Barton [Fri, 30 Sep 2022 23:30:51 +0000 (16:30 -0700)]
Use BCrypt for ephemeral RSA on Windows

Windows CNG has two different libraries: bcrypt.dll (`BCrypt*` functions) for in-memory/ephemeral operations, and ncrypt.dll (`NCrypt*` functions) for persisted key operations.  Since the NCrypt functions can also operate on ephemeral keys our cryptographic operations have generally been done in terms of NCrypt.

NCrypt's flexibility (to also work with persisted keys) comes at a cost.  All key operations are done out-of-process (in lsass.exe), and that requires an (L)RPC call for every operation.  It also means there are simply more moving parts, and thus more room for error.

With this change we will use BCrypt for RSA operations on Windows from `RSA.Create()` and `cert.GetRSAPublicKey()`.  ECDSA/ECDH/DSA can any/all be changed to follow suit later.

For keys created from RSA.Create() a verification operation currently looks like

* Virtual invoke to RSAWrapper.VerifyHash
* Maybe-devirtualized invoke to RSACng.VerifyHash
* P/Invoke to NCryptVerifySignature
* "Virtual" invoke to MSKSPVerifySignature (or whatever it's really called)
* LRPC call
* Find key in the MRU ring
* Effectively a call to BCryptVerifySignature

After this change it is instead

* Virtual invoke to RSABCrypt.VerifyHash
* P/Invoke to BCryptVerifySignature

Removing all of those other indirections removes about 40us from a 50us operation (on my primary devbox).

As part of making some code be shared between RSACng and RSABCrypt, some allocating code changed to pooling code and some array code got spanified.

2 years ago[metadata] Skip null vtable entries when checking covariant return overrides (#76323)
Aleksey Kliger (λgeek) [Fri, 30 Sep 2022 23:20:55 +0000 (19:20 -0400)]
[metadata] Skip null vtable entries when checking covariant return overrides (#76323)

* Add test for covariant reabstraction

* [metadata] Skip null vtable entires when checking covariant overrides

When there are covariant return overrides, we check the vtable slot in every
parent class for signature compatability with the proposed override.

However if one of the ancestor classes is abstract, it could have an
abstract override for hte method:

    class Base {
      public virtual Base Method() => this;
    }
    public abstract Intermediate : Base {
      public override abstract Base Method();
    }
    public Leaf : Intermediate {
      public override Leaf Method() => this;
    }

In this case when we're checking that Leaf.Method is compatible with
the vtable slot in Intermediate, we will see a null method (since
Intermediate is abstract).  In such cases we can skip over the class
and continue with its parent.

Fixes
https://github.com/dotnet/runtime/issues/76312

2 years ago[NativeAOT] Enable CI for macOS x64/arm64 (#75421)
Filip Navara [Fri, 30 Sep 2022 21:31:11 +0000 (23:31 +0200)]
[NativeAOT] Enable CI for macOS x64/arm64 (#75421)

* [NativeAOT] Enable CI for macOS x64/arm64

* Update CppCompilerAndLinker condition

* Enable NativeAOT osx-arm64 build in regular runtime pipeline

* Enable cross-compilation on macOS

* Fix HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP when cross-compiling

* Update OSVersion_ValidVersion_OSX test on NativeAOT

The test tries to validate Environment.OSVersion.Version which works correctly. RuntimeInformation.RuntimeIdentifier, however, doesn't use versioned RIDs when NativeAOT is used.

* Add hack to stop linker from corrupting DWARF CFI, bump darwin version in triple to get compact unwinding tables generated

* Bump ObjWriter packages

* Disable MessageSendTests on NativeAOT

Co-authored-by: Adeel <3840695+am11@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoQuick disasm check CI JitStress fix (#76417)
Will Smith [Fri, 30 Sep 2022 20:08:17 +0000 (13:08 -0700)]
Quick disasm check CI JitStress fix (#76417)

Runtime_33972 was failing in ARM64 in JitStress because it turns off HWIntrinsic - so I force the test to enable it.

2 years agoIncrease timeouts for runtime-dev-innerloop legs (#76453)
Jan Kotas [Fri, 30 Sep 2022 20:00:15 +0000 (13:00 -0700)]
Increase timeouts for runtime-dev-innerloop legs (#76453)

Increase timeouts for runtime-dev-innerloop legs to compensate for intermittently slow build machines.

Fixes https://github.com/dotnet/arcade/issues/11072

2 years agoNativeAOT: Conversion for opcode conv_u4 is unsigned (#76386)
yowl [Fri, 30 Sep 2022 18:30:54 +0000 (13:30 -0500)]
NativeAOT: Conversion for opcode conv_u4 is unsigned (#76386)

* fix probable type for conv_u4 to match conv_u8 regards unsigned conversion

* Fix conv_u as well

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoRemove reliance on deactivated A64 queue (#76457)
Drew Scoggins [Fri, 30 Sep 2022 17:41:46 +0000 (10:41 -0700)]
Remove reliance on deactivated A64 queue (#76457)

2 years agoAlways expose parents of exposed promoted fields (#76181)
SingleAccretion [Fri, 30 Sep 2022 15:36:35 +0000 (18:36 +0300)]
Always expose parents of exposed promoted fields (#76181)

* Remove the special case

* Simplify code

* Add tests

2 years agoRemoving short name column from compphases.h (#76030)
Brian Bohe [Fri, 30 Sep 2022 15:30:19 +0000 (08:30 -0700)]
Removing short name column from compphases.h (#76030)

* Avoiding the use of JIT phases shorName

* Removing shortName from JIT phases description

* Avoiding memory allocation

* Renaming variable

2 years agoJIT: increase slop tolerance when computing edge weights (#76409)
Andy Ayers [Fri, 30 Sep 2022 15:18:57 +0000 (08:18 -0700)]
JIT: increase slop tolerance when computing edge weights (#76409)

Up the tolerance a bit to get past some jit stress errors we're seeing.

Fixes the main case in #74169.

2 years ago[mono] Fix iOS/tvOS build with Xcode 14 (#76433)
Alexander Köplinger [Fri, 30 Sep 2022 14:11:13 +0000 (16:11 +0200)]
[mono] Fix iOS/tvOS build with Xcode 14 (#76433)

Before Xcode 14 the `objc_super` struct definition in the SDK headers looked like this:

```
#if !defined(__cplusplus)  &&  !__OBJC2__
    /* For compatibility with old objc-runtime.h header */
    __unsafe_unretained _Nonnull Class class;
#else
    __unsafe_unretained _Nonnull Class super_class;
#endif
```

With Xcode 14 however the iOS/tvOS SDK header was changed to only define `super_class`, but the MacOSX SDK stayed the same.

Added CMake detection of this case so we can compile both on older and newer Xcode SDKs across platforms.

2 years agoSupport running Reflection tests within Visual Studio (#75915)
Steve Harter [Fri, 30 Sep 2022 13:51:44 +0000 (08:51 -0500)]
Support running Reflection tests within Visual Studio (#75915)

2 years agoImplement AuthenticationTagMismatchException exception
Kevin Jones [Fri, 30 Sep 2022 12:56:57 +0000 (08:56 -0400)]
Implement AuthenticationTagMismatchException exception

Co-authored-by: Filip Navara <filip.navara@gmail.com>
2 years ago[wasm] Add a workaround for issue#76429 to fix CI (#76432)
Ankit Jain [Fri, 30 Sep 2022 12:37:41 +0000 (08:37 -0400)]
[wasm] Add a workaround for issue#76429 to fix CI (#76432)

2 years agoAdd QuicError.AlpnInUse member (#74754)
Radek Zikmund [Fri, 30 Sep 2022 12:19:03 +0000 (14:19 +0200)]
Add QuicError.AlpnInUse member (#74754)

* Import new MsQuic interop

* Detect the new QUIC status

* Use correct values for ALPN_IN_USE in interop shim

* Update alpine-3.14-helix-amd64 image to newer

2 years ago[wasm] Pass --web-server-use-cop for threading samples (#76419)
Ankit Jain [Fri, 30 Sep 2022 08:27:04 +0000 (04:27 -0400)]
[wasm] Pass --web-server-use-cop for threading samples (#76419)

* [wasm] Pass --web-server-use-cop for threading samples

* CI: Add wasm samples to wasm specific paths list

2 years agoFix filtered exceptions when checking for ip forwarding (#76383)
Radek Zikmund [Fri, 30 Sep 2022 08:21:58 +0000 (10:21 +0200)]
Fix filtered exceptions when checking for ip forwarding (#76383)

2 years agoFix edit and continue in VS with hardware exceptions (#76401)
Jan Vorlicek [Fri, 30 Sep 2022 08:00:01 +0000 (10:00 +0200)]
Fix edit and continue in VS with hardware exceptions (#76401)

There is a subtle bug in hardware exception handling in the runtime
that causes the debugged process to crash when a user tries to use the
"unwind to this frame" on the frame where the exception happened.
This issue was introduced by the recent changes that modified hardware
exception handling.

The problem turned out to be in how we update the exception and context
records in the HandleManagedFaultFilter when we re-raise the exception
using RaiseException from the VEH. Updating the context is both not
necessary and wrong. All we need to update is the `ExceptionAddress` in
the `EXCEPTION_RECORD`, since the RaiseException puts the address of
itself there and we need the address of the original access violation to
be there.
The context should stay untouched as we are unwinding from the
RaiseException.

The context copying was originally made to mimick the code in the
`NakedThrowHelper` used before the exception handling change. That one
needed the context update, as it was used to fix unwinding over the
NakedThrowHelper that was a hijack helper. In the current state, nothing
like that is needed.

With this fix, the VS debugger works as expected.

2 years agoDistributed transaction fixes (#76310)
Shay Rojansky [Fri, 30 Sep 2022 07:15:06 +0000 (09:15 +0200)]
Distributed transaction fixes (#76310)

* Retake lock when using a dependent transaction from a
  TransactionScope (#76010).
* Reset TransactionTransmitter and Receiver before reusing them
  (#76010).
* Increase MSDTC startup timeout from 2.5 to 30 seconds (#75822)

Fixes #76010
Fixes #75822

2 years ago[mono] Add Vector128 Negate and OnesComplement intrinsics for amd64 (#74993)
Matous Kozak [Fri, 30 Sep 2022 06:04:40 +0000 (08:04 +0200)]
[mono] Add Vector128 Negate and OnesComplement intrinsics for amd64 (#74993)

* Vector128 Negate intrinsics (two's complement)

* AMD64 OnesComplement intrinsics for Vector128/64

* Negate + OnesComplement operands,fix missing break

* Simplify OP_AMD64_NEGATION

* Conditional Select for amd64, refactor arm64 code

* Re-use Arm64 code for Negate and OnesComplement

* rename ones complement

* Update src/mono/mono/mini/mini-ops.h remove space

Co-authored-by: Fan Yang <52458914+fanyang-mono@users.noreply.github.com>
* remove space mini-ops.hs

* remove blank line

Co-authored-by: Fan Yang <52458914+fanyang-mono@users.noreply.github.com>
2 years agoRemove the GenericComPlusCall mechanism (#76415)
Aaron Robinson [Fri, 30 Sep 2022 05:00:13 +0000 (22:00 -0700)]
Remove the GenericComPlusCall mechanism (#76415)

Remove unused asm constants.
Remove comments about context-bound objects and remoting.
Use common constants for VtblGap concept.

2 years ago[NativeAOT] Fix System.Runtime.InteropServices tests (#75669)
Michal Strehovský [Fri, 30 Sep 2022 04:49:26 +0000 (13:49 +0900)]
[NativeAOT] Fix System.Runtime.InteropServices tests (#75669)

2 years ago[mono][jit] For beforefieldinit classes, only field accesses trigger initialization...
Zoltan Varga [Fri, 30 Sep 2022 02:28:26 +0000 (22:28 -0400)]
[mono][jit] For beforefieldinit classes, only field accesses trigger initialization. (#76335)

2 years agoRemove some dead code from Array.IndexOf (#76388)
Stephen Toub [Fri, 30 Sep 2022 02:14:30 +0000 (22:14 -0400)]
Remove some dead code from Array.IndexOf (#76388)

2 years agoRemove GT_ADDEX and replace with more generalized containment handling (#76273)
Tanner Gooding [Fri, 30 Sep 2022 01:24:23 +0000 (18:24 -0700)]
Remove GT_ADDEX and replace with more generalized containment handling (#76273)

* Remove GT_ADDEX and replace with more generalized containment handling

* Handle small types for (extended register) instructions

* Remember to handle IsRegOptional

* Applying formatting patch

* Preference containing the CAST of `ADD(op1, CAST(op2))` rather than the op2 of CAST

* Update src/coreclr/jit/lowerarmarch.cpp

* Adding a test covering the caught fuzzlyn scenario

* Ensure the new test returns 100

* Skip a Fuzzlyn generated regression test on Mono wasm/llvmaot/llvmfullaot

2 years agoDisable gen 1 budget accounting fix for segments, so the segments implementation...
Peter Sollich [Thu, 29 Sep 2022 23:27:21 +0000 (01:27 +0200)]
Disable gen 1 budget accounting fix for segments, so the segments implementation of GC behaves like .NET 6.0 did. (#76365)

2 years ago[tests] Disable source generator tests mobile (#75609)
Mitchell Hwang [Thu, 29 Sep 2022 20:01:59 +0000 (16:01 -0400)]
[tests] Disable source generator tests mobile (#75609)

* Disable Source generator tests on all mobile platforms

* Remove redundant source generator test suite exclusions

2 years agoJIT: optimize redundant branches by looking through phis (#76283)
Andy Ayers [Thu, 29 Sep 2022 18:03:53 +0000 (11:03 -0700)]
JIT: optimize redundant branches by looking through phis (#76283)

In some cases the value of a block's branch predicate is correlated with the
predecessor of the block. Often this correlation is hinted at by the presence
of phis in the predicate's tree and/or phi VNs in in the predicate's VN graph.

For each predecessor of a block, we evaluate the predicate value number using
the values brought to the block by that predecessor. If we find correlations,
we use them to drive the existing jump threading optimization.

Make sure that when we search local PHIs we also match the ssa def
number to ensure we're looking at the right PHI.

Also, if we end up partially disambiguating such that there is just one
remaining predecessor, update the value number of the predicate to reflect
the values that flow in from that predecessor.

Fixes #75944.
Contributes to #48115.

2 years agoEnsure that StoreInd for contained HWIntrinsics has the constant "fit in byte" (...
Tanner Gooding [Thu, 29 Sep 2022 17:56:28 +0000 (10:56 -0700)]
Ensure that StoreInd for contained HWIntrinsics has the constant "fit in byte" (#76385)

2 years agoSPMI: Improve speed significantly for large diffs (#76238)
Jakob Botsch Nielsen [Thu, 29 Sep 2022 17:24:34 +0000 (19:24 +0200)]
SPMI: Improve speed significantly for large diffs (#76238)

This starts communicating more information about diffs back from
superpmi and starts using it in the driver. The current information is
the base size, diff size, base instructions, diff instructions and
context size.

The driver uses the base size/diff size to pick a small number of
interesting contexts and only creates disassembly for these contexts.
jit-analyze is then also invoked on only these contexts, but the
contexts are picked so that they overlap with what jit-analyze would
display. Additionally, we also pick the top 20 smallest contexts (in
terms of context size) -- I frequently use the smallest contexts with
diffs to investigate my change.

The new behavior is only enabled when no custom metrics are specified.
If custom metrics are specified we fall back to producing all
disassembly files and leave it up to jit-analyze to extract and analyze
the metrics specified.

Also, the retainTopFilesOnly option is no longer necessary since our CI
pipeline will at most produce 100 .dasm files now. Another benefit is that
this means that all contexts mentioned in the jit-analyze output will now be
part of the artifacts.

The net result is that we can now get SPMI diffs for changes with even
hundreds of thousands of diffs in the same time as it takes to get diffs
for a small change.

Fix #76178

2 years agoReturn s_defaultResultTask from Task.FromResult in more cases (#76349)
Stephen Toub [Thu, 29 Sep 2022 16:44:23 +0000 (12:44 -0400)]
Return s_defaultResultTask from Task.FromResult in more cases (#76349)

* Return s_defaultResultTask from Task.FromResult in more cases

Today we return a cached task from Task.FromResult when the TResult is a primitive and its value is 0.  But it needn't be constrained to only being a primitive; what matters is that we need to be able to efficiently compare its bit pattern to 0.  And we can do that easily now by using Unsafe.SizeOf to check if the size is the same as a primitive, Unsafe casting to that primitive, and then comparing against 0.

* Update tests

2 years agoremove explicit LangVersion from a few projects (#75806)
kasperk81 [Thu, 29 Sep 2022 16:24:02 +0000 (19:24 +0300)]
remove explicit LangVersion from a few projects (#75806)

* remove explicit LangVersion from a few projects

* feedback

* net7.0

* net7.0

Co-authored-by: kasperk81 <kasperk81 83082615+kasperk81@users.noreply.github.com>
Co-authored-by: kasperk81 <kasperk81 kasperk81 83082615+kasperk81@users.noreply.github.com>
2 years agoDelete malformed package.json used for tests, it confuses Component Governance toolin...
Alexander Köplinger [Thu, 29 Sep 2022 16:19:45 +0000 (18:19 +0200)]
Delete malformed package.json used for tests, it confuses Component Governance tooling (#76309)

2 years agoUpdating owners (#76330)
Eric StJohn [Thu, 29 Sep 2022 15:34:51 +0000 (08:34 -0700)]
Updating owners (#76330)

2 years agoRemove some extra static arrays used in Split() (#76003)
Ilya [Thu, 29 Sep 2022 15:23:24 +0000 (20:23 +0500)]
Remove some extra static arrays used in Split() (#76003)

* Remove some extra static arrays used in Split
* Remove const

2 years agoFix using DependencyGraphViewer with AOT compilers (#76357)
Michal Strehovský [Thu, 29 Sep 2022 14:35:34 +0000 (23:35 +0900)]
Fix using DependencyGraphViewer with AOT compilers (#76357)

The `readonly` addition was one of the 3600 diffs in #74825. `MarkStrategy` can have mutable state that was getting lost because Roslyn considers it valid to put `_marker` into a temporary before calling instance methods on it.

This resulted in DependencyGraphViewer hanging after seeing tens of thousands of new graphs being added.

2 years agoFix value type with static method fails to load (#76262)
James S. Wang [Thu, 29 Sep 2022 14:18:09 +0000 (10:18 -0400)]
Fix value type with static method fails to load (#76262)

* Allow static methods if checking type equivalence

* Add test for loading value type with static method

* Add test in which loading a value type with an instance method should throw a TypeLoadException

2 years agoGenerate single interface dispatch map per canonical form (#76362)
Michal Strehovský [Thu, 29 Sep 2022 14:17:23 +0000 (23:17 +0900)]
Generate single interface dispatch map per canonical form (#76362)

The dispatch maps are identical because canonically-equivalent types have the same vtable layouts.

2 years agoMake KeysCollection.Contains methods public. (#76319)
Eirik Tsarpalis [Thu, 29 Sep 2022 14:05:52 +0000 (17:05 +0300)]
Make KeysCollection.Contains methods public. (#76319)

2 years agoBring back ReadOnlySpan in QuicStream (#76088)
Ilya [Thu, 29 Sep 2022 13:36:12 +0000 (18:36 +0500)]
Bring back ReadOnlySpan in QuicStream (#76088)